Skip to content

Mark specification test projects as non-test projects#37700

Merged
roji merged 1 commit into
dotnet:mainfrom
roji:TestStuff
Feb 13, 2026
Merged

Mark specification test projects as non-test projects#37700
roji merged 1 commit into
dotnet:mainfrom
roji:TestStuff

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Feb 13, 2026

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:

Error:
  An assembly specified in the application dependencies manifest (Microsoft.EntityFrameworkCore.Specification.Tests.deps.json) was not found:
    package: 'Castle.Core', version: '5.2.1'
    path: 'lib/net6.0/Castle.Core.dll'
Testhost process for source(s) '/Users/roji/projects/efcore/artifacts/bin/EFCore.Specification.Tests/Debug/net11.0/Microsoft.EntityFrameworkCore.Specification.Tests.dll' exited with error: Error:
  An assembly specified in the application dependencies manifest (Microsoft.EntityFrameworkCore.Specification.Tests.deps.json) was not found:
    package: 'Castle.Core', version: '5.2.1'
    path: 'lib/net6.0/Castle.Core.dll'
. Please check the diagnostic logs for more information.
  EFCore.Specification.Tests test net11.0 failed with 1 error(s) (0.2s)

(this can also be triggered simply by running dotnet test on 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.

@roji roji requested a review from a team as a code owner February 13, 2026 20:44
Copilot AI review requested due to automatic review settings February 13, 2026 20:44
Copy link
Copy Markdown

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

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> to EFCore.Specification.Tests and EFCore.Relational.Specification.Tests
  • Commented out xunit.runner.visualstudio package reference in EFCore.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 AndriySvyryd removed their assignment Feb 13, 2026
@roji roji enabled auto-merge (squash) February 13, 2026 21:01
@roji roji disabled auto-merge February 13, 2026 22:55
@roji roji merged commit 4b56ce2 into dotnet:main Feb 13, 2026
8 of 10 checks passed
@roji roji deleted the TestStuff branch February 13, 2026 22:55
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.

3 participants