Search code examples
appveyor

Why is my build status green, even though a test failed?


I have a GitHub project that requires a successful appveyor build to complete a Pull Request. I recently added a test script to run some tests and upload the test results as an XML file. This works fine—I can see the test results, including details about failed tests.

However, when a PR triggers an appveyor build, and a test fails, the build status is still green, and the GitHub PR check is satisfied.

How can I configure it so that a failed test will fail the build, or at least fail the GitHub PR?

Example PR with green check: here

The "details" link takes you to the build, which shows as green, despite the red failed test: here


Solution

  • AppVeyor build would fail if that script fail (return code not 0), but because last command is happy, it returns 0. More details with workarounds here.