YoloDev / YoloDev.Expecto.TestSdk

30 stars 18 forks source link

Tests are not found in net48 #43

Closed isaacabraham closed 2 years ago

isaacabraham commented 3 years ago

We have a net48 project with some tests. We have the following dependencies:

<PackageReference Include="Expecto" Version="8.13.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.8.0" />

0.8.0 is the latest version that works with netfx, so that's the one we picked, and the associated max version of Expecto (8.13.2).

However, when we run dotnet test, we see the following:

A total of 1 test files matched the specified pattern.
No test is available in {test project}. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

What are we doing wrong?

Alxandr commented 3 years ago

This is always really tricky to debug. The MS.NET test sdk does a great job of not reporting what the actual issue is, swallowing exceptions, and generally just being unhelpful (to developers). There is a command-line argument you can pass to it (I don't remember off the top of my head) to tell it which provider to use. You can try that, and point that at the expecto test-sdk dll. It might give you more/better errors (and/or just work). You should also check your output folder (bin/Debug/net48) for the test adapter (as far as I remember, it has to be there).

That's all the things I can think of off the top of my head at least.

isaacabraham commented 3 years ago

Thanks for getting back so quickly. I'll check.

isaacabraham commented 3 years ago

By expecto test-sdk am I right that you're referring to expecto.visualstudio.testadapter.dll?

Alxandr commented 3 years ago

Yes. That should be the one.

isaacabraham commented 3 years ago

Sadly, doesn't work. I'm happy to make a dumbed-down repro if you'd be interested?

Alxandr commented 3 years ago

Sorry, but I'm not using F# anymore, and net framework isn't supported by this project anymore. I don't want to go through re-figuring out how that whole discovery of testadapter worked again. Did you give it the command line value to specify it's location? And you still got zero tests?

isaacabraham commented 3 years ago

Yes, and yes, I tried - didn't work.

No worries, I appreciate you do this in your spare time, you don't have to justify not wanting to work on stuff that isn't supported any more.

Alxandr commented 3 years ago

I believe I've vastly improved the testing, so it should be doable to attempt to re-add net-framework support and have tests that show whether or not it fails in CI. That being said I'm not going to work on this myself (beyond providing some assistance if needed).

Alxandr commented 2 years ago

Stale issue - and I'm not interested in supporting .NET framework anymore that what may accidentally work at this point.