From 3b4997594667263281a5212e52515283e08191df Mon Sep 17 00:00:00 2001 From: denbond7 Date: Wed, 16 Apr 2025 08:22:25 +0300 Subject: [PATCH 01/15] Updated os_image to ubuntu2404.| #3011 --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a76d8359b5..83793d5e18 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -3,7 +3,7 @@ name: FlowCrypt Android App agent: machine: type: e2-standard-2 - os_image: ubuntu2004 + os_image: ubuntu2404 execution_time_limit: minutes: 60 From 30a6b73397ef03a1a7ac9300f8b626c1066bfba4 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Wed, 16 Apr 2025 10:48:57 +0300 Subject: [PATCH 02/15] Redirected the systemd-resolved to use the localhost as the primary nameserver.| #3011 --- .semaphore/semaphore.yml | 108 +-------------------------------------- 1 file changed, 2 insertions(+), 106 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 83793d5e18..2ea137c679 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -33,6 +33,8 @@ global_job_config: - echo "address=/flowcrypt.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - echo "address=/wrongssl.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - echo "address=/localhost/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf + # redirect the systemd-resolved to use the localhost as the primary nameserver + - sudo sed -i '1inameserver 127.0.0.1\' /etc/resolv.conf - sudo systemctl restart dnsmasq # print some debug info - ping fel.localhost -c 1 @@ -87,109 +89,3 @@ blocks: - cache has_key $BUILD_CXX_CACHE || cache store $BUILD_CXX_CACHE FlowCrypt/.cxx - cache has_key $BUILD_NATIVE_CACHE || cache store $BUILD_NATIVE_CACHE FlowCrypt/.externalNativeBuild - cache has_key $BUILD_CACHE || cache store $BUILD_CACHE FlowCrypt/build - - # clean and store global cache - - echo "Store the global cache" - - find ~/.gradle/caches/ -name "*.lock" -type f -delete # https://medium.com/cirruslabs/mastering-gradle-caching-and-incremental-builds-37eb1af7fcde - - cache has_key $ANDROID_SDK_CACHE || cache store $ANDROID_SDK_CACHE $ANDROID_HOME - - cache delete gradle-wrapper - - cache delete gradle-cache - - cache delete android-build-cache - - cache store gradle-wrapper ~/.gradle/wrapper - - cache store gradle-cache ~/.gradle/caches - - cache store android-build-cache ~/.android/build-cache - - - name: 'Testing' - task: - jobs: - - name: 'Lint(structural quality)' - execution_time_limit: - minutes: 15 - commands: - # run Lint checks - - ./script/ci-lint-checks.sh - - - name: 'JUnit tests' - execution_time_limit: - minutes: 15 - commands: - # run JUnit tests - - ./script/ci-junit-tests.sh - - - name: 'Instrumentation tests(No email server)' - execution_time_limit: - minutes: 60 - matrix: - - env_var: EMULATOR - values: [ "0", "1", "2", "3" ] - commands: - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - # wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-without-mailserver.sh 4 $EMULATOR - - - name: 'Instrumentation tests(with email server)' - execution_time_limit: - minutes: 60 - commands: - # Run an email server - - cd docker-mailserver && ./run_email_server.sh && cd - - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - #wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-with-mailserver.sh - - - name: 'Instrumentation tests(enterprise)' - execution_time_limit: - minutes: 60 - commands: - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - #wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-enterprise.sh - - - name: 'Instrumentation tests(flaky)' - execution_time_limit: - minutes: 60 - commands: - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - #wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-flaky.sh - - epilogue: - always: - commands: - # export tests result if needed - - ./script/ci-publish-test-results.sh - - # do additional actions if needed - - ./script/ci-after-success-actions-for-instrumentation-tests.sh - - on_fail: - commands: - # collect and store debug info as artifacts - - ./script/ci-get-and-publish-debug-info-as-artifact.sh - -after_pipeline: - task: - jobs: - - name: Publish Results - commands: - - test-results gen-pipeline-report \ No newline at end of file From 88e190f3954883c15dcc69e9f73c7b7b5a46c7f1 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Wed, 16 Apr 2025 10:56:42 +0300 Subject: [PATCH 03/15] Reverted back some changes.| #3013 --- .semaphore/semaphore.yml | 106 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 2ea137c679..691789def8 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -89,3 +89,109 @@ blocks: - cache has_key $BUILD_CXX_CACHE || cache store $BUILD_CXX_CACHE FlowCrypt/.cxx - cache has_key $BUILD_NATIVE_CACHE || cache store $BUILD_NATIVE_CACHE FlowCrypt/.externalNativeBuild - cache has_key $BUILD_CACHE || cache store $BUILD_CACHE FlowCrypt/build + + # clean and store global cache + - echo "Store the global cache" + - find ~/.gradle/caches/ -name "*.lock" -type f -delete # https://medium.com/cirruslabs/mastering-gradle-caching-and-incremental-builds-37eb1af7fcde + - cache has_key $ANDROID_SDK_CACHE || cache store $ANDROID_SDK_CACHE $ANDROID_HOME + - cache delete gradle-wrapper + - cache delete gradle-cache + - cache delete android-build-cache + - cache store gradle-wrapper ~/.gradle/wrapper + - cache store gradle-cache ~/.gradle/caches + - cache store android-build-cache ~/.android/build-cache + + - name: 'Testing' + task: + jobs: + - name: 'Lint(structural quality)' + execution_time_limit: + minutes: 15 + commands: + # run Lint checks + - ./script/ci-lint-checks.sh + + - name: 'JUnit tests' + execution_time_limit: + minutes: 15 + commands: + # run JUnit tests + - ./script/ci-junit-tests.sh + + - name: 'Instrumentation tests(No email server)' + execution_time_limit: + minutes: 60 + matrix: + - env_var: EMULATOR + values: [ "0", "1", "2", "3" ] + commands: + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + # wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-without-mailserver.sh 4 $EMULATOR + + - name: 'Instrumentation tests(with email server)' + execution_time_limit: + minutes: 60 + commands: + # Run an email server + - cd docker-mailserver && ./run_email_server.sh && cd - + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + #wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-with-mailserver.sh + + - name: 'Instrumentation tests(enterprise)' + execution_time_limit: + minutes: 60 + commands: + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + #wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-enterprise.sh + + - name: 'Instrumentation tests(flaky)' + execution_time_limit: + minutes: 60 + commands: + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + #wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-flaky.sh + + epilogue: + always: + commands: + # export tests result if needed + - ./script/ci-publish-test-results.sh + + # do additional actions if needed + - ./script/ci-after-success-actions-for-instrumentation-tests.sh + + on_fail: + commands: + # collect and store debug info as artifacts + - ./script/ci-get-and-publish-debug-info-as-artifact.sh + +after_pipeline: + task: + jobs: + - name: Publish Results + commands: + - test-results gen-pipeline-report \ No newline at end of file From c92ba74ad5f618cc198194a979e6357314936bc9 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Thu, 17 Apr 2025 09:29:48 +0300 Subject: [PATCH 04/15] wip --- .../com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt | 4 +++- ...ordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt index 5600c08c30..eb4ad3487b 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui @@ -28,6 +28,7 @@ import com.flowcrypt.email.util.exception.ApiException import com.google.gson.Gson import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.RecordedRequest +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -156,6 +157,7 @@ class FesDuringSetupConsumerFlowTest : BaseFesDuringSetupFlowTest() { } @Test + @Ignore("temp") fun testFesAvailableRequestTimeOutHasConnection() { setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_FES_REQUEST_TIME_OUT)) isDialogWithTextDisplayed( diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt index 6da001deb9..5e95485a19 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt @@ -40,6 +40,7 @@ import okhttp3.mockwebserver.Dispatcher import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.RecordedRequest import org.hamcrest.Matchers.allOf +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -113,6 +114,7 @@ class ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest .around(ScreenshotTestRule()) @Test + @Ignore("temp") fun testDialogWithErrorText() { intentsRelease() From 6f0fd8aada6fb7dac016cc97f4de80a85d31e560 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Thu, 17 Apr 2025 09:54:08 +0300 Subject: [PATCH 05/15] wip --- .../com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt | 2 -- .../com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt index eb4ad3487b..adb12a315e 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt @@ -28,7 +28,6 @@ import com.flowcrypt.email.util.exception.ApiException import com.google.gson.Gson import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.RecordedRequest -import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -157,7 +156,6 @@ class FesDuringSetupConsumerFlowTest : BaseFesDuringSetupFlowTest() { } @Test - @Ignore("temp") fun testFesAvailableRequestTimeOutHasConnection() { setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_FES_REQUEST_TIME_OUT)) isDialogWithTextDisplayed( diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt index 13139ec5c5..4b8cfae009 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt @@ -35,6 +35,7 @@ import okhttp3.mockwebserver.RecordedRequest import org.hamcrest.Matchers.containsString import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -129,6 +130,7 @@ class FesDuringSetupEnterpriseFlowTest : BaseFesDuringSetupFlowTest() { } @Test + @Ignore("temp") fun testFesAvailableRequestTimeOutHasConnection() { setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_FES_REQUEST_TIME_OUT)) isDialogWithTextDisplayed( From 4a84d43c6c2e7ebcd1785cbce039d2389d45c5f1 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Thu, 17 Apr 2025 12:14:47 +0300 Subject: [PATCH 06/15] wip --- .semaphore/semaphore.yml | 59 +------------------ ...llowedTermsReFetchConfigurationFlowTest.kt | 3 +- 2 files changed, 2 insertions(+), 60 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 691789def8..258b1fd73b 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -104,50 +104,6 @@ blocks: - name: 'Testing' task: jobs: - - name: 'Lint(structural quality)' - execution_time_limit: - minutes: 15 - commands: - # run Lint checks - - ./script/ci-lint-checks.sh - - - name: 'JUnit tests' - execution_time_limit: - minutes: 15 - commands: - # run JUnit tests - - ./script/ci-junit-tests.sh - - - name: 'Instrumentation tests(No email server)' - execution_time_limit: - minutes: 60 - matrix: - - env_var: EMULATOR - values: [ "0", "1", "2", "3" ] - commands: - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - # wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-without-mailserver.sh 4 $EMULATOR - - - name: 'Instrumentation tests(with email server)' - execution_time_limit: - minutes: 60 - commands: - # Run an email server - - cd docker-mailserver && ./run_email_server.sh && cd - - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - #wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-with-mailserver.sh - name: 'Instrumentation tests(enterprise)' execution_time_limit: @@ -160,20 +116,7 @@ blocks: # Run filtered logging for TestRunner - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & # Run instrumentation tests - - ./script/ci-instrumentation-tests-enterprise.sh - - - name: 'Instrumentation tests(flaky)' - execution_time_limit: - minutes: 60 - commands: - # Setup and run an emulator - - ./script/ci-setup-and-run-emulator.sh - #wait until ready - - ./script/ci-wait-for-emulator.sh - # Run filtered logging for TestRunner - - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & - # Run instrumentation tests - - ./script/ci-instrumentation-tests-flaky.sh + - ./gradlew :FlowCrypt:connectedEnterpriseUiTestsAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.flowcrypt.email.ui.gmailapi.passwordprotected.ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest" epilogue: always: diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt index 5e95485a19..ede7dbc37e 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt @@ -40,7 +40,6 @@ import okhttp3.mockwebserver.Dispatcher import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.RecordedRequest import org.hamcrest.Matchers.allOf -import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -114,7 +113,7 @@ class ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest .around(ScreenshotTestRule()) @Test - @Ignore("temp") + //@Ignore("temp") fun testDialogWithErrorText() { intentsRelease() From e4a981f23aaa66b587a17481cf209a84378e683d Mon Sep 17 00:00:00 2001 From: denbond7 Date: Fri, 18 Apr 2025 13:32:03 +0300 Subject: [PATCH 07/15] wip --- ...swordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt index ede7dbc37e..5b7eeb3083 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt @@ -115,6 +115,8 @@ class ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest @Test //@Ignore("temp") fun testDialogWithErrorText() { + Thread.sleep(60000) + intentsRelease() //do checking before updating client configuration From fb7976c5267742b8b9bc2ef8e4e5536cada7dccd Mon Sep 17 00:00:00 2001 From: denbond7 Date: Fri, 18 Apr 2025 14:02:51 +0300 Subject: [PATCH 08/15] wip --- script/ci-wait-for-emulator.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/script/ci-wait-for-emulator.sh b/script/ci-wait-for-emulator.sh index c91a189fb8..283d585b5c 100755 --- a/script/ci-wait-for-emulator.sh +++ b/script/ci-wait-for-emulator.sh @@ -1,4 +1,9 @@ #!/bin/bash +# +# © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com +# Contributors: denbond7 +# + set -o xtrace adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;' adb shell wm dismiss-keyguard @@ -18,5 +23,10 @@ adb shell "iptables -t nat -A PREROUTING -s 127.0.0.1 -p tcp --dport 443 -j REDI adb shell "iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT --to 1212" ################################################################################################### +# https://developer.android.com/tools/adb#forwardports +# forwards requests on a specific host port to a different port on a device. +# It can be helpful for debugging a mock web server +adb forward tcp:1212 tcp:1212 + echo "Emulator is ready" set +o xtrace From 783c8731d95ee12ad3a81cb75208642e3168e88f Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 10:10:40 +0300 Subject: [PATCH 09/15] wip --- FlowCrypt/build.gradle.kts | 8 ++++---- .../email/ui/FesDuringSetupEnterpriseFlowTest.kt | 3 +-- ...rotectedDisallowedTermsReFetchConfigurationFlowTest.kt | 2 +- .../email/ui/activity/fragment/MainSignInFragment.kt | 6 ++++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index b373a3fc99..877daacbc3 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -124,10 +124,10 @@ android { "SHARED_TENANT_FES_URL", "\"https://flowcrypt.test/shared-tenant-fes/\"" ) - buildConfigField("boolean", "IS_HTTP_LOG_ENABLED", "false") - buildConfigField("String", "HTTP_LOG_LEVEL", "\"NONE\"") - resValue("string", "gradle_is_http_log_enabled", "false") - resValue("string", "gradle_http_log_level", "NONE") + buildConfigField("boolean", "IS_HTTP_LOG_ENABLED", "true") + buildConfigField("String", "HTTP_LOG_LEVEL", "\"BODY\"") + resValue("string", "gradle_is_http_log_enabled", "true") + resValue("string", "gradle_http_log_level", "BODY") } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt index 4b8cfae009..3d849d3b0c 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt @@ -35,7 +35,6 @@ import okhttp3.mockwebserver.RecordedRequest import org.hamcrest.Matchers.containsString import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not -import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -130,7 +129,7 @@ class FesDuringSetupEnterpriseFlowTest : BaseFesDuringSetupFlowTest() { } @Test - @Ignore("temp") + //@Ignore("temp") fun testFesAvailableRequestTimeOutHasConnection() { setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_FES_REQUEST_TIME_OUT)) isDialogWithTextDisplayed( diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt index 5b7eeb3083..32b7a8ffb8 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt @@ -115,7 +115,7 @@ class ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest @Test //@Ignore("temp") fun testDialogWithErrorText() { - Thread.sleep(60000) + //Thread.sleep(60000) intentsRelease() diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt index 9cd10083cf..bc3617eb58 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui.activity.fragment @@ -609,8 +609,10 @@ class MainSignInFragment : BaseSingInFragment() { ) ) } else { + println("DDDDDDDDD") + it.exception.printStackTrace(System.out) showDialogWithRetryButton( - getString(R.string.no_connection_or_server_is_not_reachable), + getString(R.string.no_connection_or_server_is_not_reachable) + it.exceptionMsg, REQUEST_CODE_RETRY_CHECK_FES_AVAILABILITY ) } From 85f5044433f7e96b99d2a6ace1838a0049f373cc Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 10:31:15 +0300 Subject: [PATCH 10/15] wip --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 258b1fd73b..cf83d927bd 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -116,7 +116,7 @@ blocks: # Run filtered logging for TestRunner - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & # Run instrumentation tests - - ./gradlew :FlowCrypt:connectedEnterpriseUiTestsAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.flowcrypt.email.ui.gmailapi.passwordprotected.ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest" + - ./gradlew :FlowCrypt:connectedEnterpriseUiTestsAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.flowcrypt.email.ui.FesDuringSetupEnterpriseFlowTest" epilogue: always: From 0e133c755062cbaa1fd64901d38c6cd8fa62d029 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 12:59:53 +0300 Subject: [PATCH 11/15] wip --- .semaphore/semaphore.yml | 4 ++-- .../email/ui/activity/fragment/MainSignInFragment.kt | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index cf83d927bd..9dbabb88d7 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -30,9 +30,9 @@ global_job_config: - sudo apt install -y dnsmasq resolvconf - echo "#added by flowcrypt" | sudo tee -a /etc/dnsmasq.conf - echo "listen-address=127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - - echo "address=/flowcrypt.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - - echo "address=/wrongssl.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf + - echo "address=/test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - echo "address=/localhost/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf + - echo "server=8.8.8.8" | sudo tee -a /etc/dnsmasq.conf # redirect the systemd-resolved to use the localhost as the primary nameserver - sudo sed -i '1inameserver 127.0.0.1\' /etc/resolv.conf - sudo systemctl restart dnsmasq diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt index bc3617eb58..4d485196a8 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt @@ -609,10 +609,8 @@ class MainSignInFragment : BaseSingInFragment() { ) ) } else { - println("DDDDDDDDD") - it.exception.printStackTrace(System.out) showDialogWithRetryButton( - getString(R.string.no_connection_or_server_is_not_reachable) + it.exceptionMsg, + getString(R.string.no_connection_or_server_is_not_reachable), REQUEST_CODE_RETRY_CHECK_FES_AVAILABILITY ) } From c7222a752608df4ca931d94a5265b41c44ab9881 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 13:17:46 +0300 Subject: [PATCH 12/15] wip --- .semaphore/semaphore.yml | 59 +++++++++++++++++++++++++++++++++++++- FlowCrypt/build.gradle.kts | 8 +++--- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 9dbabb88d7..a37234d007 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -104,6 +104,50 @@ blocks: - name: 'Testing' task: jobs: + - name: 'Lint(structural quality)' + execution_time_limit: + minutes: 15 + commands: + # run Lint checks + - ./script/ci-lint-checks.sh + + - name: 'JUnit tests' + execution_time_limit: + minutes: 15 + commands: + # run JUnit tests + - ./script/ci-junit-tests.sh + + - name: 'Instrumentation tests(No email server)' + execution_time_limit: + minutes: 60 + matrix: + - env_var: EMULATOR + values: [ "0", "1", "2", "3" ] + commands: + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + # wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-without-mailserver.sh 4 $EMULATOR + + - name: 'Instrumentation tests(with email server)' + execution_time_limit: + minutes: 60 + commands: + # Run an email server + - cd docker-mailserver && ./run_email_server.sh && cd - + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + #wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-with-mailserver.sh - name: 'Instrumentation tests(enterprise)' execution_time_limit: @@ -116,7 +160,20 @@ blocks: # Run filtered logging for TestRunner - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & # Run instrumentation tests - - ./gradlew :FlowCrypt:connectedEnterpriseUiTestsAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.flowcrypt.email.ui.FesDuringSetupEnterpriseFlowTest" + - ./script/ci-instrumentation-tests-enterprise.sh + + - name: 'Instrumentation tests(flaky)' + execution_time_limit: + minutes: 60 + commands: + # Setup and run an emulator + - ./script/ci-setup-and-run-emulator.sh + #wait until ready + - ./script/ci-wait-for-emulator.sh + # Run filtered logging for TestRunner + - adb logcat -v color TestRunner:V *:S > ~/logcat_log.txt & + # Run instrumentation tests + - ./script/ci-instrumentation-tests-flaky.sh epilogue: always: diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index 3ae602a31f..da4a274235 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -124,10 +124,10 @@ android { "SHARED_TENANT_FES_URL", "\"https://flowcrypt.test/shared-tenant-fes/\"" ) - buildConfigField("boolean", "IS_HTTP_LOG_ENABLED", "true") - buildConfigField("String", "HTTP_LOG_LEVEL", "\"BODY\"") - resValue("string", "gradle_is_http_log_enabled", "true") - resValue("string", "gradle_http_log_level", "BODY") + buildConfigField("boolean", "IS_HTTP_LOG_ENABLED", "false") + buildConfigField("String", "HTTP_LOG_LEVEL", "\"NONE\"") + resValue("string", "gradle_is_http_log_enabled", "false") + resValue("string", "gradle_http_log_level", "NONE") } } From c8e63b2abe0a5e9926fad17dcd329e102c8484bb Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 13:18:13 +0300 Subject: [PATCH 13/15] wip --- ...wordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt | 3 --- .../flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt index 32b7a8ffb8..6da001deb9 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/passwordprotected/ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest.kt @@ -113,10 +113,7 @@ class ComposeScreenPasswordProtectedDisallowedTermsReFetchConfigurationFlowTest .around(ScreenshotTestRule()) @Test - //@Ignore("temp") fun testDialogWithErrorText() { - //Thread.sleep(60000) - intentsRelease() //do checking before updating client configuration diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt index 4d485196a8..9cd10083cf 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MainSignInFragment.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: denbond7 + * Contributors: DenBond7 */ package com.flowcrypt.email.ui.activity.fragment From 1488544f53c651219945515ea32e8d7acaf2ecde Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 13:19:48 +0300 Subject: [PATCH 14/15] wip --- .../com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt | 2 +- .../com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt index adb12a315e..5600c08c30 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupConsumerFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: denbond7 + * Contributors: DenBond7 */ package com.flowcrypt.email.ui diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt index 3d849d3b0c..13139ec5c5 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/FesDuringSetupEnterpriseFlowTest.kt @@ -129,7 +129,6 @@ class FesDuringSetupEnterpriseFlowTest : BaseFesDuringSetupFlowTest() { } @Test - //@Ignore("temp") fun testFesAvailableRequestTimeOutHasConnection() { setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_FES_REQUEST_TIME_OUT)) isDialogWithTextDisplayed( From 46d94e004a0d58215170eda9976289405e12f172 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Mon, 21 Apr 2025 13:25:12 +0300 Subject: [PATCH 15/15] wip --- script/ci-wait-for-emulator.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/ci-wait-for-emulator.sh b/script/ci-wait-for-emulator.sh index 283d585b5c..6e622f6437 100755 --- a/script/ci-wait-for-emulator.sh +++ b/script/ci-wait-for-emulator.sh @@ -28,5 +28,8 @@ adb shell "iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT # It can be helpful for debugging a mock web server adb forward tcp:1212 tcp:1212 +#check the emulator has internet connection +adb shell "ping -c 1 www.google.com" + echo "Emulator is ready" set +o xtrace