Skip to content

Add self-validation test for --enforce flag#118

Merged
Malcolmnixon merged 2 commits intomainfrom
copilot/add-self-validation-test
Mar 4, 2026
Merged

Add self-validation test for --enforce flag#118
Malcolmnixon merged 2 commits intomainfrom
copilot/add-self-validation-test

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Other projects rely on ReqStream's self-validation evidence to prove --enforce works, but no self-validation test existed for that code path — only unit tests.

Changes

Validation.cs — new RunEnforcementModeTest self-validation test (ReqStream_EnforcementMode):

  • Verifies --enforce exits 0 when all requirements are covered by passing tests
  • Verifies --enforce exits 1 when a requirement has no matching test result

requirements.yaml:

  • VAL-002: adds ReqStream_EnforcementMode as test evidence
  • PLT-001/002/004/005/006: adds platform/runtime-filtered variants (windows@, ubuntu@, dotnet8.x/9.x/10.x@) so platform requirements remain satisfied

ProgramTests.csProgram_Run_WithValidateFlag_RunsValidation: updated expected counts from 4 → 5 and asserts the new test passes.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Self-validation tests pass:
    dotnet run --project src/DemaConsulting.ReqStream --configuration Release --framework net10.0
    --no-build -- --validate
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint .

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

The self-validation test follows the same pattern as the existing RunTraceMatrixTest — creates a temp directory, writes fixture files, runs Program.Run(), and asserts on exit codes.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Add self-validation test for enforce option Add self-validation test for --enforce flag Mar 3, 2026
@Malcolmnixon Malcolmnixon marked this pull request as ready for review March 4, 2026 00:43
@Malcolmnixon Malcolmnixon merged commit b58aaed into main Mar 4, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/add-self-validation-test branch March 4, 2026 00:43
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.

2 participants