This repository contains end-to-end tests for the nuts-node.
Automated testing of the nuts-node relies on some find and replace magic for which the following requirements must be met:
- Each test has a
docker-compose.yml
and arun-test.sh
file. - References to Docker image
nutsfoundation/nuts-node:master
in thedocker-compose.yml
file are automatically replaced with the image that is built in the automated test. - The
run-test.sh
of each test should be added to the respective group's/<test-group>/run-tests.sh
script. - All
/<test-group>/run-tests.sh
should be added to/run-tests.sh
To tun the tests you need the following tools:
- Docker
- jq for JSON operations
To run the tests execute run-tests.sh
.
By default the test are performed on the master build: nutsfoundation/nuts-node:master
.
Sometimes you want to test compatibility between versions. To aid this, every node in this test suite you can specify 2 environment variables to control exact Docker image to use:
IMAGE_NODE_A
IMAGE_NODE_B
When there are multiple in a test, some will use IMAGE_NODE_A
and the other IMAGE_NODE_B
.
Since tests are asymmetric (the action is only performed from node A to B), you want to run the tests twice with the image variables swapped, e.g.:
$ IMAGE_NODE_A=nutsfoundation/nuts-node:v4.3.0 \
IMAGE_NODE_B=nutsfoundation/nuts-node:v5.0.0 \
./run-tests.sh
And than run again with the values swapped:
$ IMAGE_NODE_A=nutsfoundation/nuts-node:v5.0.0 \
IMAGE_NODE_B=nutsfoundation/nuts-node:v4.3.0 \
./run-tests.sh
Note
The tests are updated to the latest node version, they might break when you use an older node version.