Add dump command-line provider validation tests - #11013
Conversation
Expand HangDump and CrashDump validation coverage for option values, dependencies, runtime-specific behavior, and fallback mappings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 511a89f9-e9af-4770-be98-8148c6af9074
🧵 Parallel-safety audit — PR #11013Parallelization — assembly audited:
Nothing audited here touches process-global state, shared filesystem paths, or Both changed files (
Findings: A (global-state) Advisory only — heuristic, non-blocking. Re-run with
|
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.
Expert Review — 22-Dimension Assessment
Verdict: All clear ✅
This PR improves existing unit tests for CrashDumpCommandLineProvider and HangDumpCommandLineProvider by:
- Parameterizing hardcoded single-value tests into
[DataRow]-driven tests covering more edge cases ("None","TrUe","","-1","auto","30s","2m"). - Replacing hardcoded string assertions with resource references (
CrashDumpResources.CrashReportNotSupportedOnWindowsErrorMessage,ExtensionResources.MissingHangDumpMainOption) — more resilient to localization changes. - Tightening assertions —
string.IsNullOrEmpty→Assert.IsNull, and adding failure messages viaAssert.IsTrue(result.IsValid, result.ErrorMessage). - Adding new test cases for filename validation, main-option-only validation,
Triageon .NET Framework, andMapToSupportedDumpType("Unknown")fallback. - Fixing a typo in test name (
IsInvValid→IsInvalid).
Dimension Summary
| # | Dimension | Result |
|---|---|---|
| 1 | Algorithmic Correctness | ✅ N/A — test-only changes; all new assertions verified against source (MapToSupportedDumpType returns "Full" for unknown values, TimeSpanParser.TryParse supports "30s"/"2m" suffixes, resource strings exist and match) |
| 2 | Threading & Concurrency | ✅ N/A |
| 3 | Security & IPC | ✅ N/A |
| 4 | Public API & Binary Compat | ✅ N/A — no API changes |
| 5 | Performance & Allocations | ✅ N/A — test code only |
| 6 | Cross-TFM Compatibility | ✅ #if !NETCOREAPP guard on the Triage/.NET Framework test is correct |
| 7 | Resource & IDisposable | ✅ N/A |
| 8 | Defensive Coding | ✅ N/A |
| 9 | Error Messages & Logging | ✅ Resource-based assertions are an improvement |
| 10 | Naming & Conventions | ✅ Typo fix (IsInvValid → IsInvalid) is good |
| 11 | Documentation | ✅ N/A |
| 12 | Localization | ✅ N/A |
| 13 | Configuration & Options | ✅ N/A |
| 14 | Test Quality | ✅ Stronger parameterization, tighter assertions, better edge-case coverage |
| 15 | Async Patterns | ✅ ConfigureAwait(false) used consistently |
| 16 | Code Duplication | ✅ N/A |
| 17 | Backward Compatibility | ✅ N/A — test-only |
| 18 | Build & Packaging | ✅ N/A |
| 19 | Telemetry & Diagnostics | ✅ N/A |
| 20 | Acceptance Test Conventions | ✅ N/A — these are unit tests |
| 21 | Folder Hotspot | Low risk — test/UnitTests/ |
| 22 | Script & Tooling Hygiene | ✅ N/A |
No issues found. Clean improvement to test coverage and assertion quality.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The added cases are deterministic, correctly asserted, and consistent with provider behavior.
Review tier: Balanced
Findings: None
What changed in this PR
Expands MSTest unit coverage for HangDump and CrashDump command-line validation.
Changes:
- Adds valid and invalid timeout, dump-type, and boolean cases.
- Covers arbitrary filename extensions and main-option behavior.
- Adds runtime-specific HangDump fallback validation.
| File | Description |
|---|---|
HangDumpTests.cs |
Expands timeout, filename, and runtime fallback tests. |
CrashDumpTests.cs |
Expands dump-type, boolean, filename, and main-option tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🧪 Expert test review — PR #11013
This advisory comment was generated automatically. Grades are heuristic
|
Expands unit coverage for the HangDump and CrashDump command-line providers, including timeout formats, dump types, boolean values, dependent and mutually exclusive options, arbitrary filenames, and runtime-specific fallback behavior.
Tests cover both .NET and .NET Framework paths, with 125 focused cases passing on
net9.0andnet472.Fixes #10966