Search code examples
yamltravis-cigithub-actions

Ignore test failure


I seek to ensure a test passes no matter what:

 - conda run pytest

How can this be accomplished? I have done it with "or" syntax previously, as in

 - 1 || conda run pytest

but don't recall how exactly.


Solution

  • Using the bash shell, you can add || true at the end of the command line to ignore the eventual errors:

    <command> || true

    Basically, the runner will always consider the command line has been executed successfully.

    Just note that it won't stop the workflow run (or make the workflow fail) as well if the command return an error.