From 6e55a39d09385c6429a011da08874fd1e053345f Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Thu, 4 Apr 2024 22:43:53 +0100 Subject: [PATCH] DO NOT MERGE: debugging --- .github/workflows/ci.yml | 2 +- mongo.sh | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7ed2d90..434dfe0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/mongo.sh b/mongo.sh index e2f0d3ab..4add3efa 100755 --- a/mongo.sh +++ b/mongo.sh @@ -16,17 +16,16 @@ 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 @@ -34,15 +33,9 @@ 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() {