Usuario

ALL Test Passed But MSTest.exe fails and cause build to be PartiallySucceeded?

Pregunta

I want to move from scenario 1 to scenario 2 because we always want to run all the testcases and not have the issue of running only a specific Test List. But Scenario 2 is causing this issue!. any thoughts?

Now this has to be happening AFICT from within the same invocation of TestToolsTask. Seems the new TestToolsTask only halfway supports the /ToolsVersion:3.5 switch and somehow the ToolPath property is changed in mid-flight.

This is just a peculiarity though because the actual publish seems to complete ok apart from warnings like this after each publish:

The file 'C:\dev\TR\Legacy-Results-20101006-13_50_59_12.trx' was created in an earlier version of Visual Studio. This file will be converted, in memory only, to the current format

and sometimes this:

The file 'C:\dev\TR\Legacy-Results-20101006-13_53_46_16.trx' was created in an earlier version of Visual Studio. This file will be converted, in memory only, to the current format. C:\dev\TR\Legacy-Results-20101006-13_53_46_16.trx: (Line: 70, Position: 556). XSD violation: The 'expectedException' attribute is not declared. (Line: 114, Position: 555). XSD violation: The 'expectedException' attribute is not declared. (Line: 268, Position: 550). XSD violation: The 'expectedException' attribute is not declared. (Line: 356, Position: 555). XSD violation: The 'expectedException' attribute is not declared. (Line: 455, Position: 555). XSD violation: The 'expectedException' attribute is not declared. (Line: 521, Position: 555). XSD violation: The 'expectedException' attribute is not declared. (Line: 587, Position: 556). XSD violation: The 'expectedException' attribute is not declared.

These are all warnings so they are probably not what causes the build to fail.

We know that not all of our tests are passing. Some are indeed failing. But that should not lead to the whole build failing like this.

The differing mstest.exe versions you are seeing is correct behavior. MSTest 9.0 can't talk to a 10.0 TFS server. That's the whole reason that the publish is done in a separate invocation of mstest in the case of 9.0 tests. If you are running
10.0 tests, then mstest.exe is only called once and it performs both operations in the same invocation.

I am having trouble understanding what is the incorrect behavior you are experiencing. You have said that some of your tests are failing. If that's the case, then don't you expect your build to be marked partially suceeded? Can you please
clarify what is happening and what is your expectation?

This is a behavior I have not seen before. We have numerous customers successfully producing 9.0 TRXes and publishing them to 10.0 servers during a build. SO, I'm, trying to nail down what is different about your situation. Can you post
the portion of your log where 'D:\Tfs2008Builds\1\I009\Release-3.8.0\TestResults\Legacy-Results-20101110-04_13_32_79.trx' is created?

The file 'C:\Builds\23\IST 9861 Assay Reader\Daily build\TestResults\Legacy-Results-20111104-03_17_19_17.trx' was created in an earlier version of Visual Studio. This file will be converted, in memory only, to the current format.

D:\Builds\249\1397\TestResults\306700d0-e20a-48f4-a981-635ecce9ac98_UnitTestResults.trx: (Line: 4523, Position: 126). XSD violation: The 'duration' attribute is invalid - The value '00:00:00.3199297' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:int'
- The string '00:00:00.3199297' is not a valid Int32 value.

(Line: 4545, Position: 99). XSD violation: The 'duration' attribute is invalid - The value '00:00:00.0201109' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:int' - The string '00:00:00.0201109' is not a valid Int32 value.

(Line: 4555, Position: 101). XSD violation: The 'duration' attribute is invalid - The value '00:00:00.0015124' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:int' - The string '00:00:00.0015124' is not a valid Int32 value.