Using MSTest with Go

Follow

Comments

18 comments

  • Avatar
    Mark Richter

    Roldolfo, I have a post over here on this subject. Let me know if this helps. It's testing in a GO pipeline using MSTest, but relying on the default location for test results.

  • Avatar
    Rodolfo Grave

    Hi Mark.


    Thanks for your reply. I found that post before asking my question, but from the post I couldn't figure out how to show the tests results on the "Tests" tab.


    I'm already running MSTest.exe using a custom command, and the results file is generated, but the "Tests" tab doesn't "detect" those results and shows the "There are tests configured in this stage but could not compute results." message. I have already tried to remove the /resultsfile parameter and the result is the same.


    Any idea on how the "Tests" tab detects and parses tests results?


    Thanks.

  • Avatar
    Rajeshvaran Appasamy

    Hi Rodolfo,


     


    You need to upload the test run results in the form of xml as test artifacts. Please refer to http://www.thoughtworks-studios.com/go/2.3/help/managing_artifacts_and_reports.html.

  • Avatar
    Santosh Hegde

     


    The xml format supported for test artifacts is junit/nunit style. You will need another job to call tools like msxsl to convert the Mstest reports to nunit style and then point the xml file as a test artifact in Go. Go will parse the tests and publish them on the Tests tab for the job.

  • Avatar
    Scott Baldwin

    Rodolfo,


    We use trx2html from codeplex to transform the mstest output into an html file that we use in a custom tab. Disavantage (well, one of them...): we don't get aggregated test results on the stage.

  • Avatar
    Rodolfo Grave

    Thanks to everyone. It seems there is no real integration with MSTest. The best I could get was the custom HTML tab proposed by Scott Baldwin.


    Is there any way to ask ThoughtWorks for this integration? Are there more people interested on this?


    Thanks

  • Avatar
    Scott Baldwin

    I'd rather have native TFS source control support first, then MSTest integration. :)

  • Avatar
    Mark Richter

    Roldolfo, this board is a fine place to ask us for things. We follow posts here and capture requests like yours in our product development plans. My particular focus is integration with Microsoft technologies in particular. I follow posts on the boards here, contribute ideas (and code) where I can.


    Scott, we're working on native TFS source control support in GO. It's planned for GO 3.0. Of course plans can change, but I do know TFS in GO is a very high priority item for the next major release. It's a need we hear about often.

  • Avatar
    Rodolfo Grave

    Thank you both for your replies.


    However, I think MSTest is not related to TFS, since TFS is more a source control solution (with lot of extra features), but it's definitely not a test framework.


    From what I've seen, it's very common to use Git, Mercurial, Subversion , etc, for source control, and MSTest for unit testing (it's integrated in VisualStudio and gives you a very fast develpoment workflow).


    So, if I can ask, I would like to see some MSTest support, if only for parsing the results file and showing a nice tests report for it. this shouldn't be affected by TFS support or not.


    Thanks again,


    Rodolfo

  • Avatar
    Mark Richter

    Roldolfo, you are correct. MSTest is unrelated to TFS. We have your request.

  • Avatar
    Rodolfo Grave

    OK, great! Is there a place to follow this request?


    Thanks!

  • Avatar
    Fabricio Correa Duarte

    Hi there.


    I was looking for the same funtionality to integrate the mstest results (.trx files) into go and recently I came across a post in stackoverflow describing how to do this. 


    It uses xslt transformation.


    http://stackoverflow.com/questions/352703/integrating-hudson-with-ms-test


    The only adjustment I had to make to the xslt was the visual studio schema version on the url to 2010. 


    I've attached a copy of the xslt file here too.


    Enjoy.

  • Avatar
    Mark Richter

    Just to wrap things together for building with mstest for VS 2010:



    1. Use the attached xslt to transform trx to xml for GO. (Fabrico's is an earlier version.)

    2. You can get msxsl here.

    3. Run this command after your tests:



    msxsl path-to-trx path-to-style-sheet -o path-to-testresults.xml


     

    Finally, configure path-to-testresults.xml as a Test Artifact in GO
  • Avatar
    Mikkac

    Hi there,


     


    is this solution going to work with the older Cruise version 1.3.2 as well?


     


    Cheers!

  • Avatar
    Yauheni

    I do not see any attachments. Could you please give a link to XSLT?

  • Avatar
    Mark Richter

    Here you go. XSLT attached. Use msxsl.exe to transform trx into xml, then declare the resulting xml file as a Test Artifact. 




    MSBuild-to-NUnit.xslt
  • Avatar
    Carl Reid

    Has anyone noticed that the file is called "MSBuild-to-NUnit.xslt"? Surely this should be called "MSTest-to-NUnit.xslt"?

    Minor point but amazing that no-one seems to have noticed.

  • Avatar
    Mark Richter

    Hi Carl, the software for doing the xslt transformation is Microsoft's, so we left all the file names alone. I agree with you that the name is odd.

     

    --mark

Please sign in to leave a comment.