test: align test_module_metadata assertions with tuple form of requires_config (#120) #157

Merged
Mark merged 1 commit from fix/120-requires-config-tuple into main 2026-09-18 13:48:00 +00:00
Owner

Summary

Fix the ~19 test failures on main where test_module_metadata cases still assert the list[str] form of EvidenceModule.requires_config. The base class now declares the attribute as ClassVar[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_metadata methods):

  • backend/tests/test_cascade_integration.py
  • backend/tests/test_email_osint.py
  • backend/tests/test_entity_linker.py
  • backend/tests/test_phone_osint.py
  • backend/tests/test_relationship_builder.py
  • backend/tests/test_report_generator.py
  • backend/tests/test_suspect_tracker.py
  • backend/tests/test_threat_intel_aggregator.py
  • backend/tests/test_timeline_reconstruction.py
  • backend/tests/unit/test_modules_dehashed.py (("dehashed_api_key",))
  • backend/tests/unit/test_modules_reddit.py
  • backend/tests/unit/test_modules_twitter.py
  • backend/tests/unit/test_search_aggregator.py (("brave_api_key",))
  • backend/tests/unit/test_social_finder.py
  • backend/tests/unit/test_timeline_reconstruction.py

The two test_module_metadata cases in test_base.py and tests/unit/test_module_base.py assert against a synthetic ConcreteEvidenceModule subclass that itself declares requires_config: ClassVar[list] = [...] — those assertions were intentionally left as-is (they pass independently of the base ClassVar).

Verification

  • Targeted: pytest -k "test_module_metadata or test_module_requires_api_key" → 8/8 pass on the patched branch.
  • File-by-file: each patched test file's full suite passes (331/331 across the 15 patched files).
  • Full repo (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 pytest when 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

## Summary Fix the ~19 test failures on `main` where `test_module_metadata` cases still assert the `list[str]` form of `EvidenceModule.requires_config`. The base class now declares the attribute as `ClassVar[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_metadata` methods): - `backend/tests/test_cascade_integration.py` - `backend/tests/test_email_osint.py` - `backend/tests/test_entity_linker.py` - `backend/tests/test_phone_osint.py` - `backend/tests/test_relationship_builder.py` - `backend/tests/test_report_generator.py` - `backend/tests/test_suspect_tracker.py` - `backend/tests/test_threat_intel_aggregator.py` - `backend/tests/test_timeline_reconstruction.py` - `backend/tests/unit/test_modules_dehashed.py` (`("dehashed_api_key",)`) - `backend/tests/unit/test_modules_reddit.py` - `backend/tests/unit/test_modules_twitter.py` - `backend/tests/unit/test_search_aggregator.py` (`("brave_api_key",)`) - `backend/tests/unit/test_social_finder.py` - `backend/tests/unit/test_timeline_reconstruction.py` The two `test_module_metadata` cases in `test_base.py` and `tests/unit/test_module_base.py` assert against a synthetic `ConcreteEvidenceModule` subclass that itself declares `requires_config: ClassVar[list] = [...]` — those assertions were intentionally left as-is (they pass independently of the base ClassVar). ## Verification - Targeted: `pytest -k "test_module_metadata or test_module_requires_api_key"` → 8/8 pass on the patched branch. - File-by-file: each patched test file's full suite passes (331/331 across the 15 patched files). - Full repo (`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 `pytest` when 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
test: align test_module_metadata assertions with tuple form of requires_config
Some checks failed
CI / Frontend Lint (pull_request) Successful in 21s
Performance Regression Tests / Performance Regression Detection (pull_request) Failing after 38s
Performance Regression Tests / Compare with Baseline (pull_request) Has been skipped
CI / Backend Lint & Format (pull_request) Successful in 2m53s
CI / All Checks Passed (pull_request) Successful in 17s
b2a646e36d
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
Mark merged commit d9dc0f8688 into main 2026-09-18 13:48:00 +00:00
Mark referenced this pull request from a commit 2026-09-18 13:48:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/osint-hub!157
No description provided.