From 06b6f8794f243bd9c53e62aaf533fb4bbdceeb2a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 18 Jan 2021 19:18:16 +0100 Subject: [PATCH 1/4] gitlab-ci: retry flaky testFullDebugUnitTest --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52d59fc6a..05e90dedf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ test_lint_pmd_checkstyle: - ./gradlew assemble # always report on lint errors to the build log - sed -i -e 's,textReport .*,textReport true,' app/build.gradle - - ./gradlew testFullDebugUnitTest + - ./gradlew testFullDebugUnitTest || ./gradlew testFullDebugUnitTest || ./gradlew testFullDebugUnitTest || set_error - ./gradlew lint - ./gradlew pmd || (export EXITVALUE=1; echo ERROR !!) - ./gradlew checkstyle || (export EXITVALUE=1; echo ERROR !!) From c697501f8fdb64ddc7e63983462f8fa741fc0cff Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 18 Jan 2021 19:19:23 +0100 Subject: [PATCH 2/4] gitlab-ci: run all test_lint_pmd_checkstyle parts, even after failures --- .gitlab-ci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05e90dedf..ef27b63ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,18 +37,19 @@ test_lint_pmd_checkstyle: <<: *test-template script: - export EXITVALUE=0 + - function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; } - ./gradlew assemble # always report on lint errors to the build log - sed -i -e 's,textReport .*,textReport true,' app/build.gradle - ./gradlew testFullDebugUnitTest || ./gradlew testFullDebugUnitTest || ./gradlew testFullDebugUnitTest || set_error - - ./gradlew lint - - ./gradlew pmd || (export EXITVALUE=1; echo ERROR !!) - - ./gradlew checkstyle || (export EXITVALUE=1; echo ERROR !!) - - ./tools/check-format-strings.py || (export EXITVALUE=1; echo ERROR !!) - - ./tools/check-fastlane-whitespace.py || (export EXITVALUE=1; echo ERROR !!) - - ./tools/remove-unused-and-blank-translations.py || (export EXITVALUE=1; echo ERROR !!) + - ./gradlew lint || set_error + - ./gradlew pmd || set_error + - ./gradlew checkstyle || set_error + - ./tools/check-format-strings.py || set_error + - ./tools/check-fastlane-whitespace.py || set_error + - ./tools/remove-unused-and-blank-translations.py || set_error - echo "These are unused or blank translations that should be removed:" - - git --no-pager diff --ignore-all-space --name-only --exit-code app/src/*/res/values*/strings.xml || (export EXITVALUE=1; echo ERROR !!) + - git --no-pager diff --ignore-all-space --name-only --exit-code app/src/*/res/values*/strings.xml || set_error - exit $EXITVALUE errorprone: From c5056a81671fa67d5e921009b44b134c9507eb92 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 12 Jan 2021 18:17:57 +0100 Subject: [PATCH 3/4] gitlab-ci: run errorprone with Java11 --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef27b63ef..5ef24f07b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,6 +55,10 @@ test_lint_pmd_checkstyle: errorprone: stage: test script: + - apt-get update + - apt-get install -t stretch-backports openjdk-11-jdk-headless + - update-java-alternatives --set java-1.11.0-openjdk-amd64 + - export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 - cat config/errorprone.gradle >> app/build.gradle - ./gradlew -Dorg.gradle.dependency.verification=lenient assembleDebug From 83b7d7ff6761b2059da2c21924c00ac5a965c8ba Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 19 Jan 2021 09:06:05 +0100 Subject: [PATCH 4/4] bump all test dependencies Hopefully this will give some stability in the Robolectric tests. --- app/build.gradle | 16 +++--- gradle/verification-metadata.xml | 88 +++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ee8aed5dd..26d2a0a17 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -169,19 +169,19 @@ dependencies { fullImplementation 'org.jmdns:jmdns:3.5.5' fullImplementation 'org.nanohttpd:nanohttpd:2.3.1' - testImplementation 'androidx.test:core:1.2.0' - testImplementation 'junit:junit:4.13' + testImplementation 'androidx.test:core:1.3.0' + testImplementation 'junit:junit:4.13.1' testImplementation 'org.robolectric:robolectric:4.3' testImplementation 'org.mockito:mockito-core:3.3.3' testImplementation 'org.hamcrest:hamcrest:2.2' testImplementation 'org.bouncycastle:bcprov-jdk15on:1.65' - androidTestImplementation 'androidx.test:core:1.2.0' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test:rules:1.2.0' - androidTestImplementation 'androidx.test:monitor:1.2.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + androidTestImplementation 'androidx.test:core:1.3.0' + androidTestImplementation 'androidx.test:runner:1.3.0' + androidTestImplementation 'androidx.test:rules:1.3.0' + androidTestImplementation 'androidx.test:monitor:1.3.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' } diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index fddac78f6..a0a56000a 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -40,12 +40,16 @@ - + + + + + @@ -87,7 +91,10 @@ - + + + + @@ -464,6 +471,11 @@ + + + + + @@ -472,6 +484,11 @@ + + + + + @@ -480,6 +497,11 @@ + + + + + @@ -488,6 +510,11 @@ + + + + + @@ -496,6 +523,11 @@ + + + + + @@ -504,6 +536,11 @@ + + + + + @@ -512,6 +549,11 @@ + + + + + @@ -594,6 +636,7 @@ + @@ -610,6 +653,7 @@ + @@ -914,6 +958,7 @@ + @@ -922,6 +967,7 @@ + @@ -995,6 +1041,7 @@ + @@ -1011,6 +1058,7 @@ + @@ -1043,6 +1091,7 @@ + @@ -1051,6 +1100,7 @@ + @@ -1101,6 +1151,7 @@ + @@ -1276,6 +1327,7 @@ + @@ -1305,6 +1357,7 @@ + @@ -1342,6 +1395,7 @@ + @@ -1350,6 +1404,7 @@ + @@ -1358,6 +1413,7 @@ + @@ -1366,6 +1422,7 @@ + @@ -1374,6 +1431,7 @@ + @@ -1382,6 +1440,7 @@ + @@ -1458,6 +1517,7 @@ + @@ -1466,6 +1526,7 @@ + @@ -1482,6 +1543,7 @@ + @@ -1498,6 +1560,7 @@ + @@ -1514,6 +1577,7 @@ + @@ -1538,6 +1602,7 @@ + @@ -1554,6 +1619,7 @@ + @@ -1562,6 +1628,7 @@ + @@ -1578,6 +1645,7 @@ + @@ -1591,6 +1659,7 @@ + @@ -1599,12 +1668,18 @@ + + + + + + @@ -1849,6 +1924,7 @@ + @@ -1946,6 +2022,7 @@ + @@ -2259,6 +2336,7 @@ + @@ -2362,6 +2440,7 @@ + @@ -2370,6 +2449,7 @@ + @@ -2378,6 +2458,7 @@ + @@ -2386,6 +2467,7 @@ + @@ -2399,6 +2481,7 @@ + @@ -2561,6 +2644,7 @@ +