Skip to content

Commit

Permalink
Smoke test (#1039)
Browse files Browse the repository at this point in the history
* Adds a smoke test to JIMM's CI

* Tweak Candid image build

* Increase jimm container timeout

* Increase retries and add timestamps

* Greatly increase retries
  • Loading branch information
kian99 authored Sep 5, 2023
1 parent 48fff0e commit 47f0138
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ services:
test: [ "CMD", "curl", "http://jimm.localhost:80" ]
interval: 5s
timeout: 5s
retries: 5
retries: 40
depends_on:
db:
condition: service_healthy
openfga:
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`)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 47f0138

Please sign in to comment.