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
Tags
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 ...@@ -5,8 +5,9 @@ option=$2
[[ ! $testName ]] && testName='gecko_complete' [[ ! $testName ]] && testName='gecko_complete'
# Get local IP and set .env # Get local IP and set .env
ip_address=$(hostname -I | awk '{print $1}') #ip_address=$(hostname -I 2>/dev/null || ipconfig 2>&1 | grep "IPv4 Address" | head -n1 | awk -F ':' '{ print $2}' | tr -d ' ') # old fashion style...
echo "ip_address=$ip_address" > .env #ip_address="10.0.2.2"
#echo "ip_address=$ip_address" > .env
[[ $option == 'human' ]] && echo "isHumanReading=true" >> .env [[ $option == 'human' ]] && echo "isHumanReading=true" >> .env
## Start local Duniter node ## Start local Duniter node
...@@ -20,10 +21,10 @@ cd ../.. ...@@ -20,10 +21,10 @@ cd ../..
flutter test integration_test/scenarios/$testName.dart && echo '0' > /tmp/geckoTestResult || echo '1' > /tmp/geckoTestResult flutter test integration_test/scenarios/$testName.dart && echo '0' > /tmp/geckoTestResult || echo '1' > /tmp/geckoTestResult
# Reset .env # 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 # Stop Duniter
cd integration_test/duniter cd integration_test/duniter
docker compose down docker compose down
exit 0
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
...@@ -11,7 +10,7 @@ import 'tests_utility.dart'; ...@@ -11,7 +10,7 @@ import 'tests_utility.dart';
// GENERAL ACTIONS // GENERAL ACTIONS
Future changeNode() async { Future changeNode() async {
final ipAddress = dotenv.env['ip_address'] ?? '127.0.0.1'; const ipAddress = '10.0.2.2';
log.d('ip address: $ipAddress'); log.d('ip address: $ipAddress');
await tapKey(keyDrawerMenu); await tapKey(keyDrawerMenu);
......
...@@ -223,7 +223,7 @@ Future bkConfirmIdentity( ...@@ -223,7 +223,7 @@ Future bkConfirmIdentity(
// Change node in background // Change node in background
Future bkSetNode([String? endpoint]) async { Future bkSetNode([String? endpoint]) async {
if (endpoint == null) { if (endpoint == null) {
final ipAddress = dotenv.env['ip_address'] ?? '127.0.0.1'; const ipAddress = '10.0.2.2';
endpoint = 'ws://$ipAddress:9944'; endpoint = 'ws://$ipAddress:9944';
} }
configBox.put('customEndpoint', endpoint); configBox.put('customEndpoint', endpoint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment