diff --git a/.gitignore b/.gitignore index c2658d7..33fe5a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +docker/implemenation.yml diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..c209e74 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,33 @@ + + +# Testing in docker + +To run your implementation against all test suites from one location, you can use this docker-compose project. + +## Pre requisites +- [Docker](https://docs.docker.com/compose/install/) + +## Setup + +Make sure you are in the `docker` directory, then copy the `implementation` example file: +```bash +cd ./docker +cp implementation.example.yml implementation.yml +``` +Edit the local config details to match your implementation. + +Once you are done, you can run the test-suites with: +```bash +docker compose up --build +``` + +When the tests are completed, you will be able to access the reports in your browser: +- [vc-data-model-v2](http://vc-data-model.docker.localhost/) +- [vc-bitstring-status-list](http://vc-bitstring-status-list.docker.localhost/) +- [vc-di-eddsa](http://vc-di-eddsa.docker.localhost/) +- [vc-di-ecdsa](http://vc-di-ecdsa.docker.localhost/) +- [vc-di-bbs](http://vc-di-bbs.docker.localhost/) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..453e972 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,47 @@ +--- +include: + - implementation.yml +services: + vc-data-model-v2: + build: https://github.com/w3c/vc-data-model-2.0-test-suite.git#allure-in-docker + command: + - /bin/bash + - -c + - | + npm t + serve -p 8000 reports/ + configs: + - source: localConfig.cjs + target: /test-suite/localConfig.cjs + - source: implementation.json + target: /test-suite/implementation.json + 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 + + +configs: + localConfig.cjs: + content: | + module.exports = { + settings: { + enableInteropTests: true + }, + implementations: [ + require('/test-suite/implementation.json') + ] + }; \ No newline at end of file diff --git a/docker/implementation.example.yml b/docker/implementation.example.yml new file mode 100644 index 0000000..fbbd100 --- /dev/null +++ b/docker/implementation.example.yml @@ -0,0 +1,38 @@ +--- +configs: + implementation.json: + content: | + { + "name": "My Company", + "implementation": "My Implementation Name", + "issuers": [ + { + "id": "", + "endpoint": "", + "options": {}, + "tags": [ + "vc2.0" + ] + } + ], + "verifiers": [ + { + "id": "", + "endpoint": "", + "options": {}, + "tags": [ + "vc2.0" + ] + } + ], + "vpVerifiers": [ + { + "id": "", + "endpoint": "", + "options": {}, + "tags": [ + "vc2.0" + ] + } + ] + } \ No newline at end of file