-
Notifications
You must be signed in to change notification settings - Fork 21
Add run in docker instructions #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PatStLouis
wants to merge
5
commits into
main
Choose a base branch
from
test-with-docker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
docker/implemenation.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!-- | ||
Copyright 2025 Digital Bazaar, Inc. | ||
|
||
SPDX-License-Identifier: BSD-3-Clause | ||
--> | ||
|
||
# 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/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
] | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how you're doing the
localConfig.cjs
above, is this file still needed?Guess I'm getting lost among all the nesting dolls...