Skip to content
Snippets Groups Projects
Commit fd5d20ec authored by poka's avatar poka
Browse files

simplify IP address linking for intergration test on emulator

parent c4b9eaf2
No related branches found
No related tags found
No related merge requests found
Pipeline #18875 waiting for manual action
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -5,8 +5,9 @@ option=$2
[[ ! $testName ]] && testName='gecko_complete'
# Get local IP and set .env
ip_address=$(hostname -I | awk '{print $1}')
echo "ip_address=$ip_address" > .env
#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
[[ $option == 'human' ]] && echo "isHumanReading=true" >> .env
## Start local Duniter node
......@@ -20,10 +21,10 @@ cd ../..
flutter test integration_test/scenarios/$testName.dart && echo '0' > /tmp/geckoTestResult || echo '1' > /tmp/geckoTestResult
# Reset .env
echo "ip_address=127.0.0.1" > .env
echo "ip_address=127.0.0.1" > .env # not used anymore, host IP is 10.0.2.2
# Stop Duniter
cd integration_test/duniter
docker compose down
exit 0
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart';
......@@ -11,7 +10,7 @@ import 'tests_utility.dart';
// GENERAL ACTIONS
Future changeNode() async {
final ipAddress = dotenv.env['ip_address'] ?? '127.0.0.1';
const ipAddress = '10.0.2.2';
log.d('ip address: $ipAddress');
await tapKey(keyDrawerMenu);
......
......@@ -223,7 +223,7 @@ Future bkConfirmIdentity(
// Change node in background
Future bkSetNode([String? endpoint]) async {
if (endpoint == null) {
final ipAddress = dotenv.env['ip_address'] ?? '127.0.0.1';
const ipAddress = '10.0.2.2';
endpoint = 'ws://$ipAddress:9944';
}
configBox.put('customEndpoint', endpoint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment