We're attempting to implement a basic smoke test suite using Pipelines + Cypress. Obviously, we'll want to have access to the video/screenshot artifacts of those runs especially if they fail, but it seems like the artifacts aren't available after a 'failed' step. Is what we're trying possible?
Hi, @Sam Wainwright! Welcome to the community!
Artifacts are not uploaded for the failed steps. Bitbucket pipelines are configured to stop at any non-zero exit code. That means that the pipeline execution is stopped when cypress fails the tests. Because artifacts are stored after the last step of the pipeline, you won’t have any artifacts.
Bitbucket Pipelines achieves the default behavior of exiting on the first error by prepending your script with the "set -e” bash command. You can "undo” this at any point in your script using the command "set +e”. If you want all the commands in your script to execute regardless of errors then put "set +e” at the top of your script. If you just want to ignore the error for one particular command then put "set +e” before that command and "set -e” after it.
Once the scripts are forcefully successful with the help of the method mentioned above, the artifacts upload part will be executed and they will be available for download later.
I hope this helps, but do let me know if you have any questions.
Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events