Skip to content

Commit ef34045

Browse files
committed
Make tests re-runnable
1 parent cf1af58 commit ef34045

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

tests/00.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ run "docker run -d --rm --platform ${ARCH} \
4848
run "sleep 20" # Startup-time is longer on cross-platform
4949
run "docker ps"
5050
run "docker logs ${RAND_NAME}"
51-
run "curl -sS localhost/index.html"
52-
run "curl -sS localhost/index.html | grep 'hello world'"
51+
if ! run "curl -sS localhost/index.html"; then
52+
run "docker stop ${RAND_NAME}"
53+
exit 1
54+
fi
55+
if ! run "curl -sS localhost/index.html | grep 'hello world'"; then
56+
run "docker stop ${RAND_NAME}"
57+
exit 1
58+
fi
5359

5460

5561
###

tests/01.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@ run "sleep 20" # Startup-time is longer on cross-platform
5959
run "docker ps"
6060
run "docker logs ${RAND_NAME1}"
6161
run "docker logs ${RAND_NAME2}"
62-
run "curl localhost"
63-
run "curl localhost | grep 'hello world php'"
64-
62+
if ! run "curl localhost"; then
63+
run "docker stop ${RAND_NAME1}"
64+
run "docker stop ${RAND_NAME2}"
65+
exit 1
66+
fi
67+
if ! run "curl localhost | grep 'hello world php'"; then
68+
run "docker stop ${RAND_NAME1}"
69+
run "docker stop ${RAND_NAME2}"
70+
exit 1
71+
fi
6572

6673
###
6774
### Cleanup

0 commit comments

Comments
 (0)