none
MSTest unit Testing not working RRS feed

  • Question

  • Hi,

    I'm having the following error when running unit testing through MSTest and using the "Run unit tests with MSTest"

    Run unit tests with MSTest:

    MSTest Version: MSTest.exe

    Test Files: path to the dll

    Result File Name: TestResult.trx

    Command line Arguments: /testconatiner /restultsfile

    Error:
    Path To MSTest.exe: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe
    Result file was not found so no action has been taken. file:/E:/workspace/Asp/Asp-CI/TestResult.trx
    FATAL: No test files was found
    Build step 'Run unit tests with MSTest' marked build as failure

    Looks like I don't have the TestResult.trx in my solution, I might be wrong as well. does this TestResult.trx needs be in solution or source code. Please let me know where this "trx" file needs to be, inorder to fix my build error.

    Thanks,


    info2m

    Wednesday, October 2, 2019 6:18 PM

Answers

  • Hi info2m,

    Welcome to MSDN forum.

    It seems this issue is more related to configurations in Jenkins pipeline.

    Since this is Visual Studio forum where we talk about usage of using tools in VS IDE here,  I suggest you can open an new thread in Jenkins website or StackOverFlow with Jenkins tag. Then you can get more professional support from members there.

    In addition: I did some research and found a similar issue for you, hope it makes some help for you! You can try removing the ".\" at the beginning of your Test Files and Result File Name, or follow the answers from this SO issue suggests to replace the "Run unit tests with MSTest" step with an "Execute Windows batch command" step.

    If all above is helpful or not please feel free to let me know! Any feedback would be expected.

    Sincerely

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Thursday, October 3, 2019 7:59 AM
  • Hi friend,

    Glad to know it makes some help. Have a nice day!

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by info2m Tuesday, October 8, 2019 12:59 PM
    Friday, October 4, 2019 1:27 AM

All replies

  • Hi info2m,

    Welcome to MSDN forum.

    It seems this issue is more related to configurations in Jenkins pipeline.

    Since this is Visual Studio forum where we talk about usage of using tools in VS IDE here,  I suggest you can open an new thread in Jenkins website or StackOverFlow with Jenkins tag. Then you can get more professional support from members there.

    In addition: I did some research and found a similar issue for you, hope it makes some help for you! You can try removing the ".\" at the beginning of your Test Files and Result File Name, or follow the answers from this SO issue suggests to replace the "Run unit tests with MSTest" step with an "Execute Windows batch command" step.

    If all above is helpful or not please feel free to let me know! Any feedback would be expected.

    Sincerely

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Thursday, October 3, 2019 7:59 AM
  • Thanks, Lance

    I was able to resolve it.


    info2m

    Friday, October 4, 2019 12:45 AM
  • Hi friend,

    Glad to know it makes some help. Have a nice day!

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by info2m Tuesday, October 8, 2019 12:59 PM
    Friday, October 4, 2019 1:27 AM