Add acceptance coverage for GH history, step-summary sections, and --show-slowest-tests - #10863
Conversation
…show-slowest-tests Adds end-to-end coverage identified as missing for MTP 2.4: - GitHubActionsReportTests: a 'timed' framework mode plus tests asserting that --report-gh-step-summary-sections gates the slow-tests vs test-results sections, and that --report-gh-history persists and accumulates samples across two real GITHUB_RUN_ID runs. - ShowSlowestTestsTests: an active acceptance test asserting the terminal --show-slowest-tests section is rendered, ranked slowest-first, capped at the requested count, and absent when not requested. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
✅ 22/22 dimensions clean — no findings.
Applicable dimensions reviewed in depth (test-only PR, test/IntegrationTests/):
- Algorithmic Correctness: Assertion parameter order verified against
Assert.IsGreaterThan(lowerBound, value)/Assert.IsLessThan(upperBound, value)signatures — all correct. - Test Isolation: History file uses
Guid.NewGuid()inTestRunDirectory;ShowSlowestTestsuses a shared read-only fixture — no shared mutable state. - Flakiness Patterns: Durations are fabricated via
TimingProperty(no real waits); no duration-string assertions on terminal output; no hard-coded ports or timing dependencies. - Resource Management:
JsonDocumentcorrectly disposed withusing var; history file lives inTestRunDirectory(auto-cleaned). - Assertion Quality: Assertions verify the right things — section presence/absence, ranking order via string indices, history schema structure and sample counts.
- Test Completeness: New features (
--report-gh-step-summary-sections,--report-gh-history,--show-slowest-tests) each have positive and negative test cases.
Dimensions N/A (no production code, no analyzers, no IPC, no dependencies, no PowerShell, no MSBuild files): 4, 5, 6, 8, 9, 18, 19, 20, 22.
🧵 Parallel-safety audit — PR #10863Parallelization — audited assembly:
Findings: A (global-state) Both changed test files were audited against every category:
The assembly's Nothing to flag for parallel-safety. Advisory only — heuristic, non-blocking. Re-run with
|
🧪 Expert test review — PR #10863Reviewed the 5 new test methods added across
This advisory comment was generated automatically. Grades are heuristic
|
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
Adds end-to-end coverage for MTP’s GitHub Actions reporting and terminal slow-test summary behavior.
Changes:
- Tests GitHub step-summary section filtering and history persistence across runs.
- Tests
--show-slowest-testsranking, count limits, and opt-in behavior.
| File | Description |
|---|---|
GitHubActionsReportTests.cs |
Covers summary filtering, timed tests, and persisted history. |
ShowSlowestTestsTests.cs |
Adds acceptance coverage for terminal slow-test reporting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Why
While reviewing MTP 2.4 readiness we found a few user-facing behaviors that were only exercised by unit tests and had no end-to-end coverage. This adds acceptance tests that drive real Microsoft.Testing.Platform sessions so the behaviors are validated the way users actually hit them.
What
Two areas, both under
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/:GitHub Actions report (
GitHubActionsReportTests.cs)"timed"mode on the existingDummyTestFrameworkthat publishes several passing tests, each carrying aTimingPropertywith a distinct duration, so the job summary has real durations to rank.--report-gh-step-summary-sectionsgating: one test assertsslow-testsrenders the slowest section while the test-results totals table is gated out, and its inverse assertstest-resultskeeps the totals table while omitting the slowest section.--report-gh-historypersistence: runs the same asset twice with distinctGITHUB_RUN_IDvalues (and a fixedRUNNER_OSso the persisted samples pass schema validation on the next read), then parses the JSON snapshot and asserts the schema version plus two accumulatedpassedsamples, one per run id. This is the first coverage that the history file actually survives and merges across separate runs.Terminal
--show-slowest-tests(ShowSlowestTestsTests.cs, new)[Ignore]d). A dedicated asset publishes four passing tests with well-separated durations, and the test asserts theSlowest tests:section is rendered, ranked slowest-first, capped at the requested count (the fastest test is dropped at--show-slowest-tests 3), and absent when the option is not passed.Notes for reviewers
GITHUB_RUN_IDper run and a fixedRUNNER_OS; the comment in the test explains why.build.cmd -pack -c Releasethen running both classes in Release: ShowSlowestTestsTests 6/6 and GitHubActionsReportTests 39/39 passed across net462/net8.0/net10.0.