Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test discovery on JetBrains Rider #521

Open
arialdomartini opened this issue Mar 11, 2025 · 5 comments
Open

Test discovery on JetBrains Rider #521

arialdomartini opened this issue Mar 11, 2025 · 5 comments

Comments

@arialdomartini
Copy link
Contributor

I feel stupid but I cannot run tests from Rider. I tried both on Windows and Linux, with several versions of Expecto and SDKs.

I mean: right after a fresh clone of this very repository,

dotnet run --project .\Expecto.Tests\Expecto.Tests.fsproj

works, but running all the tests in Rider (Run All Tests from Solution) results in

No tests in solution

Following the README and running:

$ dotnet new expecto -n example -o example  
The template "Expecto .net core Template" was created successfully.

$ cd example
$ dotnet run
C:\prg\personal\example\example.fsproj : error NU1202: Package YoloDev.Expecto.TestSdk 0.15.3 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package YoloDev.Expecto.TestSdk 0.15.3 supports: net8.0 (.NETCoreApp,Version=v8.0)

The build failed. Fix the build errors and run again.

Updating the fsproj file to target net8.0 makes dotnet run succeed. In this case Rider does discover tests, but they all fail from running. They are marked as Inconclusive, raising the error

Method not found: 'TestPrinters TestPrinters.withBeforeEach

I am sure I missing something very basic.

@farlee2121
Copy link
Collaborator

I think two things are going on here

  1. Expecto alone doesn't support vstest (the tool behind dotnet test + Rider and Visual Studio's test explorers). You also need YoloDev.Expecto.TestSdk, similar to how for xUnit you'd need xunit.runner.visualstudio.
    a. The Expecto repo itself doesn't use YoloDev.Expecto.TestSdk, so it doesn't work with dotnet test. You can run all the tests with .\fake build -t RunTest or a single test project like dotnet run --project ./Expecto.Tests

  2. The template really needs updated. It's giving you the latest version of YoloDev, but a rather old version of Expecto. YoloDev 0.15.3 requires Expecto 10.2.2 or higher.

@farlee2121
Copy link
Collaborator

I opened a PR to update the template

@TheAngryByrd
Copy link
Contributor

@farlee2121 does it make sense to move YoloDev and the Template into this repository?

@farlee2121
Copy link
Collaborator

I've been thinking about asking @haf his opinion on making Expecto into an organization.
That way we could bring all the libraries that are part of the core Expecto experience into one place, but still let the current maintainers retain control

@haf
Copy link
Owner

haf commented Mar 17, 2025

Generally not against it, but I find that it becomes very far removed from being personal that way. I like to have my open source on my github. I wouldn't mind giving more people write access, and I prefer monorepos over many small repos.

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

No branches or pull requests

4 participants