Build was successful even though some tests were failed on DNX

justin.yoojh's Avatar

justin.yoojh

17 Jan, 2016 05:47 AM

Hi, Team.

I'm building an ASP.NET 5 MVC 6 application on DNX environment. As currently AppVeyour test setup for automatic discovery doesn't support DNX yet, I'm running tests using PowerShell by iterating all test projects and running the dnx test command inside my PS script.

However, even if any of test fails, the build is still successful which is not supposed to be. Please find the link that I provide as an example:

https://ci.appveyor.com/project/justinyoo/scissorhands-net/build/1.0.0-alpha-86

Could you let me know how to setup test properly?

Cheers,

Justin

  1. 1 Posted by justin.yoojh on 17 Jan, 2016 10:00 AM

    justin.yoojh's Avatar

    PowerShell script that I'm running to perform unit tests can be found here:

    https://github.com/GetScissorhands/Scissorhands.NET/blob/dev/run-tests.ps1

  2. Support Staff 2 Posted by Feodor Fitsner on 17 Jan, 2016 06:01 PM

    Feodor Fitsner's Avatar

    You should check for $LastExitCode:

    dnx test
    if($LastExitCode -ne 0) {
      $host.SetShouldExit($LastExitCode)
    }
    
  3. 3 Posted by justin.yoojh on 18 Jan, 2016 11:53 AM

    justin.yoojh's Avatar

    Thanks! Got it working.

  4. justin.yoojh closed this discussion on 18 Jan, 2016 11:53 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

16 Jul, 2019 04:51 AM
15 Jul, 2019 06:33 PM
15 Jul, 2019 06:09 PM
15 Jul, 2019 05:53 PM
15 Jul, 2019 05:46 PM