Add test coverage for ResultsComparer and CLI helper paths#5199
Open
LoopedBard3 wants to merge 4 commits intodotnet:mainfrom
Open
Add test coverage for ResultsComparer and CLI helper paths#5199LoopedBard3 wants to merge 4 commits intodotnet:mainfrom
LoopedBard3 wants to merge 4 commits intodotnet:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new unit tests and small robustness tweaks across tooling to improve confidence in ResultsComparer output/CLI parsing and reduce platform-specific test failures.
Changes:
- Added a new
ResultsComparer.Testsproject with coverage forProgram,Data,Helper, andStats. - Updated ResultsComparer logic for filter handling, moniker parsing, and equivalence-test conclusions.
- Improved platform gating in
Startup.Testsand strengthened/nullability-corrected tests in the BenchmarkDotNet.Extensions harness.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tools/ScenarioMeasurement/Startup.Tests/StartupTests.cs | Updates Windows/Linux platform detection and adds an admin-privilege gate for ETW-related tests. |
| src/tools/ResultsComparer/TwoInputsComparer.cs | Treats EquivalenceTestConclusion.Base as non-difference (like Same) when filtering results. |
| src/tools/ResultsComparer/ResultsComparer.sln | Adds the new ResultsComparer.Tests project and additional solution configurations. |
| src/tools/ResultsComparer/Properties/AssemblyInfo.cs | Exposes internals to ResultsComparer.Tests via InternalsVisibleTo. |
| src/tools/ResultsComparer/Program.cs | Makes filter parsing resilient to null filter arrays. |
| src/tools/ResultsComparer/Data.cs | Adjusts moniker detection (including empty-key guard and Contains-based matching for newer TFMs). |
| src/tools/ResultsComparer.Tests/StatsTests.cs | Adds unit tests for Stats formatting/aggregation and validation behavior. |
| src/tools/ResultsComparer.Tests/ResultsComparerTestData.cs | Adds a JSON test-data generator for BDN-like inputs. |
| src/tools/ResultsComparer.Tests/ResultsComparer.Tests.csproj | Introduces the new ResultsComparer unit test project. |
| src/tools/ResultsComparer.Tests/ProgramTests.cs | Adds CLI-level tests validating error output and “no diffs” behavior. |
| src/tools/ResultsComparer.Tests/HelperTests.cs | Adds tests for file discovery and JSON deserialization helpers. |
| src/tools/ResultsComparer.Tests/DataTests.cs | Adds tests for nested zip + tar.gz extraction and dedup/version preference logic. |
| src/tests/harness/BenchmarkDotNet.Extensions.Tests/PartitionFilterTests.cs | Makes parsed config nullable-aware and asserts non-null on success. |
| src/tests/harness/BenchmarkDotNet.Extensions.Tests/CommandLineOptionsTests.cs | Adds more test cases for parsing/removal helpers (strings/bool/int). |
| src/harness/BenchmarkDotNet.Extensions/CommandLineOptions.cs | Fixes parsing when the target string parameter switch is missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This expands automated coverage in the repo’s tooling-focused test surface without large production refactors.
What changed
Added a new
ResultsComparer.Testsproject covering:Expanded
BenchmarkDotNet.Extensionscommand-line option tests to cover:Improved
Startup.Testsreliability by skipping ETW-dependent Windows tests when not running elevated, instead of aborting the runSmall correctness fixes found while adding coverage
The new tests exposed a few edge-case bugs, which are fixed in this PR:
CommandLineOptions.ParseAndRemoveStringsParameternow handles missing switches safelyResultsComparer.Programnow tolerates a missing optional--filterTwoInputsComparernow treatsEquivalenceTestConclusion.Baseas a no-diff caseResultsComparer.Datamoniker parsing is now null-safe for additional archive path shapesValidation
Validated the affected suites in the available environment:
ResultsComparer.TestspassingBenchmarkDotNet.Extensionscommand-line tests passingStartup.Testsnow skip environment-dependent cases cleanly