From 5232e13d95a2e2e52b1e6157c62bc494058435bf Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 1 Feb 2023 14:00:40 -0800 Subject: [PATCH] Clean Up for UI Automated Testing --- .drone.yml | 5 +---- lib/main.dart | 10 +++------- run-tests.sh | 5 +++-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2a93b406..086bb71d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -66,13 +66,10 @@ steps: - name: deps path: /root/.pub-cache commands: - # - flutter config --enable-linux-desktop + - # todo: add xvfb to openpriv/flutter-desktop:linux-fstable-3.7 - sudo apt update - sudo apt-get install -y xvfb - ./fetch-tor.sh - - export PATH=$PATH:$PWD/linux/Tor - - export LD_LIBRARY_PATH="$PWD/linux/Tor/" - - tor --version - ./run-tests-headless.sh 02_save_load - name: test-build-android diff --git a/lib/main.dart b/lib/main.dart index e875c8d9..019ab432 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -43,7 +43,6 @@ Future main() async { LicenseRegistry.addLicense(() => licenses()); WidgetsFlutterBinding.ensureInitialized(); print("runApp()"); - print("Testing"); return runApp(Flwtch()); } @@ -66,7 +65,7 @@ class FlwtchState extends State with WindowListener { Future shutdownDirect(MethodCall call) async { print(call); - await cwtch.Shutdown().timeout(Duration(seconds: 1)); + cwtch.Shutdown(); return Future.value({}); } @@ -196,9 +195,8 @@ class FlwtchState extends State with WindowListener { Future shutdown() async { globalAppState.SetModalState(ModalState.shutdown); print("shutting down"); - await cwtch.Shutdown().timeout(Duration(seconds: 1)); + await cwtch.Shutdown(); // Wait a few seconds as shutting down things takes a little time.. - print("done"); { if (Platform.isAndroid) { SystemNavigator.pop(); @@ -272,9 +270,7 @@ class FlwtchState extends State with WindowListener { @override void dispose() { globalAppState.SetModalState(ModalState.shutdown); - cwtch.Shutdown().timeout(Duration(seconds: 1), onTimeout: () { - - }); + cwtch.Shutdown(); windowManager.removeListener(this); cwtch.dispose(); super.dispose(); diff --git a/run-tests.sh b/run-tests.sh index 5b35fc2e..235583f0 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -5,8 +5,9 @@ sed "s|featurePaths: REPLACED_BY_SCRIPT|featurePaths: [$paths]|" integra flutter pub run build_runner clean flutter pub run build_runner build --delete-conflicting-outputs -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./linux/" -LD_LIBRARY_PATH=$LD_LIBRARY_PATH LOG_FILE=/home/sarah/PARA/projects/cwtch/cwtch.log CWTCH_HOME=$PWD/integration_test/env/temp/ flutter test -d linux --dart-define TEST_MODE=true integration_test/gherkin_suite_test.dart +PATH=$PATH:$PWD/linux/Tor +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$PWD/linux/":"$PWD/linux/Tor/" +LOG_FILE=/home/sarah/PARA/projects/cwtch/cwtch.log CWTCH_HOME=$PWD/integration_test/env/temp/ flutter test -d linux --dart-define TEST_MODE=true integration_test/gherkin_suite_test.dart #node index2.js #if [ "$HEADLESS" = "false" ]; then # xdg-open integration_test/gherkin/reports/cucumber_report.html