Add setup and teardown functions in StepConfig
Closed this issue · 0 comments
acostapazo commented
It would be awesome to set setup and teardown variable in each step
What happens if you run this code and the test fails? Now docker-compose down, won't be called.
steps:
test-e2e-local-inmemory:
run:
- docker-compose up -d
- pytest -m end2end --variables tests/end2end/envs/local.yml
- docker-compose down
test-e2e-local-sqlite:
run:
- docker-compose up -d
- pytest -m end2end --variables tests/end2end/envs/local.yml
- docker-compose down
This behaviour is a pitty, so I propose something like the following:
steps:
test-e2e-local-inmemory:
setup: docker-compose up -d
teardown: docker-compose down
run: pytest -m end2end --variables tests/end2end/envs/local.yml
test-e2e-local-sqlite:
setup: docker-compose up -d
teardown: docker-compose down
run: pytest -m end2end --variables tests/end2end/envs/local.yml