From a75ef34cf93c809931752f986f7b7ef95d51480b Mon Sep 17 00:00:00 2001 From: David Allison <62114487+david-allison@users.noreply.github.com> Date: Thu, 18 Apr 2024 02:15:27 +0100 Subject: [PATCH] Revert "Dependency updates 20240417 (#16193)" This reverts commit 39b0bc6d4e1f9ecd65ac7a60cd38586a18fb662a. Tests no longer run Fixes 16197 --- .github/workflows/lint.yml | 12 +++++++----- .github/workflows/tests_emulator.yml | 4 +--- .github/workflows/tests_unit.yml | 12 +++++++----- .../ichi2/anki/RobolectricTestAnnotationTest.kt | 11 ----------- gradle/libs.versions.toml | 14 +++++++------- tools/localization/package.json | 2 +- 6 files changed, 23 insertions(+), 32 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ccf45143492a..e0e3ac3c7d10 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -62,11 +62,13 @@ jobs: command: ./gradlew :AnkiDroid:compilePlayDebugJavaWithJavac compileLint lint-rules:compileTestJava --daemon - name: Run Lint Debug - # "lint" is run under the 'Amazon' flavor, so slow in CI - # "lintPlayRelease" doesn't test androidTest - # "lintPlayDebug" doesn't test the API - # "lintVitalFullRelease": if `main` resources are only used in `androidTest` (#15741) - run: ./gradlew lintPlayDebug :api:lintDebug ktLintCheck lintVitalFullRelease lint-rules:test --daemon + uses: gradle/gradle-build-action@v3 + with: + # "lint" is run under the 'Amazon' flavor, so slow in CI + # "lintPlayRelease" doesn't test androidTest + # "lintPlayDebug" doesn't test the API + # "lintVitalFullRelease": if `main` resources are only used in `androidTest` (#15741) + arguments: lintPlayDebug :api:lintDebug ktLintCheck lintVitalFullRelease lint-rules:test --daemon # Handled under the pre-commit hook: ./gradlew installGitHook diff --git a/.github/workflows/tests_emulator.yml b/.github/workflows/tests_emulator.yml index b13a8287c3bb..c9151db79b40 100644 --- a/.github/workflows/tests_emulator.yml +++ b/.github/workflows/tests_emulator.yml @@ -23,8 +23,6 @@ jobs: name: Android Emulator Test runs-on: ubuntu-latest timeout-minutes: 75 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: @@ -182,6 +180,6 @@ jobs: name: ${{ matrix.api-level }}-${{ matrix.arch }}-${{matrix.target}}-${{matrix.first-boot-delay}}-${{matrix.iteration}}-adb_video path: video.webm - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v3 with: verbose: true diff --git a/.github/workflows/tests_unit.yml b/.github/workflows/tests_unit.yml index 7b787cb684fd..72ac34e1a9f1 100644 --- a/.github/workflows/tests_unit.yml +++ b/.github/workflows/tests_unit.yml @@ -22,8 +22,6 @@ jobs: unit: name: JUnit Tests (${{ matrix.name }}) timeout-minutes: 40 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: @@ -89,7 +87,9 @@ jobs: command: ./gradlew robolectricSdkDownload --daemon - name: Run Unit Tests - run: ./gradlew jacocoUnitTestReport --daemon + uses: gradle/gradle-build-action@v3 + with: + arguments: jacocoUnitTestReport --daemon - name: Store Logcat as Artifact if: failure() @@ -109,8 +109,10 @@ jobs: - name: Stop Gradle if: contains(matrix.os, 'windows') - run: ./gradlew --stop + uses: gradle/gradle-build-action@v3 + with: + arguments: --stop - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v3 with: verbose: true diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTestAnnotationTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTestAnnotationTest.kt index 59203643304a..0aea043ef753 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTestAnnotationTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/RobolectricTestAnnotationTest.kt @@ -21,17 +21,6 @@ import org.junit.Test import kotlin.test.assertFailsWith // explicitly missing @RunWith(AndroidJUnit4.class) -// -// NOTE - this earned us a friendly warning from robolectric upstream when investigated, I quote: -// ---- -// a word of caution: invoking Robolectric APIs outside of the context of a Robolectric ClassLoader -// is very unlikely to work :) Robolectric APIs often invoke underlying Android framework APIs, -// and those will not be available outside of Robolectric. -// ---- -// -// ...so, this class may not work in the future as no test runner means no classloader, means -// referencing `RobolectricTest` may try to reference missing android APIs. -// See https://github.com/robolectric/robolectric/issues/8957#issuecomment-2032413796 class RobolectricTestAnnotationTest : RobolectricTest() { @Test fun readableErrorIfNotAnnotated() { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 70b9a59cb562..3c3f29f6e98e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] acra = '5.11.3' amazonappstorepublisher = "0.1.0" -androidGradlePlugin = "8.3.2" +androidGradlePlugin = "8.2.2" androidxActivityKtx = "1.8.2" androidxAnnotation = "1.7.1" androidxAppCompat = "1.7.0-alpha03" @@ -29,7 +29,7 @@ colorpicker = "1.2.0" commonsCollections4 = "4.4" commonsCompress = "1.26.1" commonsExec = "1.4.0" -commonsIo = "2.16.1" +commonsIo = "2.15.1" coroutines = '1.8.0' core = "3.3.0" desugar-jdk-libs-nio = "2.0.4" @@ -47,21 +47,21 @@ junitJupiter = "5.10.2" junitJupiterParams = "5.10.2" junitVintageEngine = "5.10.2" kotlin = '1.9.23' -kotlinReflect = "1.9.23" +kotlinReflect = "1.9.22" kotlinTest = "1.9.23" kotlinxSerializationJson = "1.6.3" ktlint = "11.6.1" leakcanaryAndroid = "2.13" -lint = '31.3.2' +lint = '31.3.1' material = "1.11.0" materialTapTargetPrompt = "3.3.2" mockitoInline = "5.2.0" -mockitoKotlin = "5.3.1" +mockitoKotlin = "5.2.1" mockk = "1.13.10" nanohttpd = "2.3.1" okhttp = "4.12.0" -protobufKotlinLite = "4.26.1" -robolectric = "4.12.1" +protobufKotlinLite = "3.25.3" +robolectric = "4.11.1" searchpreference = "2.5.1" seismic = "1.0.3" sharedPreferencesMock = "1.2.4" diff --git a/tools/localization/package.json b/tools/localization/package.json index bb8c8516c14e..2191d431d441 100644 --- a/tools/localization/package.json +++ b/tools/localization/package.json @@ -31,7 +31,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.2.1", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", "jest": "^29.7.0", "prettier": "^3.2.5",