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
test(slsa): add comprehensive tests for RequireAttestation configuration
Add test coverage for the new RequireAttestation configuration:
- Extend TestBuildCommandFlags with 3 test cases for --slsa-require-attestation flag
- Default value (false)
- Enabled via flag
- Explicitly disabled via flag
- Add TestParseSLSAConfig with 6 test cases for configuration parsing logic
- Verification disabled
- Verification enabled without source URI (error case)
- Verification enabled with source URI
- RequireAttestation via environment variable
- RequireAttestation via CLI flag (overrides env var)
- CLI flag disables RequireAttestation (overrides env var)
Tests follow existing patterns in build_test.go and verify:
- Flag parsing and default values
- Environment variable handling
- CLI flag precedence over environment variables
- Configuration object creation with correct RequireAttestation value
All tests pass successfully.
Co-authored-by: Ona <no-reply@ona.com>
0 commit comments