Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishTestResults reports incorrect test titles for .trx produced by mocha-trx-reporter #10024

Closed
IlyaBiryukov opened this issue Apr 3, 2019 · 3 comments

Comments

@IlyaBiryukov
Copy link

IlyaBiryukov commented Apr 3, 2019

Bug

Task Name: PublishTestResults@2

Environment

Issue Description

We have VSCode unit tests that use mocha. The test runner reports the results with [email protected], saves the results to a .trx file, and then PublishTestResults@2 task publishes the results from the .trx file to the run.

All test names in the Tests tab of the run are wrong for all the tests. All tests have the same " binds Editor.code to state.code" name.
The trx file is fine though. I could open it in VS and see the test names correct. It doesn't contain any " binds Editor.code to state.code" string at all.

Task logs

log_25_2554821.zip

Error logs

I didn't see any error in the build logs

@puagarwa
Copy link
Member

Hi, I take a look at trx and it seems not generated correctly, infact I looked at the trx generator source code and it always set classname and name of test as none which is not correct. I have opened an issue on their repo

<UnitTest id="87d9cb5f-41cf-4242-aebe-a4a997816610" name="Extensibility API getApiAsync - calling package not detected">
  <Execution id="a1e49339-813f-4cec-9a45-d9b3b2e78920"/>
  <TestMethod codeBase="out/test/api.test.js" **className="none" name="none"/**>
</UnitTest>

@puagarwa
Copy link
Member

Also, our recommendation is use industry standard schema that we support (Junit) and that most test tools, including Mocha support as well, TRX is a proprietary format that we don’t want customers to create on their own. please use Junit and use PTR task for publishing , let us know if there is any issue.

@IlyaBiryukov
Copy link
Author

Ok. Thanks for opening the issue on mocha-trx-reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants