test: align test_module_metadata assertions with tuple form of requires_config (#120) #157
No reviewers
Labels
No labels
agentic-osint
audit
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:preflight
blocked:verify-failed
bug
chore
deferred
enhancement
feature-request
in-progress
lint-baseline
lint-cleanup
needs-decompose
needs-triage
performance
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/osint-hub!157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/120-requires-config-tuple"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fix the ~19 test failures on
mainwheretest_module_metadatacases still assert thelist[str]form ofEvidenceModule.requires_config. The base class now declares the attribute asClassVar[tuple[str, ...]] = ()to drop the shared mutable default, but the tests were left on the old shape.Changes
15 files, 1-line each: convert
assert self.module.requires_config == [...]to the tuple form()or("key",).Affected test files (all
test_module_metadatamethods):backend/tests/test_cascade_integration.pybackend/tests/test_email_osint.pybackend/tests/test_entity_linker.pybackend/tests/test_phone_osint.pybackend/tests/test_relationship_builder.pybackend/tests/test_report_generator.pybackend/tests/test_suspect_tracker.pybackend/tests/test_threat_intel_aggregator.pybackend/tests/test_timeline_reconstruction.pybackend/tests/unit/test_modules_dehashed.py(("dehashed_api_key",))backend/tests/unit/test_modules_reddit.pybackend/tests/unit/test_modules_twitter.pybackend/tests/unit/test_search_aggregator.py(("brave_api_key",))backend/tests/unit/test_social_finder.pybackend/tests/unit/test_timeline_reconstruction.pyThe two
test_module_metadatacases intest_base.pyandtests/unit/test_module_base.pyassert against a syntheticConcreteEvidenceModulesubclass that itself declaresrequires_config: ClassVar[list] = [...]— those assertions were intentionally left as-is (they pass independently of the base ClassVar).Verification
pytest -k "test_module_metadata or test_module_requires_api_key"→ 8/8 pass on the patched branch.python3.12 -m pytest --no-cov): 1724 passed, 59 failed, 9 skipped. Baseline was 1700 passed / 83 failed → +24 passing, −24 failing from this change. The remaining 59 are unrelated integration/security/live-network failures called out in the issue body.Why this matters beyond the tests
This debt actively breaks the automated fixer lane. kilo-gsd's Verify gate falls back to a bare whole-repo
pytestwhen an issue has no plan-specific verification checklist, so it grades this broken baseline rather than the change under test. On #118 that caused three Bugfix rounds to burn against failures the change never caused — the agent got 82 → 69 by patching unrelated tests, but could never reach green. Clearing this baseline makes the fallback gate trustworthy again.Closes #120
The base EvidenceModule declares requires_config as ClassVar[tuple[str, ...]] to drop the shared mutable default, but 15 test_module_metadata cases still assert against the old list form ([] / ["...key"]). This caused 19 failures (15 in test_module_metadata + a few dependent assertions) on every run of the suite on main, breaking kilo-gsd's whole-repo pytest fallback verify gate. Update each assertion to the tuple form (() / ("key",)) so the suite is green again on the metadata checks. The remaining ~59 unrelated failures (integration/security/live-network) are out of scope for #120. Closes #120