How to keep a build artifact when tests fail
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.
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

Support Staff 1 Posted by Feodor Fitsner on 06 Sep, 2015 05:27 PM
You can use
appveyor PushArtifactcommand to upload artifact right after the build: http://www.appveyor.com/docs/packaging-artifacts#pushing-artifacts-...2 Posted by Ned Batchelder on 07 Sep, 2015 10:59 AM
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?
Support Staff 3 Posted by Feodor Fitsner on 07 Sep, 2015 04:19 PM
You can have a batch file calling test runner, then checking exit code and pushing artifact if it's not 0.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:59 AM.