DockerZ End-To-End Testing¶
We created our own
end-to-end testing framework because we needed an easy way to test our
peer-to-peer logic. Traditional frameworks could not fit our requirements as we needed to test the interactions between a whole network of nodes.
DockerZ Container Timeline¶
GitHub Action¶After a new commit is pushed to GitHub, a GitHub action is triggered to update the Docker image used on the Raspberry Pi and push this new image to the GitHub Container Registry.
webhook receives a new request (a new commit), it adds to the internal
queue saves all new commits as tasks that must be tested.
task is popped off the
queue to process, a new
worker-thread is created to start the testing.
To set up the testing, DockerZ pulls the new
docker image, which holds the binary of a node.
These nodes are then launched to create a
network in which
end-to-end tests can be run.
Before the tests can be started, the program waits until the nodes are properly started. After this, a number of tests such as sending a block, claiming a block and pinging are executed. The results of these tests are then pushed to Discord and GitHub.
A Discord server channel is updated with a message stating the result of the tests.
Cleanup¶At the end of the tests, the containers are cleaned up.