Build/Test Issues

EnumerateTestCommands

Started by antix on 6,466 views

Hello

I am trying to get a test to skip based on a check made in EnumerateTestCommands

e.g.

 if (someCriteria)
{
                return new[] { new SkipCommand(method, method.Name, "Integration test skipped") };
}


but this is resulting in a failed test

> *** Warnings ***

> The test was skipped. Reason: Integration test skipped

Ideally it would result in the same thing as adding Skip to the attribute declaration (which I can't do in this case)

[Fact(Skip = "Integration test skipped")]


Ant
ok, looks like an xunit thing rather than anything to do ncrunch, the method is too late
There is an inconsistency here with the way that NCrunch handles situations like this vs other test runners.

For reasons of simplicity, NCrunch doesn't have an 'inconclusive' state for tests that have been executed. This means that should a test report an inconclusive result at runtime (such as the one you've described above), NCrunch will still consider the test as having a pass/fail result as it has no way to represent the different response from the test.

There is a project-level configuration option you can use to control how NCrunch should respond to an inconclusive result, it's called 'Consider inconclusive tests as passing'. This may or may not be of some use to you.


Cheers,

Remco
Yes that option gets those tests out of my list which is what I want

Thanks for the explanation, Ant

Post a reply

Log in to reply.