diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2755a66b..2163f5717 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,10 @@ test: script: - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom check + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: always + - when: always android test: extends: .base-test @@ -48,15 +52,17 @@ android test: when: on_failure rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' + when: on_success - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: - briar-android/**/* when: manual allow_failure: true + - if: '$CI_COMMIT_TAG == null' + when: manual + allow_failure: true retry: max: 1 - when: - - script_failure tags: - kvm @@ -87,11 +93,15 @@ test_reproducible: - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ -manual_tests: +bridge test: extends: .optional_tests - when: manual - except: - - tags + rules: + - if: '$CI_PIPELINE_SOURCE == "schedule"' + when: on_success + allow_failure: true + - if: '$CI_COMMIT_TAG == null' + when: manual + allow_failure: true pre_release_tests: extends: .optional_tests diff --git a/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/PromoVideoTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/PromoVideoTest.java index 7e9d6f430..6b808c5d1 100644 --- a/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/PromoVideoTest.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/PromoVideoTest.java @@ -87,7 +87,7 @@ public class PromoVideoTest extends ScreenshotTest { // It takes a long time for SetupActivity to start after the splash, // (because it is shown longer for videos), so increase timeout. - if (!isFilming) waitFor(SetupActivity.class, 20_000); + if (!isFilming) waitFor(SetupActivity.class, 30_000); // Note: We use waiting code only when not filming, // to make the test reliable for CI. Otherwise, we used fixed diff --git a/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java index 61c0a5bbd..99798ae5b 100644 --- a/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java @@ -3,6 +3,8 @@ package org.briarproject.briar.android; import android.app.Activity; import android.util.Log; +import com.jraska.falcon.Falcon.UnableToTakeScreenshotException; + import org.briarproject.bramble.api.connection.ConnectionRegistry; import org.briarproject.bramble.api.system.Clock; import org.briarproject.briar.api.test.TestDataCreator; @@ -34,6 +36,8 @@ public abstract class ScreenshotTest extends UiTest { protected void screenshot(String name, Activity activity) { try { Screengrab.screenshot(name, new FalconScreenshotStrategy(activity)); + } catch (UnableToTakeScreenshotException e) { + Log.e("Screengrab", "Error taking screenshot", e); } catch (RuntimeException e) { if (e.getMessage() == null || !e.getMessage().equals("Unable to capture screenshot."))