gitlab-ci: force skip Espresso tests on < android-25

It seems that ARM emulators timeout even when just trying to run the
assumeTrue() tests via Espresso.  There needs to be one test still enabled
in the file, otherwise, the run fails with:

org.fdroid.fdroid.MainActivityEspressoTest > initializationError[Nexus_One_API_19(AVD) - 4.4.2] FAILED
        java.lang.Exception: No runnable methods
        at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
This commit is contained in:
Hans-Christoph Steiner 2019-01-08 13:29:32 +01:00
parent 11ff830d3d
commit 22773f3de3
2 changed files with 8 additions and 8 deletions

View File

@ -93,7 +93,8 @@ errorprone:
- wait-for-emulator
- adb devices
- adb shell input keyevent 82 &
- ./gradlew connectedFullDebugAndroidTest || (adb -e logcat -d > logcat.txt; exit 1)
- test $AVD_SDK -ge 25 || export FLAG=-Pandroid.testInstrumentationRunnerArguments.notAnnotation=android.test.suitebuilder.annotation.LargeTest
- ./gradlew connectedFullDebugAndroidTest $FLAG || (adb -e logcat -d > logcat.txt; exit 1)
connected 24 default armeabi-v7a:
retry: 1

View File

@ -48,7 +48,6 @@ import static org.junit.Assert.assertTrue;
@Ignore
@RunWith(AndroidJUnit4.class)
@LargeTest
public class MainActivityEspressoTest {
public static final String TAG = "MainActivityEspressoTest";
@ -151,7 +150,7 @@ public class MainActivityEspressoTest {
}
}
@Test
@LargeTest
public void showSettings() {
ViewInteraction settingsBottonNavButton = onView(
allOf(withText(R.string.menu_settings), isDisplayed()));
@ -168,14 +167,14 @@ public class MainActivityEspressoTest {
onView(withText(R.string.installed_apps__activity_title)).check(matches(isDisplayed()));
}
@Test
@LargeTest
public void showUpdates() {
ViewInteraction updatesBottonNavButton = onView(allOf(withText(R.string.main_menu__updates), isDisplayed()));
updatesBottonNavButton.perform(click());
onView(withText(R.string.main_menu__updates)).check(matches(isDisplayed()));
}
@Test
@LargeTest
public void startSwap() {
if (!BuildConfig.FLAVOR.startsWith("full")) {
return;
@ -189,7 +188,7 @@ public class MainActivityEspressoTest {
onView(withText(R.string.swap_send_fdroid)).check(matches(isDisplayed()));
}
@Test
@LargeTest
public void showCategories() {
if (!BuildConfig.FLAVOR.startsWith("full")) {
return;
@ -214,7 +213,7 @@ public class MainActivityEspressoTest {
.perform(click());
}
@Test
@LargeTest
public void showLatest() {
if (!BuildConfig.FLAVOR.startsWith("full")) {
return;
@ -236,7 +235,7 @@ public class MainActivityEspressoTest {
.perform(click());
}
@Test
@LargeTest
public void showSearch() {
onView(allOf(withText(R.string.menu_settings), isDisplayed())).perform(click());
onView(withId(R.id.fab_search)).check(doesNotExist());