Skip to content

nuts-foundation/nuts-go-e2e-test

Repository files navigation

This repository contains end-to-end tests for the nuts-node.

Writing tests

Automated testing

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 a run-test.sh file.
  • References to Docker image nutsfoundation/nuts-node:master in the docker-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

Running tests

Prerequisites

To tun the tests you need the following tools:

  • Docker
  • jq for JSON operations

On your machine

To run the tests execute run-tests.sh.

Testing version compatibility

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.

About

End-to-end test voor Nuts Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •