make cleanup happen even if workflow fails
Some checks failed
test-backend / test-x86_64 (push) Failing after 23s
Some checks failed
test-backend / test-x86_64 (push) Failing after 23s
This commit is contained in:
parent
79ef0a093c
commit
2e9fd2bddc
@ -17,11 +17,15 @@ jobs:
|
|||||||
- name: Deploy testing environment
|
- name: Deploy testing environment
|
||||||
shell: sh
|
shell: sh
|
||||||
run: docker-compose -f backend/docker-compose-x86_64.yaml up -d
|
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
|
- name: Run test requests
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
chmod +x tests/backend.sh
|
chmod +x tests/backend.sh
|
||||||
tests/backend.sh
|
tests/backend.sh
|
||||||
- name: Clean up testing environment
|
- name: Clean up testing environment
|
||||||
|
if: always()
|
||||||
shell: sh
|
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
|
HOST=127.0.0.1
|
||||||
|
ARGS="--fail-with-body"
|
||||||
|
|
||||||
curl -f http://$HOST/movies
|
curl $ARGS http://$HOST/movies
|
||||||
assert_good_status
|
assert_good_status
|
||||||
|
|
||||||
curl -f http://$HOST/passes
|
curl $ARGS http://$HOST/passes
|
||||||
assert_good_status
|
assert_good_status
|
||||||
|
|
||||||
curl -X POST -f http://$HOST/apply_for_pass
|
curl -X POST $ARGS http://$HOST/apply_for_pass
|
||||||
assert_bad_status
|
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" \
|
-H "Content-Type: application/json" \
|
||||||
--data '{"first": "Hannah",
|
--data '{"first": "Hannah",
|
||||||
"last": "Dirt",
|
"last": "Dirt",
|
||||||
@ -33,5 +34,8 @@ curl -X POST -f http://$HOST/apply_for_pass \
|
|||||||
"movie_uuid": "742a2542-2b50-11f0-ae4c-f7bedd5fcc88"}'
|
"movie_uuid": "742a2542-2b50-11f0-ae4c-f7bedd5fcc88"}'
|
||||||
assert_good_status
|
assert_good_status
|
||||||
|
|
||||||
curl -f http://$HOST/passes | jq '.result.[0]'
|
sleep 5
|
||||||
|
|
||||||
|
curl $ARGS -s http://$HOST/passes
|
||||||
|
test [ $(curl $ARGS -s http://$HOST/passes | jq '.result.[0]') != "null" ]
|
||||||
assert_good_status
|
assert_good_status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user