user3570910
user3570910

Reputation: 113

Write to TestResults on TFS Build Server from PowerShell

On the TFS 2013 BuildServer, i run Post-Test PowerShellScript to Execute JavaScript Unit Test using Grunt. This produces the .xml file on the build server.

I want to write the results from .xml to the TestResult of TFS Server.

Is there a way to do this ?

Looking for a way to push the Pass and Faile results of JavaScript Test into TestResult(.trx) of TFS 2013.

Upvotes: 2

Views: 1206

Answers (2)

Hamid Shahid
Hamid Shahid

Reputation: 4626

vstest.console.exe with TfsPublisher switch would allow you to run tests results from a unit test run executed by vstest.console.exe. Since, you are using JavaScript unit test with Grunt, that won't work.

Your best bet is to create an activity that reads information from the xml file and publish results to you team build. Have a look at this project

https://github.com/hamidshahid/TfsBuildResultPublisher

There are bits of code that you an use from this project specially around adding your own test results information.

Upvotes: 1

Keith Hill
Keith Hill

Reputation: 201822

You can use vstest.console.exe to publish test results. See this blog post on publishing test results using vstest: http://blogs.msdn.com/b/visualstudioalm/archive/2012/12/06/publishing-test-results-through-command-line-test-runner.aspx You should be able to invoke that exe from an InvokeProcess activity.

Upvotes: 1

Related Questions