fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.28k stars 585 forks source link

Running tests with DotNet.Testing.NUnit3 when targeting netcore or netstandard ? #1738

Closed tobhofmann closed 6 years ago

tobhofmann commented 6 years ago

Description

Hello,

I want to use Nunit (or xUnit) to run tests for netcore or netstandard apps written in f# for windows7. Running the tests does not work.

Repro steps

I'm using Fake 5 (beta 10), Paket, Nunit and FsUnit.Nunit.

The boilerplate test builds fine if I target netcore/netstandard or net45.

Running the test works when I'm targeting good old net45:

!! ("./tests/*.Tests.dll")
  |> DotNet.Testing.NUnit3.NUnit3 id)

If I build the test against netstandard 1.6 and use nunit console-runner 3.7.0 I get LoadLibrary errors unrelated to fake (running the console-runner outside of fake doesn't work either).

This is the command I'm using:

!! ("./tests/*.Tests.dll")
|> DotNet.Testing.NUnit3.NUnit3 (fun p ->
{p with ToolPath = @"./packages/NUnit.ConsoleRunner/tools/nunit3-console.exe"} ))

I've tried using the console-runner from the nuget package and the one included here: https://github.com/nunit/nunit-gui

Is it actually possible to use your DotNet.Testing.NUnit3 API in my case? Failing that, can I use xUnit instead? If it isn't please update your docs: https://fake.build/apidocs/fake-dotnet-testing-nunit3.html

BTW, thanks for the work you put into fake5!

matthid commented 6 years ago

running the console-runner outside of fake doesn't work either

I suggest opening an issue at the nunit3 repository. Once that works it should work in FAKE as well.

matthid commented 6 years ago

Closing the old issue, feel free to comment/reopen a new issue if this still exists.