I want to run my End-to-End tests, but have to setup the database first and teardown after. I have 3 jobs:
The order matters of course, so I want the
Setup to run first and
Test after that, but I want
Teardown to always run once
Test has completed, whether that is a
I thought I had this doing:
jobs: setup: name: Environment Setup runs-on: ubuntu-latest steps: - name: Setup the state run: | echo "Setting up the state" sleep 5 cat red test: needs: [setup] if: success() name: Cypress Tests runs-on: ubuntu-latest steps: - name: Test run: | echo "Testing" sleep 5 teardown: needs: [test] if: always() name: Environment Teardown runs-on: ubuntu-latest steps: - name: Teardown run: | echo "Tearing down the state" sleep 5
What I’m seeing though,
setup starts and on failure, both
teardown are being run in parallel, which I was not expecting. Can anyone explain why and possibly suggest what I need to do.
Thanks in advance for any pointers.