Skip to content

Conversation

@fproulx-boostsecurity
Copy link

Summary

  • Add env field to Test model for specifying environment variables in tests.yaml
  • Add env field to MatrixEntry model to pass environment variables through matrix expansion
  • Update to_matrix_entries() to propagate env vars from Test to MatrixEntry
  • Add unit tests for env field parsing and serialization

Context

This is Phase 1 of the E2E test environment variables implementation plan documented in docs/PLAN-e2e-test-env-vars.md. This enables specifying environment variables like BOOST_TF_TAGS_POLICY in tests.yaml files:

tests:
  - name: "aws-with-tag-policy"
    type: "source-code"
    source:
      url: "https://github.com/boost-sandbox/checkov-tf-plan-testing.git"
      ref: "main"
    scan_paths:
      - "aws-security-violations"
    env:
      BOOST_TF_TAGS_POLICY: '{"required_tags":["Environment"]}'

Test plan

  • Unit tests for env field passthrough
  • Unit tests for env field serialization
  • Integration tests updated for new env field in matrix output
  • All 161 tests pass with 100% coverage
  • Linting passes (mypy + ruff)

🤖 Generated with Claude Code

…ment variables

Support custom environment variables in tests.yaml for scanner tests.
The env field is an optional dict[str, str] that passes through from
Test to MatrixEntry during matrix expansion.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Contributor

@lindycoder lindycoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With @Dyc0de we considered having an allow list of prefix to avoid screwing up stuff in ways we can't think of, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants