Skip to content

Commit

Permalink
DO NOT MERGE: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sengi committed Apr 4, 2024
1 parent 43ec376 commit 6e55a39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make unit_tests
# - run: make unit_tests
- run: make integration_tests
timeout-minutes: 15
env:
Expand Down
15 changes: 4 additions & 11 deletions mongo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,26 @@ failure_hints() {
}

docker_run() {
docker run --name router-mongo -dp 27017:27017 ghcr.io/alphagov/govuk-infrastructure/mongodb:016364bbefd79123a59be4ad2ce0f338688dc16f --replSet rs0 --quiet
docker run --name router-mongo -dp 27017:27017 ghcr.io/alphagov/govuk-infrastructure/mongodb:016364bbefd79123a59be4ad2ce0f338688dc16f --replSet rs0
}

init_replicaset() {
docker exec router-mongo mongo --quiet --eval 'rs.initiate();' >/dev/null 2>&1
docker exec router-mongo mongo --eval 'rs.initiate();'
}

healthy() {
docker exec router-mongo mongo --quiet --eval \
'if (rs.status().members[0].health==1) print("healthy");' \
2>&1 | grep healthy >/dev/null
docker exec router-mongo mongo --eval \
'print(rs.status());'
}

# usage: retry_or_fatal description command-to-try
retry_or_fatal() {
n=20
echo -n "Waiting up to $n s for $1"; shift
while [ "$n" -ge 0 ]; do
if "$@"; then
echo " done"
return
fi
sleep 1 && echo -n .
n=$((n-1))
done
echo "gave up"
exit 1
}

stop() {
Expand Down

0 comments on commit 6e55a39

Please sign in to comment.