Repository navigation
test(security): the security and crypto tests split by behaviour, with snapshots, property tests and the shared builders - #2566
Merged
Conversation
… property tests and the AIBOM snapshot
…F document and run the CLI tests through the cli fixture The SARIF tests become seven behaviour files under tests/security/, the two tflint files become one, and the consolidation-named scanner-base test file takes a behaviour name. The SARIF document is a syrupy snapshot, which holds the same document as the deleted golden file. make_normalized_finding and make_finding replace the local finding factories, the cli fixture replaces the module-level CliRunner()s, and the remaining catch-all tests of the named files are dissolved.
Owner
Author
|
Test evidence:
Mutation checks (each run on the new property test alone, product code restored after):
Old test name (file) -> new test(s) (file under tests/security/ unless named): test_reference_extractor.py
test_aibom.py (stays in tests/)
test_ssh.py (stays in tests/)
test_tflint.py + test_security_tflint.py -> tests/security/test_tflint.py
test_security_sarif.py -> eight files under tests/security/ (136 of its 137 tests keep their names)
Other catch-alls in the named files, dissolved the same way:
Pending a person: review the diff in tuicr ( |
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.
The security and crypto tests now have one file for each behaviour, with snapshots, Hypothesis properties, the shared builders and the
clifixture. This is part 4 of #1332.tests/test_security_sarif.pybecomes seven files undertests/security/: finding normalization, fingerprints, correlation, SARIF emission, SARIF ingestion, the suppression policy and the scan report.tests/test_reference_extractor.pybecomes six: address classes, name classes, extraction, false positives, the literal parsers and the report order.tests/security/test_tflint.py, and the consolidation-named files becometests/security/test_scanner_base_and_registry.pyandtests/security/test_secret_redaction.py.tests/golden/sarif_report.json, which is deleted. The AIBOM snapshot matches its random serial number and its timestamp by type._ensure_known_hostappends to known_hosts.make_normalized_findingjoinsmake_findingintests/support/builders.pyand replaces the SARIF file's local factory;make_findingreplaces the gitleaks file's. Theclifixture replaces the eleven module-levelCliRunner()s.devops scan sbompasses Trivy's output through byte for byte, which the tests already assert.Closes #2545
Change:
openspec/changes/archive/2026-10-28-2545-security-tests-by-behaviour/