Merge branch 'scheduled-tests' into 'master'

Run bridge tests in scheduled nightly tests (and fix merge pipelines)

See merge request briar/briar!1431
This commit is contained in:
akwizgran
2021-04-21 13:55:48 +00:00
3 changed files with 21 additions and 7 deletions

View File

@@ -25,6 +25,10 @@ test:
script: script:
- ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom animalSnifferMain animalSnifferTest
- ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom check - ./gradlew --no-daemon -Djava.security.egd=file:/dev/urandom check
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- when: always
android test: android test:
extends: .base-test extends: .base-test
@@ -48,15 +52,17 @@ android test:
when: on_failure when: on_failure
rules: rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"' - if: '$CI_PIPELINE_SOURCE == "schedule"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: changes:
- briar-android/**/* - briar-android/**/*
when: manual when: manual
allow_failure: true allow_failure: true
- if: '$CI_COMMIT_TAG == null'
when: manual
allow_failure: true
retry: retry:
max: 1 max: 1
when:
- script_failure
tags: tags:
- kvm - kvm
@@ -87,11 +93,15 @@ test_reproducible:
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
- rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
manual_tests: bridge test:
extends: .optional_tests extends: .optional_tests
when: manual rules:
except: - if: '$CI_PIPELINE_SOURCE == "schedule"'
- tags when: on_success
allow_failure: true
- if: '$CI_COMMIT_TAG == null'
when: manual
allow_failure: true
pre_release_tests: pre_release_tests:
extends: .optional_tests extends: .optional_tests

View File

@@ -87,7 +87,7 @@ public class PromoVideoTest extends ScreenshotTest {
// It takes a long time for SetupActivity to start after the splash, // It takes a long time for SetupActivity to start after the splash,
// (because it is shown longer for videos), so increase timeout. // (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, // Note: We use waiting code only when not filming,
// to make the test reliable for CI. Otherwise, we used fixed // to make the test reliable for CI. Otherwise, we used fixed

View File

@@ -3,6 +3,8 @@ package org.briarproject.briar.android;
import android.app.Activity; import android.app.Activity;
import android.util.Log; import android.util.Log;
import com.jraska.falcon.Falcon.UnableToTakeScreenshotException;
import org.briarproject.bramble.api.connection.ConnectionRegistry; import org.briarproject.bramble.api.connection.ConnectionRegistry;
import org.briarproject.bramble.api.system.Clock; import org.briarproject.bramble.api.system.Clock;
import org.briarproject.briar.api.test.TestDataCreator; import org.briarproject.briar.api.test.TestDataCreator;
@@ -34,6 +36,8 @@ public abstract class ScreenshotTest extends UiTest {
protected void screenshot(String name, Activity activity) { protected void screenshot(String name, Activity activity) {
try { try {
Screengrab.screenshot(name, new FalconScreenshotStrategy(activity)); Screengrab.screenshot(name, new FalconScreenshotStrategy(activity));
} catch (UnableToTakeScreenshotException e) {
Log.e("Screengrab", "Error taking screenshot", e);
} catch (RuntimeException e) { } catch (RuntimeException e) {
if (e.getMessage() == null || if (e.getMessage() == null ||
!e.getMessage().equals("Unable to capture screenshot.")) !e.getMessage().equals("Unable to capture screenshot."))