2022-08-23 23:46:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-08-24 21:53:16 +02:00
|
|
|
testName=$1
|
2022-08-28 05:08:41 +02:00
|
|
|
option=$2
|
2022-08-24 21:53:16 +02:00
|
|
|
[[ ! $testName ]] && testName='gecko_complete'
|
2022-08-23 23:46:01 +02:00
|
|
|
|
|
|
|
# Get local IP and set .env
|
|
|
|
ip_address=$(hostname -I | awk '{print $1}')
|
|
|
|
echo "ip_address=$ip_address" > .env
|
2022-08-28 05:08:41 +02:00
|
|
|
[[ $option == 'human' ]] && echo "isHumanReading=true" >> .env
|
2022-08-23 23:46:01 +02:00
|
|
|
|
|
|
|
## Start local Duniter node
|
|
|
|
cd integration_test/duniter
|
2022-09-01 16:43:55 +02:00
|
|
|
docker compose down
|
2022-08-23 23:46:01 +02:00
|
|
|
rm -rf data/chains
|
2022-09-01 16:43:55 +02:00
|
|
|
docker compose up -d
|
2022-08-23 23:46:01 +02:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# Start integration test
|
2022-09-09 01:12:17 +02:00
|
|
|
flutter test integration_test/scenarios/$testName.dart && echo '0' > /tmp/geckoTestResult || echo '1' > /tmp/geckoTestResult
|
2022-08-23 23:46:01 +02:00
|
|
|
|
2022-08-27 00:31:19 +02:00
|
|
|
# Reset .env
|
|
|
|
echo "ip_address=127.0.0.1" > .env
|
|
|
|
|
2022-08-23 23:46:01 +02:00
|
|
|
# Stop Duniter
|
|
|
|
cd integration_test/duniter
|
2022-09-01 16:43:55 +02:00
|
|
|
docker compose down
|
2022-08-23 23:46:01 +02:00
|
|
|
|
|
|
|
|