mardi 14 juillet 2020

Running tests marked as [Explicit] with dotnet test

Is it at all possible to execute tests marked with the NUnit [Explicit] attribute using dotnet test?

I have some tests which I would like to be ran as a separate build on Bamboo. They take a while to run so didn't want them to be included in the standard test run in VS so marked them with the [Explicit] attribute. I also marked them with [Category("Nightly")] so on Bamboo I hoped to have a step of:

dotnet test --filter "TestCategory=Nightly"

but as expected they still get ignored because of the Explicit property.

I tried explicitly naming, like this:

dotnet test --filter "ClassName=MyTests.Tests.TestClassName"

but still no luck, I've tried all of the possible arguments to dotnet test https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=mstest to refer to the tests specifically but they still get ignored.

Has anyone managed this?

Rich

Aucun commentaire:

Enregistrer un commentaire