Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/schemathesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
- run: docker --version
- name: Start the docker-compose stack
run: docker compose up --detach --wait
# `up --wait` doesn't wait for the loadtest container to finish
- name: Wait for the test corpus to be loaded
run: |
status=$(docker wait "$(docker compose ps --all --quiet loadtest)")
if [ "$status" != 0 ]; then
docker compose logs loadtest api
exit 1
fi
- name: Test if /info returns a response
run: curl --verbose http://localhost:8081/exist/restxq/v1/info
- name: Test if corpus returns a response
Expand Down
10 changes: 7 additions & 3 deletions compose.t.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ services:
-H 'Content-Type: application/json' \
-d '{"load": true}' \
http://api:8080/exist/restxq/v1/corpora/test
echo "Waiting for corpus contents to be available..."
# The load job records the commit of the corpus after loading all
# of its plays. (Every play has a commit, too, so check the corpus
# list, which has no plays.) Check only every 5 s for up to 5
# minutes, as loading keeps the database busy.
echo "Waiting for the corpus to be loaded..."
for i in $$(seq 1 60); do
if curl -sf http://api:8080/exist/restxq/v1/corpora/test | grep -q '"plays":\[{'; then
if curl -sf http://api:8080/exist/restxq/v1/corpora | grep -q '"commit"'; then
echo "Test corpus loaded."
exit 0
fi
sleep 1
sleep 5
done
echo "Timed out waiting for test corpus to load." >&2
exit 1
Loading