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
|
2023-03-02 19:54:44 +01:00
|
|
|
#ip_address=$(hostname -I 2>/dev/null || ipconfig 2>&1 | grep "IPv4 Address" | head -n1 | awk -F ':' '{ print $2}' | tr -d ' ') # old fashion style...
|
|
|
|
#ip_address="10.0.2.2"
|
|
|
|
#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
|
2023-03-02 19:54:44 +01:00
|
|
|
echo "ip_address=127.0.0.1" > .env # not used anymore, host IP is 10.0.2.2
|
2022-08-27 00:31:19 +02:00
|
|
|
|
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
|
|
|
|
2023-03-02 19:54:44 +01:00
|
|
|
exit 0
|