make cleanup happen even if workflow fails
All checks were successful
test-backend / test-x86_64 (push) Successful in 29s
All checks were successful
test-backend / test-x86_64 (push) Successful in 29s
This commit is contained in:
parent
79ef0a093c
commit
655eb1e0f2
@ -17,11 +17,15 @@ jobs:
|
||||
- name: Deploy testing environment
|
||||
shell: sh
|
||||
run: docker-compose -f backend/docker-compose-x86_64.yaml up -d
|
||||
- name: Add tables to DB
|
||||
shell: sh
|
||||
run: docker-compose -f backend/docker-compose-x86_64.yaml exec -T postgres psql -U postgres < backend/db/create.sql
|
||||
- name: Run test requests
|
||||
shell: sh
|
||||
run: |
|
||||
chmod +x tests/backend.sh
|
||||
tests/backend.sh
|
||||
- name: Clean up testing environment
|
||||
if: always()
|
||||
shell: sh
|
||||
run: docker-compose -f backend/docker-compose-x86_64.yaml up -d
|
||||
run: docker-compose -f backend/docker-compose-x86_64.yaml down
|
||||
|
@ -13,17 +13,18 @@ assert_bad_status () {
|
||||
}
|
||||
|
||||
HOST=127.0.0.1
|
||||
ARGS="--fail-with-body"
|
||||
|
||||
curl -f http://$HOST/movies
|
||||
curl $ARGS http://$HOST/movies
|
||||
assert_good_status
|
||||
|
||||
curl -f http://$HOST/passes
|
||||
curl $ARGS http://$HOST/passes
|
||||
assert_good_status
|
||||
|
||||
curl -X POST -f http://$HOST/apply_for_pass
|
||||
curl -X POST $ARGS http://$HOST/apply_for_pass
|
||||
assert_bad_status
|
||||
|
||||
curl -X POST -f http://$HOST/apply_for_pass \
|
||||
curl -X POST $ARGS http://$HOST/apply_for_pass \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"first": "Hannah",
|
||||
"last": "Dirt",
|
||||
@ -33,5 +34,7 @@ curl -X POST -f http://$HOST/apply_for_pass \
|
||||
"movie_uuid": "742a2542-2b50-11f0-ae4c-f7bedd5fcc88"}'
|
||||
assert_good_status
|
||||
|
||||
curl -f http://$HOST/passes | jq '.result.[0]'
|
||||
sleep 5
|
||||
|
||||
curl $ARGS http://$HOST/passes | jq '.result.[0]'
|
||||
assert_good_status
|
||||
|
Loading…
x
Reference in New Issue
Block a user