You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(security): the security and crypto test files split by behaviour, with document snapshots, property tests and the shared builders #2545
Part 4 of #1332. The security and crypto test files have the wrong shape: test_security_sarif.py (about 1,460 lines) and test_reference_extractor.py (about 1,270 lines, four catch-alls) mix behaviours; test_tflint.py and test_security_tflint.py test one module; two files are named after a consolidation refactor; documents are compared by hand; local finding factories and ten module-level CliRunner() instances remain.
Proposed Solution & Architectural Design
Split test_security_sarif.py and test_reference_extractor.py by behaviour (Q10), and dissolve the catch-alls (Q8).
Merge the two tflint files, and rename the consolidation-named files after their behaviour.
SARIF, SBOM and AIBOM documents become syrupy snapshots (Q18).
Hypothesis property tests (Q21) for redaction (security/sanitizer.py), suppression-policy evaluation (security/suppression.py) and the known_hosts parser (crypto/known_hosts.py).
syrupy and Hypothesis are the standard snapshot and property-testing libraries; check the pinned dependencies first. The builders and the cli fixture exist (#1310, #1312).
Acceptance criteria
No catch-all test remains in the named files, and one tflint test file exists.
The three documents are snapshots, and the three property tests run.
No local finding factory and no module-level CliRunner() remain in the named files.
Related
Parent: #1332. #1313 places the files; a file named in #1332 belongs to this part wherever #1313 places it.
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
Type: type/test. The change restructures existing test files, adds snapshot and property tests, and adopts shared builders.
Priority: P2-Medium. It is a planned part of an umbrella effort with no user-facing urgency but clear maintainability value.
Value: Medium. It improves test discoverability and adds property-based coverage for security-critical logic without changing product behaviour.
Effort: High. Splitting two files over 1,200 lines, merging two tflint files, writing three property tests, and converting documents to snapshots is substantial.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change restructures existing test files, adds snapshot and property tests, and adopts shared builders.It is a planned part of an umbrella effort with no user-facing urgency but clear maintainability value.It improves test discoverability and adds property-based coverage for security-critical logic without changing product behaviour.Splitting two files over 1,200 lines, merging two tflint files, writing three property tests, and converting documents to snapshots is substantial.Both are parts of #1332 targeting the security and crypto test files, but #2543 moves tests onto merged fakes and extracts command logic while this candidate splits files by behaviour and adds snapshots and property tests.refactor(security): the scanners stop looking for mocks, and their te…
test(security): the security and crypto tests split by behaviour, wit…