Skip to content

Commit

Permalink
add way to run test suites in docker
Browse files Browse the repository at this point in the history
Signed-off-by: pstlouis <[email protected]>
  • Loading branch information
PatStLouis committed Feb 13, 2025
1 parent dc1160e commit c6d3ae0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
localConfig.cjs
25 changes: 25 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
services:
vc-data-model-v2:
build: https://github.com/w3c/vc-data-model-2.0-test-suite.git#allure-in-docker
entrypoint: ["./run.sh"]
volumes:
- ./run.sh:/test-suite/run.sh
- ./localConfig.cjs:/test-suite/localConfig.cjs
labels:
- traefik.enable=true
- traefik.http.routers.vc-data-model.rule=Host(`vc-data-model.docker.localhost`)
- traefik.http.routers.vc-data-model.entrypoints=web
- traefik.http.services.vc-data-model.loadbalancer.server.port=8000

traefik:
image: traefik:v3.1
command:
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entryPoints.web.address=:80
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
30 changes: 30 additions & 0 deletions docker/localConfig.example.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const baseUrl = process.env.BASE_URL || 'http://implementation:8000';
module.exports = {
settings: {},
implementations: [
{
name: 'My Company',
implementation: 'My Implementation Name',
issuers: [
{
id: '',
endpoint: `${baseUrl}/credentials/issue`,
options: {},
tags: ['vc2.0']
}
],
verifiers: [{
id: '',
endpoint: `${baseUrl}/credentials/verify`,
options: {},
tags: ['vc2.0']
}],
vpVerifiers: [{
id: '',
endpoint: `${baseUrl}/presentations/verify`,
options: {},
tags: ['vc2.0']
}]
}
]
};
4 changes: 4 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
npm install --global serve
npm t
serve -p 8000 reports/

0 comments on commit c6d3ae0

Please sign in to comment.