运行 测试标记为 [Explicit] with dotnet test

Running tests marked as [Explicit] with dotnet test

是否可以使用 dotnet 测试执行标有 NUnit [Explicit] 属性的测试?

我有一些测试,我想 运行 作为 Bamboo 上的单独构建。他们需要一段时间才能 运行 所以不希望它们包含在 VS 中的标准测试 运行 中所以用 [Explicit] 属性标记它们。我还用 [Category("Nightly")] 标记了它们,所以在 Bamboo 上我希望有一个步骤:

dotnet test --filter "TestCategory=Nightly"

但正如预期的那样,由于显式 属性.

,它们仍然被忽略

我试过明确命名,像这样:

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

但仍然不走运,我已经尝试了 dotnet test https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests?pivots=mstest 的所有可能参数来专门引用测试,但它们仍然被忽略。

有人管理过吗?

富有

根据 nuget 包的 this Github issue this is actually a known bug with NUnit3TestAdapter where tests marked as [Explicit] would not execute regardless of how they were referenced in the arguments to dotnet test. This has been addressed in the latest pre-release version