Skip to content

Conversation

@TheConstructor
Copy link
Contributor

@TheConstructor TheConstructor commented Apr 30, 2025

What does this PR do?

Currently all test-projects except Testcontainers.XunitV3.Tests use Xunit.Net v2. After this PR all test-projects except Testcontainers.Xunit.Tests use Xunit.Net v3

Why is it important?

I would expect that some day in the future Xunit.Net v2 will be discontinued. Also switching to Xunit.Net v3 means, that we can use all the new features like further Asserts and better test-cancellation. See also https://xunit.net/docs/getting-started/v3/whats-new for details

While I do think, that this should be done one day, it does not necessarily need to be today. On the other hand, I did not have problems using v3 so far (in other projects), and it will probably never be easier to switch anyway.

@netlify
Copy link

netlify bot commented Apr 30, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit c31af33
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/681bb31c0622b20008fa6076
😎 Deploy Preview https://deploy-preview-1441--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Indeed, if there's no major blocker, it's a good idea to switch to v3. Thanks.

@TheConstructor TheConstructor force-pushed the feature/xunit3-v2-as-main branch from 90fa6b9 to 5f4c1fa Compare May 5, 2025 18:58
@HofmeisterAn HofmeisterAn changed the title XUnit V3 2.0.1 as default test-framework chore: Update test-framework to xUnit.net v3 May 7, 2025
@HofmeisterAn HofmeisterAn added the chore A change that doesn't impact the existing functionality, e.g. internal refactorings or cleanups label May 7, 2025
@HofmeisterAn
Copy link
Collaborator

Thanks 🙇.

@HofmeisterAn HofmeisterAn merged commit 2a64b17 into testcontainers:develop May 7, 2025
70 checks passed
@0xced
Copy link
Contributor

0xced commented May 20, 2025

This pull request is a nightmare for Rider users, see RIDER-121579 - Duplication of tests. 😕

I'll try to submit a follow-up pull request to address this.

@TheConstructor
Copy link
Contributor Author

This pull request is a nightmare for Rider users, see RIDER-121579 - Duplication of tests. 😕

I'll try to submit a follow-up pull request to address this.

Interesting. I use Rider and did not experience this while authoring the PR or in other projects. Not sure if this means it is only related to v3 > 2.0.1, but then again I use the same XUnit version at work with Rider

@0xced
Copy link
Contributor

0xced commented May 20, 2025

I use Rider and did not experience this while authoring the PR or in other projects.

That's interesting! Have you enabled Testing Platform support? This issue arises with xUnit.net v3 when both Testing Platform and VSTest adapters support are enabled and the test project has package references to both Microsoft.NET.Test.Sdk and xunit.runner.visualstudio. At least this is my understanding of the current situation as of JetBrains Rider 2025.1.2 and xUnit v3 2.0.2.

image

@TheConstructor
Copy link
Contributor Author

I use Rider and did not experience this while authoring the PR or in other projects.

Have you enabled Testing Platform support? This issue arises with xUnit.net v3 when both Testing Platform and VSTest adapters support are enabled and the test project has package references to both Microsoft.NET.Test.Sdk and xunit.runner.visualstudio.

At least my work-Rider has "Enable Testing Platform support" disabled - maybe that's the reason it's not happening to me. I don't think I disabled it intentionally, though

@HofmeisterAn
Copy link
Collaborator

I don't have that problem either (tested on two different machines). "Enable Testing Platform support" is disabled too.

@HofmeisterAn
Copy link
Collaborator

I just refactored a test and added IXunitSerializable, and I noticed another issue. The Rider test explorer isn't showing all the test cases, one of them is missing. In my example, the test explorer shows 3 tests, but the CLI (dotnet test) runs 4 (which is correct). If I intentionally break the missing test, Rider marks the overall test red, but the specific test case still doesn't appear in the test explorer 😐.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A change that doesn't impact the existing functionality, e.g. internal refactorings or cleanups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants