Pre-release quality audit and testability improvements#50
Conversation
- Add BuildMark_MarkdownReportGeneration test - Add BuildMark_GitIntegration test - Add BuildMark_IssueTracking test - Add BuildMark_KnownIssuesReporting test - Tests check for GitHub token and skip gracefully if not available - These tests satisfy requirements GH-1, GH-2, GH-3, RPT-001-009, PLT-001-005 - Tests run BuildMark on itself for self-validation
- Add SkipIfNoGitHubToken() helper to reduce code duplication - All four self-validation tests now use the shared helper - Addresses code review feedback
- Add 'buildnotes' to cspell dictionary for docs/buildnotes/definition.yaml - Add 'myterm' as valid example term used in CONTRIBUTING.md - Add test-results directory to cspell ignore paths to exclude generated files
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot Now that GitHubGraphQLClient has a constructor where HttpClient can be provided, could you write some unit tests to show the FindIssueIdsLinkedToPullRequestAsync GraphQL query works. |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Added comprehensive unit tests for Created
All tests pass (102/102 total), demonstrating the GraphQL query correctly parses GitHub's closingIssuesReferences response structure. |
…n tests Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot I asked for those extra/unnecessary tests to be deleted - there are already BuildMark_XXX tests done in self-validation which produce TRX test results for requirements. Those new tests with the same name in IntegrationTests.cs are totally unnecessary as those tests are already implemented in the production self-validation code correctly without the need for GH_TOKEN. Please remove them and instead code-coverage numbers will be handled separately. |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Removed all 4 duplicate BuildMark_* tests from IntegrationTests.cs in commit 37a9dc7. The canonical self-validation tests in Validation.cs are the correct implementation - they use MockRepoConnector (no GitHub token required) and generate TRX results for requirements traceability via the --validate flag. |
Pull Request
Description
Comprehensive pre-release audit consulting specialized agents for code quality, documentation, dependencies, and CI/CD readiness. Identified and addressed gaps in testability infrastructure.
Key Changes:
GitHubGraphQLClientwith internal constructor acceptingHttpClientfor dependency injection. Enables mocking external GitHub API calls in automated tests without authentication. Maintains ownership semantics—injected clients not disposed by instance.Unit Tests for GitHubGraphQLClient: Added comprehensive test suite (
GitHubGraphQLClientTests.cs) with 7 unit tests demonstrating the GraphQL query functionality:Tests use custom
MockHttpMessageHandlerto inject pre-canned responses without external dependencies.Documentation: Fixed spell check configuration (added "buildnotes", "myterm", excluded "test-results/").
Audit Results:
Requirements Traceability Note: Requirements CLI-007, GH-3, RPT-006, RPT-007 are satisfied by the existing production self-validation tests in
Validation.cs(accessible via--validateflag). These production tests useMockRepoConnectorand generate TRX results for requirements traceability without requiring GitHub tokens.Type of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration ReleaseCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint '**/*.{yml,yaml}'Testing
Documentation
Additional Notes
The new
GitHubGraphQLClientTestsdemonstrate how to leverage the internal constructor for testing GraphQL interactions. The customMockHttpMessageHandlerprovides pre-canned responses without requiring external mocking frameworks, maintaining the project's zero-external-dependency testing approach.Self-validation tests with
BuildMark_*naming convention are implemented in production code (src/DemaConsulting.BuildMark/Validation.cs) and are executed via the--validatecommand-line flag. These tests useMockRepoConnectorto avoid GitHub token requirements and generate TRX test results that satisfy requirements traceability.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.