Skip to content

Commit

Permalink
add integration test matrix for keria version (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenkan authored Apr 11, 2024
1 parent f1f1a89 commit 72826cf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,29 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test:
name: Run integration test
runs-on: ubuntu-latest
name: Run integration test using keria:${{ matrix.keria-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
keria-version: ['latest', '0.1.2', '0.1.3']
node-version: ['20']
env:
KERIA_IMAGE_TAG: ${{ matrix.keria-version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install deps
run: npm ci
- name: Build
run: npm run build
- name: Print docker compose config
run: docker compose config
- name: Start dependencies
run: docker compose up deps --pull always
- name: Run integration test
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ signify-ts-deps-1 | Dependencies running
signify-ts-deps-1 exited with code 0
```

It is possible to change the keria image by using environment variables. For example, to use weboftrust/keria:0.1.3, do:

```bash
export KERIA_IMAGE_TAG=0.1.3
docker compose pull
docker compose up deps
```

To use another repository, you can do:

```bash
export KERIA_IMAGE=gleif/keria
docker compose pull
docker compose up deps
```

**Important!** The integration tests runs on the build output in `dist/` directory. Make sure to run build before running the integration tests.

```bash
Expand All @@ -101,14 +117,6 @@ TEST_ENVIRONMENT=local npx jest examples/integration-scripts/credentials.test.ts
This changes the discovery urls to use `localhost` instead of the hostnames inside the docker network.
### Old integration scripts
To run any of the old integration scripts that has not yet been converted to an integration test. Use `ts-node-esm`
```bash
npx ts-node-esm examples/integration-scripts/challenge.ts
```

# Diagrams
Account Creation Workflow
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- 7723:7723

keria:
image: weboftrust/keria:latest
image: ${KERIA_IMAGE:-weboftrust/keria}:${KERIA_IMAGE_TAG:-latest}
environment:
- KERI_AGENT_CORS=1
- KERI_URL=http://keria:3902
Expand Down

0 comments on commit 72826cf

Please sign in to comment.