Web5 Components Tests
This repo is used to orchestrate end to end testing of Web5 components.
This repo contains a docker-compose file which pulls down and spins up the latest components from mainline of the WEB5 stack. It then runs test suites against the endpoints of these services.
Running System Test Locally
- Clone the repo
git clone https://github.com/TBD54566975/web5-components-tests.git
- Spin up the ssi-service and dwn-relay. Note: is is important to use --no cache because if you don't it will not use the latest version of mainline
docker-compose build --no-cache && docker-compose up
- In a new shell navigate to web5-components-tests/tests and run a test script in the tests directory. To run all tests run:
# Running with pip alias command
cd tests
pip install -r requirements.txt
pip install -U pytest
# The -rP command allows you see all the output from the tests
pytest -rP
# Alternativly if instead you want to run a module as a script command
cd tests
python -m pip install -r requirements.txt
python -m pip install pytest
# The -rP command allows you see all the output from the tests
python -m pytest -rP
Directory Structure
To add a new test simply create a file in the integration folder and follow the example of our end to end steelthread test
tests
tests/integration
tests/integration/test_steelthread.py
Tests
Test 1 – test_steelthread.py ✅
The test runs HTTP requests against the DWN Relay from the perspective of Alice:
- Creates an issuer DID in the ssi-service
- Creates a schema in the ssi-service to be used in reference to the credential manifest
- Creates a credential manifest in the ssi-service to be applied to from a submitted credential application
- Installs DWN protocols to the DWN. DWN protocols are used by the DWN to understnad what it needs to do with requests. It's basically a mapping of input route to an output route
- Queries the DWN for a credential manifest. The DWN will query the ssi-service for the manifest and return it to the DWN-Relay
- Submits a credential application to the DWN. The DWN will submit the credential application to the ssi-service for the credential response containing the verifiable credential
Automatic Runs Via Github Actions
When a new verion of a web5 component is pushed up the github action pulls down and spins up the latest components from the WEB5 stack and runs tests against them. The github actions can be seen here - https://github.com/TBD54566975/web5-components-tests/actions
Project Resources
Resource |
Description |
CODEOWNERS |
Outlines the project lead(s) |
CODE_OF_CONDUCT.md |
Expected behavior for project contributors, promoting a welcoming environment |
CONTRIBUTING.md |
Developer guide to build, test, run, access CI, chat, discuss, file issues |
GOVERNANCE.md |
Project governance |
LICENSE |
Apache License, Version 2.0 |