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
3
.github/workflows/nightly.yml
vendored
3
.github/workflows/nightly.yml
vendored
@ -13,7 +13,6 @@ env:
|
|||||||
CI_GRADLE_ARG_PROPERTIES: >
|
CI_GRADLE_ARG_PROPERTIES: >
|
||||||
-Porg.gradle.jvmargs=-Xmx4g
|
-Porg.gradle.jvmargs=-Xmx4g
|
||||||
-Porg.gradle.parallel=false
|
-Porg.gradle.parallel=false
|
||||||
-PallWarningsAsErrors=false
|
|
||||||
jobs:
|
jobs:
|
||||||
# Build Android Tests [Matrix SDK]
|
# Build Android Tests [Matrix SDK]
|
||||||
build-android-test-matrix-sdk:
|
build-android-test-matrix-sdk:
|
||||||
@ -298,7 +297,7 @@ jobs:
|
|||||||
touch emulator.log
|
touch emulator.log
|
||||||
chmod 777 emulator.log
|
chmod 777 emulator.log
|
||||||
adb logcat >> 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
|
- name: Upload Test Report Log
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
- name: Run unit tests
|
- 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
|
- name: Format unit test results
|
||||||
if: always()
|
if: always()
|
||||||
run: python3 ./tools/ci/render_test_output.py unit ./**/build/test-results/**/*.xml
|
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 {
|
fun createAccount(userNamePrefix: String, testParams: SessionTestParams): Session {
|
||||||
|
@ -105,16 +105,9 @@ internal class TestMatrix constructor(context: Context, matrixConfiguration: Mat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getInstance(context: Context): TestMatrix {
|
fun getInstance(): TestMatrix {
|
||||||
if (isInit.compareAndSet(false, true)) {
|
if (isInit.compareAndSet(false, false)) {
|
||||||
val appContext = context.applicationContext
|
throw IllegalStateException("Matrix is not initialized properly. You should call TestMatrix.initialize first")
|
||||||
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.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return instance
|
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.Failure
|
||||||
import org.matrix.android.sdk.api.failure.MatrixError
|
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.GlobalErrorReceiver
|
||||||
import org.matrix.android.sdk.internal.network.executeRequest
|
import org.matrix.android.sdk.internal.network.executeRequest
|
||||||
import org.matrix.android.sdk.internal.session.cleanup.CleanupSession
|
import org.matrix.android.sdk.internal.session.cleanup.CleanupSession
|
||||||
@ -65,7 +66,13 @@ internal class DefaultSignOutTask @Inject constructor(
|
|||||||
|
|
||||||
// Logout from identity server if any
|
// Logout from identity server if any
|
||||||
runCatching { identityDisconnectTask.execute(Unit) }
|
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...")
|
Timber.d("SignOut: cleanup session...")
|
||||||
cleanupSession.cleanup()
|
cleanupSession.cleanup()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user