TUnit
TUnit copied to clipboard
Test Discovery not working in JetBrains Rider macOS + Linux
JetBrains Rider About
JetBrains Rider 2024.2.5
Build #RD-242.22855.90, built on September 19, 2024
Licensed to <redacted>
Subscription is active until <redacted>.
Runtime version: 21.0.3+13-b509.15 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
.NET Core v8.0.4 ARM64 (Server GC)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
lermitage.intellij.extratci (2024.5.1)
com.intellij.resharper.HeapAllocationsViewer (2024.2.0)
com.thvardhan.gradianto (5.5)
nsubstitutecomplete-rider (2024.2.0)
com.intellij.ideolog (242.22855.37)
com.markskelton.one-dark-theme (5.12.0)
cognitivecomplexity-rider (2024.2.0)
Key Promoter X (2024.2.0)
Abc.MoqComplete.Rider (2024.1.1.1)
com.intellij.resharper.StructuredLogging (2024.2.0.339)
com.settler.rider.specflow (1.23.6)
com.intellij.ml.llm (242.22855.75)
com.github.dinbtechit.vscodetheme (1.10.11)
com.github.copilot (1.5.23.6819)
com.brandiico.jetbrains-nightfall-theme (2.0.2)
Project setup
I created a new solution with a class library (using .NET 8.0.401) using TUnit 0.1.783 (but have also tried on 0.1.752):
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TUnit" Version="0.1.783" />
</ItemGroup>
</Project>
Then I created the following class:
public class ExampleTests
{
[Test]
public async Task Sample()
{
bool actual = true;
await Assert.That(actual).IsTrue();
}
}
Running it via dotnet test
appears to work:
Determining projects to restore...
All projects are up-to-date for restore.
Example.UnitTests -> /Users/hquinn/Documents/Code/Example/tests/Example.UnitTests/bin/Debug/net8.0/Example.UnitTests.dll
Run tests: '/Users/hquinn/Documents/Code/Example/tests/Example.UnitTests/bin/Debug/net8.0/Example.UnitTests.dll' [net8.0|arm64]
████████╗██╗ ██╗███╗ ██╗██╗████████╗
╚══██╔══╝██║ ██║████╗ ██║██║╚══██╔══╝
██║ ██║ ██║██╔██╗ ██║██║ ██║
██║ ██║ ██║██║╚██╗██║██║ ██║
██║ ╚██████╔╝██║ ╚████║██║ ██║
╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝
v0.1.783.0 | 64-bit | Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 | osx-arm64 | .NET 8.0.8 | Microsoft Testing Platform v1.4.0
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 78ms
Test run summary: Passed! - /Users/hquinn/Documents/Code/Example/tests/Example.UnitTests/bin/Debug/net8.0/Example.UnitTests.dll (net8.0|arm64)
total: 1
failed: 0
succeeded: 1
skipped: 0
duration: 112ms
Tests succeeded: '/Users/hquinn/Documents/Code/Example/tests/Example.UnitTests/bin/Debug/net8.0/Example.UnitTests.dll' [net8.0|arm64]
But the tests are not being discovered. I've already checked "Enable Testing Platform", and I've downgraded Rider to 2024.2.4, but hasn't worked.