From e57638a49c759d36d25b92f26633df5bdfb0d2b3 Mon Sep 17 00:00:00 2001 From: "Tran M. Cuong" Date: Sun, 23 Jun 2024 05:05:44 +0700 Subject: [PATCH] Fix Migrator test and also add the test to build script (#896) * Fix MigratorTest after update to Kotlin 2.0.0 * add main module's test to build script --- .github/workflows/build_pull_request.yml | 2 +- .github/workflows/build_push.yml | 2 +- app/src/test/java/mihon/core/migration/MigratorTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index 2a031c279..334ce464a 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -38,4 +38,4 @@ jobs: uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Build app and run unit tests - run: ./gradlew detekt assembleStandardRelease testReleaseUnitTest + run: ./gradlew detekt assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index e85411cd2..47e6fe275 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -36,7 +36,7 @@ jobs: uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Build app and run unit tests - run: ./gradlew detekt assembleStandardRelease testReleaseUnitTest + run: ./gradlew detekt assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest # Sign APK and create release for tags diff --git a/app/src/test/java/mihon/core/migration/MigratorTest.kt b/app/src/test/java/mihon/core/migration/MigratorTest.kt index 47c4bc7c2..a805b5630 100644 --- a/app/src/test/java/mihon/core/migration/MigratorTest.kt +++ b/app/src/test/java/mihon/core/migration/MigratorTest.kt @@ -29,7 +29,7 @@ class MigratorTest { fun initilize() { migrationContext = MigrationContext(false) migrationJobFactory = spyk(MigrationJobFactory(migrationContext, CoroutineScope(Dispatchers.Main + Job()))) - migrationCompletedListener = spyk<() -> Unit>({}) + migrationCompletedListener = spyk(block = {}) migrationStrategyFactory = spyk(MigrationStrategyFactory(migrationJobFactory, migrationCompletedListener)) }