Skip to content

Commit 1b8ece0

Browse files
chore(tests): bump @stdy/cli to 0.16.1
1 parent 3847ce1 commit 1b8ece0

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

scripts/mock

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,29 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run steady mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24-
npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log &
24+
npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log &
2525

26-
# Wait for server to come online
26+
# Wait for server to come online via health endpoint (max 5s)
2727
echo -n "Waiting for server"
28-
while ! grep -q "ERROR\|Steady server listening on" ".stdy.log" ; do
28+
attempts=0
29+
while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do
30+
if ! kill -0 $! 2>/dev/null; then
31+
echo
32+
cat .stdy.log
33+
exit 1
34+
fi
35+
attempts=$((attempts + 1))
36+
if [ "$attempts" -ge 50 ]; then
37+
echo
38+
echo "Timed out waiting for Steady server to start"
39+
cat .stdy.log
40+
exit 1
41+
fi
2942
echo -n "."
3043
sleep 0.1
3144
done
3245

33-
if grep -q "ERROR" ".stdy.log"; then
34-
cat .stdy.log
35-
exit 1
36-
fi
37-
3846
echo
3947
else
40-
npm exec --package=@stdy/cli@0.15.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL"
48+
npm exec --package=@stdy/cli@0.16.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets "$URL"
4149
fi

scripts/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ elif ! steady_is_running ; then
4343
echo -e "To run the server, pass in the path or url of your OpenAPI"
4444
echo -e "spec to the steady command:"
4545
echo
46-
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.15.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}"
46+
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.16.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-query-object-format=brackets${NC}"
4747
echo
4848

4949
exit 1

0 commit comments

Comments
 (0)