mirror of
https://github.com/planetmint/planetmint.git
synced 2025-06-07 22:56:37 +00:00
added README, added check_status to run-integration-test.sh
This commit is contained in:
parent
f108b511d8
commit
e203fc5e39
@ -0,0 +1,15 @@
|
|||||||
|
# Integration test suite
|
||||||
|
This directory contains the integration test suite for Planetmint.
|
||||||
|
|
||||||
|
The suite uses Docker Compose to run all tests.
|
||||||
|
|
||||||
|
## Running the tests
|
||||||
|
Run `make test-integration` in the project root directory.
|
||||||
|
|
||||||
|
During development you can run single test use `pytest` inside the `python-integration` container with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose run --rm python-integration pytest <use whatever option you need>
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: The `/src` directory contains all the test within the container.
|
@ -5,20 +5,18 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
|
|
||||||
# Set up a Planetmint node and return only when we are able to connect to both
|
# Check if both integration test nodes are reachable
|
||||||
# the Planetmint container *and* the Tendermint container.
|
check_status () {
|
||||||
setup () {
|
OK="200 OK"
|
||||||
docker-compose up -d planetmint
|
|
||||||
|
|
||||||
# Try to connect to the containers for maximum three times, and wait
|
STATUS_1=$(curl -I -s -X GET https://itest1.planetmint.io/ | head -n 1)
|
||||||
# one second between tries.
|
STATUS_2=$(curl -I -s -X GET https://itest2.planetmint.io/ | head -n 1)
|
||||||
for i in $(seq 3); do
|
|
||||||
if $(docker-compose run --rm curl-client); then
|
# Check if both response status codes return 200 OK
|
||||||
break
|
if ! [[ "$STATUS_1" == *"$OK"* ]] || ! [[ "$STATUS_2" == *"$OK"* ]]
|
||||||
else
|
then
|
||||||
sleep 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_test () {
|
run_test () {
|
||||||
@ -29,7 +27,7 @@ teardown () {
|
|||||||
docker-compose down
|
docker-compose down
|
||||||
}
|
}
|
||||||
|
|
||||||
setup
|
check_status
|
||||||
run_test
|
run_test
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
teardown
|
teardown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user