Skip to content

Don't run integration tests in release jobs#7568

Open
Copilot wants to merge 5 commits intomainfrom
copilot/fix-integration-tests-redundancy
Open

Don't run integration tests in release jobs#7568
Copilot wants to merge 5 commits intomainfrom
copilot/fix-integration-tests-redundancy

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Integration tests spawn child processes and run dotnet build internally (already covering both Debug and Release configurations). Running them under both Debug/Release CI matrix entries is redundant—only the test project itself gets rebuilt, not meaningful additional coverage.

Changes

  • azure-pipelines.yml — uses dotnet test --test-modules with a glob pattern to run only unit tests in Release builds:
    • Debug: keeps the original dotnet test command unchanged (runs all tests including integration)
    • Release: uses dotnet test --test-modules "artifacts/bin/*UnitTests*/$(_BuildConfig)/**/*UnitTests.dll" to run only unit test modules, skipping integration tests
    • Integration test binlog copy/publish steps conditioned on eq(variables._BuildConfig, 'Debug') so they're skipped in Release
    • Applied to Windows, Linux, and MacOS jobs

No solution filters or eng/Build.props changes are needed—the build always compiles the full solution. On Linux/Mac, only DLLs built from NonWindowsTests.slnf exist in artifacts/bin/, so the glob pattern naturally excludes Windows-only tests as well.

The official pipeline (azure-pipelines-official.yml) is not affected—its Release builds continue running integration tests as the sole configuration.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Add solution filters (TestFx.NoIntegrationTests.slnf and
NonWindowsTests.NoIntegrationTests.slnf) that exclude integration test
projects and their test assets.

Modify azure-pipelines.yml to use ExcludeIntegrationTests property and
the new solution filters for Release matrix entries, so that integration
tests are only built and run under Debug jobs.

Update eng/Build.props to select the appropriate solution filter based
on the ExcludeIntegrationTests property.

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix redundancy in integration tests for release jobs Don't run integration tests in release jobs Mar 17, 2026
Copilot AI requested a review from Evangelink March 17, 2026 09:51
@Evangelink
Copy link
Member

@copilot Publish integration tests binlogs step fails on release for all OSes as we don't run the tests

… excluded

The 'Copy binlogs' and 'Publish integration tests binlogs' steps fail on
Release jobs because the testsuite binlog directory doesn't exist when
integration tests are excluded. Add condition to only run these steps
when _ExcludeIntegrationTests is 'false' (Debug builds).

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot Publish integration tests binlogs step fails on release for all OSes as we don't run the tests

Fixed in ecc4627. Added condition: and(always(), eq(variables._ExcludeIntegrationTests, 'false')) to the "Copy binlogs" and "Publish integration tests binlogs" steps for all three OS jobs (Windows, Linux, MacOS), so they're skipped on Release builds where integration tests don't run.

@Evangelink
Copy link
Member

@copilot can you please do a different PR where you explore doing the same functional fix but not by creating more slnf but instead by updating the dotnet test command to use:
--test-modules

Filters test modules using file globbing in .NET. Only tests belonging to those test modules will run. For more information and examples on how to use file globbing in .NET, see File globbing.

More info at https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test-mtp

Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot can you please do a different PR where you explore doing the same functional fix but not by creating more slnf but instead by updating the dotnet test command to use:
--test-...

I'm unable to create new PRs — I can only work within the current PR branch. Would you like me to rework this PR to use the --test-modules approach instead of the .slnf files? That would involve reverting the solution filter additions and updating the dotnet test command in azure-pipelines.yml to use --test-modules to exclude integration test assemblies.

@Evangelink
Copy link
Member

@copilot ok let's reword this PR then

… tests in Release

Replace the solution filter approach with dotnet test --test-modules glob pattern.
For Release builds, runs only unit test modules via:
  --test-modules "artifacts/bin/*UnitTests*/$(_BuildConfig)/**/*UnitTests.dll"
For Debug builds, keeps original test commands unchanged.

Removes TestFx.NoIntegrationTests.slnf and NonWindowsTests.NoIntegrationTests.slnf.
Reverts eng/Build.props to original (no ExcludeIntegrationTests logic needed).

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot ok let's reword this PR then

Reworked in c6ff763. Replaced the .slnf approach with --test-modules:

  • Deleted TestFx.NoIntegrationTests.slnf and NonWindowsTests.NoIntegrationTests.slnf
  • Reverted eng/Build.props to original (no changes needed)
  • Release test step now uses:
    dotnet test --test-modules "artifacts/bin/*UnitTests*/$(_BuildConfig)/**/*UnitTests.dll"
    
    This glob matches all unit test DLLs while naturally excluding integration test modules. On Linux/Mac, only DLLs built from NonWindowsTests.slnf exist in artifacts/bin/, so the pattern also excludes Windows-only tests.
  • Debug test step unchanged — runs all tests (unit + integration) as before
  • Integration test binlog steps conditioned on eq(variables._BuildConfig, 'Debug')

@Evangelink
Copy link
Member

@Youssef1313 I was reviewing the tests and I wonder if we should only skip acceptance tests but still run the other integration tests (specifically for MSTest).

@Evangelink Evangelink marked this pull request as ready for review March 20, 2026 09:00
Copilot AI review requested due to automatic review settings March 20, 2026 09:00
@Evangelink Evangelink enabled auto-merge March 20, 2026 09:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the unofficial CI pipeline to avoid running integration tests in Release matrix legs (keeping them in Debug only), reducing redundant work while still running unit test coverage.

Changes:

  • Conditioned existing dotnet test steps to run only for Debug.
  • Added dotnet test --test-modules in Release to execute only unit test assemblies from artifacts/bin/....
  • Conditioned integration-test binlog copy/publish steps to run only for Debug on Windows/Linux/macOS jobs.

Copy link
Member

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

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

I've spent a minute figuring out why you run the tests twice, hardcoding the config into the paths would make it much easier to see that one step is for debug and other is for release, or at least moving the condition up.

Also do you need to run debug tests at all ?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Don't run integration tests in release jobs

5 participants