Skip to content

Review simplify compatibility sources, deduplicate tests#15472

Merged
nohwnd merged 6 commits into
microsoft:mainfrom
nohwnd:review-compat-matrix
Mar 10, 2026
Merged

Review simplify compatibility sources, deduplicate tests#15472
nohwnd merged 6 commits into
microsoft:mainfrom
nohwnd:review-compat-matrix

Conversation

@nohwnd

@nohwnd nohwnd commented Mar 10, 2026

Copy link
Copy Markdown
Member

Description

Split the compatibility sources to 4 levels, wrapper, runner, testhost and adapter. Review how tests are generated, and reduce the number of tests generated. E.g. mstest source was generating 40 tests for each runner and host, instead of just combination of adapter versions and hosts, which is where adapter runs.

On the other hand RunnerCompatibilitySource generates by default tests for VSIX and inProcess.

Related issue

Related #15464
Related #15470
Fix #15454

Copilot AI review requested due to automatic review settings March 10, 2026 12:54
{
var dataRows = new List<RunnerInfo>();

if (WithEveryVersionOfRunner)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were two sources of the data, idea was that TestPlatformCompatibilitySource, has some more powerful api to generate exactly what is needed, but this makes it really hard to understand what it will do, and that source is for experimentation only anyway. So now we simply generate all combinations of the input data (with some special handling for in process - just because we don't have "unknown" for testhost version.

All in all this is not needed anymore, and was causing bugs for mstest source, which provided all test runner versions, and WithEveryVersionOfRunner = false, which had no effect. So tests were generated for every runner version, which does not make sense.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies and deduplicates the compatibility test data sources by splitting them into 4 focused levels: wrapper, runner, testhost, and adapter. It reduces test generation (e.g., MSTest source was generating 40 tests per runner/host instead of just adapter/host combinations). A new WrapperCompatibilityDataSource is introduced for VSTestConsoleWrapper-specific tests, while TestPlatformCompatibilityDataSource is renamed to CustomCompatibilityDataSource.

Changes:

  • New WrapperCompatibilityDataSource added; existing data sources simplified by removing configurable parameters in favour of fixed defaults.
  • CompatibilityRowsBuilder refactored: removed separate AddEveryVersionOf* / AddOlderConfigurations methods, replaced with a single AddRows method.
  • Multiple test methods updated to use WrapperCompatibilityDataSource instead of RunnerCompatibilityDataSource.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Extension/WrapperCompatibilityDataSource.cs New data source for VSTestConsoleWrapper-specific compatibility tests
Extension/RunnerCompatibilityDataSource.cs Simplified: removes configurable parameters, always sets WithInProcess = true and WithVSIXRunner = true
Extension/TesthostCompatibilityDataSource.cs Simplified: removes configurable runner framework parameter, uses fixed runner defaults
Extension/MSTestCompatibilityDataSource.cs Simplified: focuses on adapter vs. host combinations with fixed runner version
Extension/TestPlatformCompatibilityDataSource.cs Renamed to CustomCompatibilityDataSource, simplified docstring
Extension/CompatibilityRowsBuilder.cs Core refactor: removes separate per-dimension iteration methods, adds deduplication logic
AcceptanceTestBase.cs Adds DEFAULT_HOST_NET and DEFAULT_RUNNER_NET constants
ExecutionTests.cs Removes RunTestsFromMultipleMSTestAssemblies, renames RunMultipleTestAssemblies
TranslationLayerTests/*.cs Updates data source attributes from RunnerCompatibilityDataSource to WrapperCompatibilityDataSource

{
// Older configurations where the runner, host and adapter version are the same.
// We already added the row where all are newest when adding combination with all runners.
foreach (var runnerVersion in _runnerVersions)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole method tries to be less clever. Whatever you specify, it will give you all combinations. Before we had different methods that tried to encode some of the thinking (e.g. when testing testhost, we don't need every version of runner), now instead this is done via the input data - you provide just 1 version of the runner to use, and so you will get 1 combination.

//TODO: It looks like the first 3 tests would be useful to multiply by all 3 test frameworks, should we make the test even more generic, or duplicate them?
[TestMethod]
[TestCategory("Windows-Review")]
[MSTestCompatibilityDataSource(InProcess = true)]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now default.

Comment thread test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs Outdated
[TestMethod]
[TestCategory("Windows-Review")]
[TestPlatformCompatibilityDataSource]
public void RunTestsFromMultipleMSTestAssemblies(RunnerInfo runnerInfo)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same tests as above, just multiplied to 100+ tests which can test combinations of versions that are already released.

Copilot AI review requested due to automatic review settings March 10, 2026 14:06
@nohwnd

nohwnd commented Mar 10, 2026

Copy link
Copy Markdown
Member Author

Passed windows tests, committing PR review comments from copilot. Ready to review.

https://github.com/microsoft/vstest/pull/15472/checks?check_run_id=66455678447

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

…ion/WrapperCompatibilityDataSource.cs

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings March 10, 2026 19:31
nohwnd and others added 2 commits March 10, 2026 20:33
…ion/CompatibilityRowsBuilder.cs

Co-authored-by: Copilot <[email protected]>
…ion/CompatibilityRowsBuilder.cs

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

@nohwnd nohwnd merged commit 9ff9e1e into microsoft:main Mar 10, 2026
2 of 4 checks passed
@nohwnd

nohwnd commented Mar 10, 2026

Copy link
Copy Markdown
Member Author

failing on
image
check if those were flaky or will keep failing in main

This was referenced Jul 6, 2026
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.

Deduplicate entries for compatibility tests

2 participants