Skip to content

test(security): the security and crypto test files split by behaviour, with document snapshots, property tests and the shared builders #2545

Closed

Description

@dan-petty

Problem or Motivation

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

Target Subsystem

The security and crypto tests named in #1332.

Existing Tool Considered

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.

Source: #1332

Activity

  1. added
    source/agent
    type/test
    status/new
    value/medium
    effort/high
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    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.
    • Related: test(security): the security and crypto tests run on the process, clock and GitHub session fakes, and the scan gate, the Vault lease registry and git signing leave commands #2543, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. added a commit that references this issue on Oct 28, 2026
    dbfbb65
  5. removed
    status/new
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p2-mediumsource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions