mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Merge pull request #5453 from vector-im/michaelk/cleanups_for_tests
Remove deprecated warning in TestMatrix, and reduce severity of identity server error
This commit is contained in:
commit
48cf2adcf5
5 changed files with 14 additions and 15 deletions
3
.github/workflows/nightly.yml
vendored
3
.github/workflows/nightly.yml
vendored
|
@ -13,7 +13,6 @@ env:
|
|||
CI_GRADLE_ARG_PROPERTIES: >
|
||||
-Porg.gradle.jvmargs=-Xmx4g
|
||||
-Porg.gradle.parallel=false
|
||||
-PallWarningsAsErrors=false
|
||||
jobs:
|
||||
# Build Android Tests [Matrix SDK]
|
||||
build-android-test-matrix-sdk:
|
||||
|
@ -298,7 +297,7 @@ jobs:
|
|||
touch emulator.log
|
||||
chmod 777 emulator.log
|
||||
adb logcat >> emulator.log &
|
||||
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || (adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1 )
|
||||
./gradlew $CI_GRADLE_ARG_PROPERTIES connectedGplayDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || (adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1 )
|
||||
- name: Upload Test Report Log
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
|
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -30,7 +30,7 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Run unit tests
|
||||
run: ./gradlew clean test $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false --stacktrace
|
||||
run: ./gradlew clean test $CI_GRADLE_ARG_PROPERTIES --stacktrace
|
||||
- name: Format unit test results
|
||||
if: always()
|
||||
run: python3 ./tools/ci/render_test_output.py unit ./**/build/test-results/**/*.xml
|
||||
|
|
|
@ -71,7 +71,7 @@ class CommonTestHelper(context: Context) {
|
|||
)
|
||||
)
|
||||
}
|
||||
matrix = TestMatrix.getInstance(context)
|
||||
matrix = TestMatrix.getInstance()
|
||||
}
|
||||
|
||||
fun createAccount(userNamePrefix: String, testParams: SessionTestParams): Session {
|
||||
|
|
|
@ -105,16 +105,9 @@ internal class TestMatrix constructor(context: Context, matrixConfiguration: Mat
|
|||
}
|
||||
}
|
||||
|
||||
fun getInstance(context: Context): TestMatrix {
|
||||
if (isInit.compareAndSet(false, true)) {
|
||||
val appContext = context.applicationContext
|
||||
if (appContext is MatrixConfiguration.Provider) {
|
||||
val matrixConfiguration = (appContext as MatrixConfiguration.Provider).providesMatrixConfiguration()
|
||||
instance = TestMatrix(appContext, matrixConfiguration)
|
||||
} else {
|
||||
throw IllegalStateException("Matrix is not initialized properly." +
|
||||
" You should call Matrix.initialize or let your application implements MatrixConfiguration.Provider.")
|
||||
}
|
||||
fun getInstance(): TestMatrix {
|
||||
if (isInit.compareAndSet(false, false)) {
|
||||
throw IllegalStateException("Matrix is not initialized properly. You should call TestMatrix.initialize first")
|
||||
}
|
||||
return instance
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.matrix.android.sdk.internal.session.signout
|
|||
|
||||
import org.matrix.android.sdk.api.failure.Failure
|
||||
import org.matrix.android.sdk.api.failure.MatrixError
|
||||
import org.matrix.android.sdk.api.session.identity.IdentityServiceError
|
||||
import org.matrix.android.sdk.internal.network.GlobalErrorReceiver
|
||||
import org.matrix.android.sdk.internal.network.executeRequest
|
||||
import org.matrix.android.sdk.internal.session.cleanup.CleanupSession
|
||||
|
@ -65,7 +66,13 @@ internal class DefaultSignOutTask @Inject constructor(
|
|||
|
||||
// Logout from identity server if any
|
||||
runCatching { identityDisconnectTask.execute(Unit) }
|
||||
.onFailure { Timber.w(it, "Unable to disconnect identity server") }
|
||||
.onFailure {
|
||||
if (it is IdentityServiceError.NoIdentityServerConfigured) {
|
||||
Timber.i("No identity server configured to disconnect")
|
||||
} else {
|
||||
Timber.w(it, "Unable to disconnect identity server")
|
||||
}
|
||||
}
|
||||
|
||||
Timber.d("SignOut: cleanup session...")
|
||||
cleanupSession.cleanup()
|
||||
|
|
Loading…
Reference in a new issue