Skip to content

Commit a035301

Browse files
committed
Fix command that waits for MongoDB service to be available
1 parent 9636795 commit a035301

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/api-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
- name: Start test service stack
5555
run: |
5656
docker compose -f ../dev/compose.yml --profile test -p tekst-testing up --detach
57-
printf "Waiting for MongoDB service"; while ! $(curl -f http://127.0.0.1:27017 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
58-
printf "Waiting for Elasticsearch service"; while ! $(curl -f http://127.0.0.1:9200 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
57+
printf "Waiting for MongoDB service"; while ! $(docker exec -i tekst-testing-mongo-1 mongosh --eval 'db.runCommand("ping")' > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
58+
printf "Waiting for Elasticsearch service"; while ! $(curl -f 127.0.0.1:9200 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
5959
- name: Cancel on setup error
6060
if: failure()
6161
uses: andymckay/cancel-action@0.5

Tekst-API/Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ tasks:
155155
wait-for-mongodb:
156156
internal: true
157157
silent: true
158-
cmd: printf "Waiting for MongoDB service"; while ! $(curl -f http://127.0.0.1:27017 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
158+
cmd: printf "Waiting for MongoDB service"; while ! $(docker exec -i tekst-testing-mongo-1 mongosh --eval 'db.runCommand("ping")' > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
159159

160160
wait-for-elasticsearch:
161161
internal: true
162162
silent: true
163-
cmd: printf "Waiting for Elasticsearch service"; while ! $(curl -f http://127.0.0.1:9200 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
163+
cmd: printf "Waiting for Elasticsearch service"; while ! $(curl -f 127.0.0.1:9200 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n"
164164

165165
gen-smtp-ssl-cert:
166166
internal: true

0 commit comments

Comments
 (0)