How to keep a build artifact when tests fail

Ned Batchelder's Avatar

Ned Batchelder

06 Sep, 2015 01:18 PM

I'm using AppVeyor for a Python project: https://ci.appveyor.com/project/nedbat/coveragepy/build/default-62

I want to build kits during the build phase, so I used build_script to do that. On 64-bit, the tests fail, but I'd still like to keep the artifacts. How can I do that? I've read all the relevant topics here, and I can't find a combination of build_script, after_test, artifacts, allow_failures, etc, that will work.

My .yml is here: https://bitbucket.org/ned/coveragepy/src/8c18abd089967b755aa2254460adfa4f29124a60/appveyor.yml?at=default

Thanks.

  1. Support Staff 1 Posted by Feodor Fitsner on 06 Sep, 2015 05:27 PM

    Feodor Fitsner's Avatar

    You can use appveyor PushArtifact command to upload artifact right after the build: http://www.appveyor.com/docs/packaging-artifacts#pushing-artifacts-...

  2. 2 Posted by Ned Batchelder on 07 Sep, 2015 10:59 AM

    Ned Batchelder's Avatar

    Thanks, that works great.

    Now I'm wondering how to use PushArtifact *only* if the tests fail. There are detailed logs from test runs, but I only want them when the tests fail. Is there an environment variable indicating build status, test status, etc?

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Sep, 2015 04:19 PM

    Feodor Fitsner's Avatar

    You can have a batch file calling test runner, then checking exit code and pushing artifact if it's not 0.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:59 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