From 47f013856d856a580b81f874879ab7dec21d899a Mon Sep 17 00:00:00 2001 From: Kian Parvin <46668016+kian99@users.noreply.github.com> Date: Tue, 5 Sep 2023 09:08:51 +0200 Subject: [PATCH] Smoke test (#1039) * Adds a smoke test to JIMM's CI * Tweak Candid image build * Increase jimm container timeout * Increase retries and add timestamps * Greatly increase retries --- .github/workflows/ci.yaml | 20 ++++++++++++++++++++ docker-compose.yaml | 9 +++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6f0775c64..bbb802bc0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,3 +52,23 @@ jobs: PGSSLMODE: disable PGUSER: jimm PGPORT: 5432 + + smoke_test: + name: Smoke Test + runs-on: ubuntu-20.04 + # The docker compose has a healthcheck on the JIMM container. + # So if the compose returns with exit code 0 then the JIMM server successfully started. + steps: + - uses: actions/checkout@v3 + - name: Pull candid repo for test environment + run: | + git clone https://github.com/canonical/candid.git ./tmp/candid + cd ./tmp/candid + make image + docker image ls candid + - name: Add volume files + run: | + touch ./local/vault/approle.json + touch ./local/vault/roleid.txt + - run: go mod vendor + - run: docker compose --profile dev up -d --wait --timestamps diff --git a/docker-compose.yaml b/docker-compose.yaml index 4b3858efe..e4d11dfd9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -82,7 +82,7 @@ services: test: [ "CMD", "curl", "http://jimm.localhost:80" ] interval: 5s timeout: 5s - retries: 5 + retries: 40 depends_on: db: condition: service_healthy @@ -90,6 +90,8 @@ services: condition: service_healthy traefik: condition: service_healthy + insert-hardcoded-auth-model: + condition: service_completed_successfully labels: traefik.enable: true traefik.http.routers.jimm.rule: Host(`jimm.localhost`) @@ -128,11 +130,6 @@ services: VAULT_DEV_ROOT_TOKEN_ID: "token" cap_add: - IPC_LOCK - healthcheck: - test: [ "CMD", "curl", "http://127.0.0.1:8200/v1/sys/health" ] - interval: 5s - timeout: 5s - retries: 10 volumes: - ./local/vault/vault.hcl:/vault/config/vault.hcl - ./local/vault/init.sh:/vault/init.sh