From a8eeae65c4fc131bef6a82d9e442e4a51df3670b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 7 Oct 2024 17:18:53 +0200 Subject: [PATCH 1/3] Ensure the CI compile and execute all the unit tests. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 778a173e19..cdb81ff8d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,7 +57,7 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - name: ⚙️ Check coverage for debug variant (includes unit & screenshot tests) - run: ./gradlew :tests:uitests:verifyPaparazziDebug :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyAll $CI_GRADLE_ARG_PROPERTIES + run: ./gradlew testDebugUnitTest :tests:uitests:verifyPaparazziDebug :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyAll $CI_GRADLE_ARG_PROPERTIES - name: 🚫 Upload kover failed coverage reports if: failure() From ab730f49384b4283f97158a17dffca765710024d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 7 Oct 2024 16:58:08 +0200 Subject: [PATCH 2/3] Fix compilation issue in RustMatrixClientFactoryTest... --- .../libraries/matrix/impl/RustMatrixClientFactoryTest.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactoryTest.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactoryTest.kt index b408574e92..f42bc30e0e 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactoryTest.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactoryTest.kt @@ -10,7 +10,6 @@ package io.element.android.libraries.matrix.impl import com.google.common.truth.Truth.assertThat import io.element.android.libraries.featureflag.test.FakeFeatureFlagService import io.element.android.libraries.matrix.api.core.SessionId -import io.element.android.libraries.matrix.impl.analytics.UtdTracker import io.element.android.libraries.matrix.impl.auth.FakeProxyProvider import io.element.android.libraries.matrix.impl.auth.FakeUserCertificatesProvider import io.element.android.libraries.matrix.impl.room.FakeTimelineEventTypeFilterFactory @@ -50,7 +49,7 @@ fun TestScope.createRustMatrixClientFactory( userCertificatesProvider = FakeUserCertificatesProvider(), proxyProvider = FakeProxyProvider(), clock = FakeSystemClock(), - utdTracker = UtdTracker(FakeAnalyticsService()), + analyticsService = FakeAnalyticsService(), featureFlagService = FakeFeatureFlagService(), timelineEventTypeFilterFactory = FakeTimelineEventTypeFilterFactory(), clientBuilderProvider = FakeClientBuilderProvider(), From fa4caf35610fc7f6ee2f9b19725ff71014dbcfb2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 7 Oct 2024 17:31:55 +0200 Subject: [PATCH 3/3] ... and fix the test. --- .../matrix/impl/fixtures/fakes/FakeRustClientBuilder.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeRustClientBuilder.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeRustClientBuilder.kt index 5f073b147c..abf94edcdd 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeRustClientBuilder.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeRustClientBuilder.kt @@ -18,6 +18,7 @@ import org.matrix.rustcomponents.sdk.RequestConfig import org.matrix.rustcomponents.sdk.SlidingSyncVersionBuilder import uniffi.matrix_sdk.BackupDownloadStrategy import uniffi.matrix_sdk_crypto.CollectStrategy +import uniffi.matrix_sdk_crypto.TrustRequirement class FakeRustClientBuilder : ClientBuilder(NoPointer) { override fun addRootCertificates(certificates: List) = this @@ -26,6 +27,7 @@ class FakeRustClientBuilder : ClientBuilder(NoPointer) { override fun backupDownloadStrategy(backupDownloadStrategy: BackupDownloadStrategy) = this override fun disableAutomaticTokenRefresh() = this override fun disableBuiltInRootCertificates() = this + override fun roomDecryptionTrustRequirement(trustRequirement: TrustRequirement) = this override fun disableSslVerification() = this override fun enableCrossProcessRefreshLock(processId: String, sessionDelegate: ClientSessionDelegate) = this override fun homeserverUrl(url: String) = this