TheAngryByrd / MiniScaffold

F# Template for creating and publishing libraries targeting .NET 6.0 `net6.0` or console apps .NET 6.0 `net6.0`.
https://www.jimmybyrd.me/MiniScaffold/
MIT License
267 stars 31 forks source link

[Question] How to turn parallel test execution off? #221

Closed gsvgit closed 3 years ago

gsvgit commented 4 years ago

I use Expexto for testing and for manual tests execution I specify

open Expecto

[<EntryPoint>]
let main argv =
    let config = { defaultConfig with parallel = false }
    Tests.runTestsInAssembly config argv

Looks like this code is ignored while executing tests from the build script. How can I turn parallel tests execution off in this case?

TheAngryByrd commented 4 years ago

Short Answer: We use to run tests in dotnet test. Here's how you'd configure it.

Long Answer: Yeah this will be a bit confusing since we're using dotnet test (using YoloDev.Expecto.TestSdk) and not dotnet run to run the tests via the build script. Reason why we're using dotnet test is other things like AltCover integrate seamlessly without having to know about Expecto. Reason why it doesn't pick up your config changes is because YoloDev.Expecto.TestSdk has to scan the assembly for tests and isn't running the program via main. I brought up configuring Expecto thru YoloDev in this PR and even tho it is closed, some variant of it made it into the main repo.

gsvgit commented 3 years ago

Thank you!