Mark specification test projects as non-test projects#37700
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents test discovery on specification test projects by marking them with <IsTestProject>false</IsTestProject>. Specification test projects contain abstract base test classes that are extended by provider-specific test projects, but are not meant to be run directly. Currently, tools like VS Code attempt test discovery on these projects, which fails with dependency errors (e.g., Castle.Core assembly not found) and unnecessarily slows down test discovery.
Changes:
- Added
<IsTestProject>false</IsTestProject>toEFCore.Specification.TestsandEFCore.Relational.Specification.Tests - Commented out
xunit.runner.visualstudiopackage reference inEFCore.Specification.Tests(test runner not needed for non-runnable projects)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj | Added IsTestProject=false and commented out xunit.runner.visualstudio package reference |
| test/EFCore.Relational.Specification.Tests/EFCore.Relational.Specification.Tests.csproj | Added IsTestProject=false property |
AndriySvyryd
approved these changes
Feb 13, 2026
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.
Our specification test projects aren't actual test projects in the sense that tests should be run in them directly; they're there so that providers can extend them, and those concrete test projects are indeed "runnable" test projects.
As things are, e.g. VS Code needlessly attempts to perform test discovery on the specification projects and triggers the following:
(this can also be triggered simply by running
dotnet teston the EFCore.Specification.Tests). I also suspect this may be slowing test discovery considerably as EFCore.Specification.Tests is huge, but doesn't actually contain (runnable) tests.This adds
<IsTestProject>to prevent detecting these projects as test projects.