Fix false-positive in EnrichmentPipelineTest by introducing mock Config with DummyModule#151
Merged
jnioche merged 1 commit intoDigitalPebble:mainfrom Feb 21, 2026
Conversation
…Test The test was silently passing (false positive) because ew Config() returns an empty module list in the unit test environment, causing the enrichment verification loop to never execute.
Contributor
Author
Member
|
Hi @davide954, am away this week. Will comment and review when I'm back |
Member
Member
|
thanks @davide954 |
Member
actually it does, sorry! Just fixed it |
Contributor
Author
|
ok now I see it works, thanks @jnioche. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The existing
EnrichmentPipelineTestusednew Config()directly,which returns an empty module list in the test environment.
As a result, the enrichment verification loop never executed, making
the test pass silently regardless of whether the pipeline logic was
correct — a false positive flagged by @tejas-2232.
Solution
Following the approach agreed with @jnioche discussed in #142 (mock Config
rather than expanding the schema with all production columns):
DummyModule: a minimalEnrichmentModulethat declares asingle
dummy_enrichedcolumn and sets it to42.0inprocess().createMockConfig(): builds aConfigpre-loaded with theDummyModuleand injects the matching config entry via reflection,following the same pattern used in
ConfigTest.assertFalse(modules.isEmpty()): guard assertion that failsfast if modules are not loaded, preventing silent false positives.
schema.fieldIndex(...)instead of hardcoded positions, making the test robust against
schema changes.
What this does NOT change
EnrichmentPipeline(Usage → enriched, Tax/Fee → skipped).Verification
The parameterized test now actually exercises the enrichment path:
Usage→dummy_enrichedis populated (42.0)Tax→dummy_enrichedremains nullFee→dummy_enrichedremains null