Skip to content
Snippets Groups Projects
Commit 55cc7362 authored by Benoit Marty's avatar Benoit Marty
Browse files

Merge branch 'release/1.3.18' into develop

parents 787bb776 2dac1ce0
No related branches found
No related tags found
No related merge requests found
Showing
with 185 additions and 24 deletions
Please also refer to the Changelog of Element Android: https://github.com/vector-im/element-android/blob/main/CHANGES.md Please also refer to the Changelog of Element Android: https://github.com/vector-im/element-android/blob/main/CHANGES.md
Changes in Matrix-SDK 1.3.18 (2022-02-04)
===================================================
**Warning**: This release may trigger an initial sync.
Imported from Element 1.3.18. (https://github.com/vector-im/element-android/releases/tag/v1.3.18)
Bugfixes 🐛
----------
- Avoid deleting root event of CurrentState on gappy sync. In order to restore lost Events an initial sync may be triggered. ([#5137](https://github.com/vector-im/element-android/issues/5137))
SDK API changes ⚠️
------------------
- `StateService.sendStateEvent()` now takes a non-nullable String for the parameter `stateKey`. If null was used, just now use an empty string. ([#4895](https://github.com/vector-im/element-android/issues/4895))
- 429 are not automatically retried anymore in case of too long retry delay ([#4995](https://github.com/vector-im/element-android/issues/4995))
Changes in Matrix-SDK 1.3.14 (2022-01-12) Changes in Matrix-SDK 1.3.14 (2022-01-12)
=================================================== ===================================================
......
...@@ -29,6 +29,7 @@ def vanniktechEmoji = "0.8.0" ...@@ -29,6 +29,7 @@ def vanniktechEmoji = "0.8.0"
def mockk = "1.12.1" def mockk = "1.12.1"
def espresso = "3.4.0" def espresso = "3.4.0"
def androidxTest = "1.4.0" def androidxTest = "1.4.0"
def androidxOrchestrator = "1.4.1"
ext.libs = [ ext.libs = [
...@@ -41,7 +42,6 @@ ext.libs = [ ...@@ -41,7 +42,6 @@ ext.libs = [
jetbrains : [ jetbrains : [
'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutines", 'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutines",
'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutines", 'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutines",
'coroutinesRx2' : "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlinCoroutines",
'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines" 'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines"
], ],
androidx : [ androidx : [
...@@ -63,7 +63,7 @@ ext.libs = [ ...@@ -63,7 +63,7 @@ ext.libs = [
'pagingRuntimeKtx' : "androidx.paging:paging-runtime-ktx:2.1.2", 'pagingRuntimeKtx' : "androidx.paging:paging-runtime-ktx:2.1.2",
'coreTesting' : "androidx.arch.core:core-testing:2.1.0", 'coreTesting' : "androidx.arch.core:core-testing:2.1.0",
'testCore' : "androidx.test:core:$androidxTest", 'testCore' : "androidx.test:core:$androidxTest",
'orchestrator' : "androidx.test:orchestrator:$androidxTest", 'orchestrator' : "androidx.test:orchestrator:$androidxOrchestrator",
'testRunner' : "androidx.test:runner:$androidxTest", 'testRunner' : "androidx.test:runner:$androidxTest",
'testRules' : "androidx.test:rules:$androidxTest", 'testRules' : "androidx.test:rules:$androidxTest",
'espressoCore' : "androidx.test.espresso:espresso-core:$espresso", 'espressoCore' : "androidx.test.espresso:espresso-core:$espresso",
...@@ -71,6 +71,7 @@ ext.libs = [ ...@@ -71,6 +71,7 @@ ext.libs = [
'espressoIntents' : "androidx.test.espresso:espresso-intents:$espresso" 'espressoIntents' : "androidx.test.espresso:espresso-intents:$espresso"
], ],
google : [ google : [
// TODO There is 1.6.0?
'material' : "com.google.android.material:material:1.4.0" 'material' : "com.google.android.material:material:1.4.0"
], ],
dagger : [ dagger : [
...@@ -86,8 +87,7 @@ ext.libs = [ ...@@ -86,8 +87,7 @@ ext.libs = [
'retrofitMoshi' : "com.squareup.retrofit2:converter-moshi:$retrofit" 'retrofitMoshi' : "com.squareup.retrofit2:converter-moshi:$retrofit"
], ],
rx : [ rx : [
'rxKotlin' : "io.reactivex.rxjava2:rxkotlin:2.4.0", 'rxKotlin' : "io.reactivex.rxjava2:rxkotlin:2.4.0"
'rxAndroid' : "io.reactivex.rxjava2:rxandroid:2.1.1"
], ],
arrow : [ arrow : [
'core' : "io.arrow-kt:arrow-core:$arrow", 'core' : "io.arrow-kt:arrow-core:$arrow",
......
...@@ -4,7 +4,6 @@ ext.groups = [ ...@@ -4,7 +4,6 @@ ext.groups = [
], ],
group: [ group: [
'com.github.Armen101', 'com.github.Armen101',
'com.github.BillCarsonFr',
'com.github.chrisbanes', 'com.github.chrisbanes',
'com.github.hyuwah', 'com.github.hyuwah',
'com.github.jetradarmobile', 'com.github.jetradarmobile',
...@@ -84,6 +83,7 @@ ext.groups = [ ...@@ -84,6 +83,7 @@ ext.groups = [
'com.jakewharton.android.repackaged', 'com.jakewharton.android.repackaged',
'com.jakewharton.timber', 'com.jakewharton.timber',
'com.linkedin.dexmaker', 'com.linkedin.dexmaker',
'com.mapbox.mapboxsdk',
'com.nulab-inc', 'com.nulab-inc',
'com.otaliastudios.opengl', 'com.otaliastudios.opengl',
'com.parse.bolts', 'com.parse.bolts',
...@@ -154,11 +154,13 @@ ext.groups = [ ...@@ -154,11 +154,13 @@ ext.groups = [
'org.jetbrains.intellij.deps', 'org.jetbrains.intellij.deps',
'org.jetbrains.kotlin', 'org.jetbrains.kotlin',
'org.jetbrains.kotlinx', 'org.jetbrains.kotlinx',
'org.json',
'org.jsoup', 'org.jsoup',
'org.junit', 'org.junit',
'org.junit.jupiter', 'org.junit.jupiter',
'org.junit.platform', 'org.junit.platform',
'org.jvnet.staxex', 'org.jvnet.staxex',
'org.maplibre.gl',
'org.matrix.android', 'org.matrix.android',
'org.mockito', 'org.mockito',
'org.mongodb', 'org.mongodb',
......
...@@ -26,7 +26,7 @@ vector.httpLogLevel=NONE ...@@ -26,7 +26,7 @@ vector.httpLogLevel=NONE
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin # Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
GROUP=org.matrix.android GROUP=org.matrix.android
POM_ARTIFACT_ID=matrix-android-sdk2 POM_ARTIFACT_ID=matrix-android-sdk2
VERSION_NAME=1.3.14 VERSION_NAME=1.3.18
POM_PACKAGING=aar POM_PACKAGING=aar
......
...@@ -48,7 +48,7 @@ android { ...@@ -48,7 +48,7 @@ android {
testOptions { testOptions {
// Comment to run on Android 12 // Comment to run on Android 12
execution 'ANDROIDX_TEST_ORCHESTRATOR' // execution 'ANDROIDX_TEST_ORCHESTRATOR'
} }
buildTypes { buildTypes {
...@@ -67,6 +67,7 @@ android { ...@@ -67,6 +67,7 @@ android {
adbOptions { adbOptions {
installOptions "-g" installOptions "-g"
// timeOutInMs 350 * 1000
} }
compileOptions { compileOptions {
...@@ -118,6 +119,11 @@ dependencies { ...@@ -118,6 +119,11 @@ dependencies {
implementation libs.squareup.retrofit implementation libs.squareup.retrofit
implementation libs.squareup.retrofitMoshi implementation libs.squareup.retrofitMoshi
// When version of okhttp is updated (current is 4.9.3), consider removing the workaround
// to force usage of Protocol.HTTP_1_1. Check the status of:
// - https://github.com/square/okhttp/issues/3278
// - https://github.com/square/okhttp/issues/4455
// - https://github.com/square/okhttp/issues/3146
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.3")) implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.3"))
implementation 'com.squareup.okhttp3:okhttp' implementation 'com.squareup.okhttp3:okhttp'
implementation 'com.squareup.okhttp3:logging-interceptor' implementation 'com.squareup.okhttp3:logging-interceptor'
...@@ -161,7 +167,7 @@ dependencies { ...@@ -161,7 +167,7 @@ dependencies {
implementation libs.apache.commonsImaging implementation libs.apache.commonsImaging
// Phone number https://github.com/google/libphonenumber // Phone number https://github.com/google/libphonenumber
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.40' implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.42'
testImplementation libs.tests.junit testImplementation libs.tests.junit
testImplementation 'org.robolectric:robolectric:4.7.3' testImplementation 'org.robolectric:robolectric:4.7.3'
......
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
package org.matrix.android.sdk.account package org.matrix.android.sdk.account
import androidx.test.filters.LargeTest
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.JUnit4 import org.junit.runners.JUnit4
...@@ -29,6 +31,7 @@ import org.matrix.android.sdk.common.TestConstants ...@@ -29,6 +31,7 @@ import org.matrix.android.sdk.common.TestConstants
@RunWith(JUnit4::class) @RunWith(JUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest
class AccountCreationTest : InstrumentedTest { class AccountCreationTest : InstrumentedTest {
private val commonTestHelper = CommonTestHelper(context()) private val commonTestHelper = CommonTestHelper(context())
...@@ -42,6 +45,7 @@ class AccountCreationTest : InstrumentedTest { ...@@ -42,6 +45,7 @@ class AccountCreationTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun createAccountAndLoginAgainTest() { fun createAccountAndLoginAgainTest() {
val session = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(withInitialSync = true)) val session = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(withInitialSync = true))
......
...@@ -18,6 +18,7 @@ package org.matrix.android.sdk.account ...@@ -18,6 +18,7 @@ package org.matrix.android.sdk.account
import org.amshove.kluent.shouldBeTrue import org.amshove.kluent.shouldBeTrue
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.JUnit4 import org.junit.runners.JUnit4
...@@ -30,6 +31,7 @@ import org.matrix.android.sdk.common.TestConstants ...@@ -30,6 +31,7 @@ import org.matrix.android.sdk.common.TestConstants
@RunWith(JUnit4::class) @RunWith(JUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@Ignore("This test will be ignored until it is fixed")
class ChangePasswordTest : InstrumentedTest { class ChangePasswordTest : InstrumentedTest {
private val commonTestHelper = CommonTestHelper(context()) private val commonTestHelper = CommonTestHelper(context())
......
/*
* Copyright 2022 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.matrix.android.sdk.common
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
/**
* Retry test rule used to retry test that failed.
* Retry failed test 3 times
*/
class RetryTestRule(val retryCount: Int = 3) : TestRule {
override fun apply(base: Statement, description: Description): Statement {
return statement(base)
}
private fun statement(base: Statement): Statement {
return object : Statement() {
@Throws(Throwable::class)
override fun evaluate() {
var caughtThrowable: Throwable? = null
// implement retry logic here
for (i in 0 until retryCount) {
try {
base.evaluate()
return
} catch (t: Throwable) {
caughtThrowable = t
}
}
throw caughtThrowable!!
}
}
}
}
...@@ -22,8 +22,8 @@ object TestConstants { ...@@ -22,8 +22,8 @@ object TestConstants {
const val TESTS_HOME_SERVER_URL = "http://10.0.2.2:8080" const val TESTS_HOME_SERVER_URL = "http://10.0.2.2:8080"
// Time out to use when waiting for server response. 20s // Time out to use when waiting for server response.
private const val AWAIT_TIME_OUT_MILLIS = 20_000 private const val AWAIT_TIME_OUT_MILLIS = 30_000
// Time out to use when waiting for server response, when the debugger is connected. 10 minutes // Time out to use when waiting for server response, when the debugger is connected. 10 minutes
private const val AWAIT_TIME_OUT_WITH_DEBUGGER_MILLIS = 10 * 60_000 private const val AWAIT_TIME_OUT_WITH_DEBUGGER_MILLIS = 10 * 60_000
......
...@@ -21,6 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 ...@@ -21,6 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull import org.junit.Assert.assertNotNull
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -40,6 +41,7 @@ class PreShareKeysTest : InstrumentedTest { ...@@ -40,6 +41,7 @@ class PreShareKeysTest : InstrumentedTest {
private val cryptoTestHelper = CryptoTestHelper(testHelper) private val cryptoTestHelper = CryptoTestHelper(testHelper)
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun ensure_outbound_session_happy_path() { fun ensure_outbound_session_happy_path() {
val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true) val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true)
val e2eRoomID = testData.roomId val e2eRoomID = testData.roomId
...@@ -97,7 +99,6 @@ class PreShareKeysTest : InstrumentedTest { ...@@ -97,7 +99,6 @@ class PreShareKeysTest : InstrumentedTest {
} }
} }
testHelper.signOutAndClose(aliceSession) testData.cleanUp(testHelper)
testHelper.signOutAndClose(bobSession)
} }
} }
...@@ -21,6 +21,7 @@ import org.amshove.kluent.shouldBe ...@@ -21,6 +21,7 @@ import org.amshove.kluent.shouldBe
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -84,6 +85,7 @@ class UnwedgingTest : InstrumentedTest { ...@@ -84,6 +85,7 @@ class UnwedgingTest : InstrumentedTest {
* -> This is automatically fixed after SDKs restarted the olm session * -> This is automatically fixed after SDKs restarted the olm session
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testUnwedging() { fun testUnwedging() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.matrix.android.sdk.internal.crypto.crosssigning package org.matrix.android.sdk.internal.crypto.crosssigning
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull import org.junit.Assert.assertNotNull
...@@ -24,6 +25,7 @@ import org.junit.Assert.assertNull ...@@ -24,6 +25,7 @@ import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
import org.junit.Assert.fail import org.junit.Assert.fail
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -43,6 +45,7 @@ import kotlin.coroutines.resume ...@@ -43,6 +45,7 @@ import kotlin.coroutines.resume
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@LargeTest
class XSigningTest : InstrumentedTest { class XSigningTest : InstrumentedTest {
private val testHelper = CommonTestHelper(context()) private val testHelper = CommonTestHelper(context())
...@@ -124,11 +127,11 @@ class XSigningTest : InstrumentedTest { ...@@ -124,11 +127,11 @@ class XSigningTest : InstrumentedTest {
assertFalse("Bob keys from alice pov should not be trusted", bobKeysFromAlicePOV.isTrusted()) assertFalse("Bob keys from alice pov should not be trusted", bobKeysFromAlicePOV.isTrusted())
testHelper.signOutAndClose(aliceSession) cryptoTestData.cleanUp(testHelper)
testHelper.signOutAndClose(bobSession)
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_CrossSigningTestAliceTrustBobNewDevice() { fun test_CrossSigningTestAliceTrustBobNewDevice() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
......
...@@ -62,7 +62,7 @@ class EncryptionTest : InstrumentedTest { ...@@ -62,7 +62,7 @@ class EncryptionTest : InstrumentedTest {
// Send an encryption Event as a State Event // Send an encryption Event as a State Event
room.sendStateEvent( room.sendStateEvent(
eventType = EventType.STATE_ROOM_ENCRYPTION, eventType = EventType.STATE_ROOM_ENCRYPTION,
stateKey = null, stateKey = "",
body = EncryptionEventContent(algorithm = MXCRYPTO_ALGORITHM_MEGOLM).toContent() body = EncryptionEventContent(algorithm = MXCRYPTO_ALGORITHM_MEGOLM).toContent()
) )
} }
......
...@@ -18,12 +18,14 @@ package org.matrix.android.sdk.internal.crypto.gossiping ...@@ -18,12 +18,14 @@ package org.matrix.android.sdk.internal.crypto.gossiping
import android.util.Log import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import junit.framework.TestCase.assertEquals import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertNotNull import junit.framework.TestCase.assertNotNull
import junit.framework.TestCase.assertTrue import junit.framework.TestCase.assertTrue
import junit.framework.TestCase.fail import junit.framework.TestCase.fail
import org.junit.Assert import org.junit.Assert
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -59,11 +61,13 @@ import kotlin.coroutines.resume ...@@ -59,11 +61,13 @@ import kotlin.coroutines.resume
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest
class KeyShareTests : InstrumentedTest { class KeyShareTests : InstrumentedTest {
private val commonTestHelper = CommonTestHelper(context()) private val commonTestHelper = CommonTestHelper(context())
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_DoNotSelfShareIfNotTrusted() { fun test_DoNotSelfShareIfNotTrusted() {
val aliceSession = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
...@@ -195,6 +199,7 @@ class KeyShareTests : InstrumentedTest { ...@@ -195,6 +199,7 @@ class KeyShareTests : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_ShareSSSSSecret() { fun test_ShareSSSSSecret() {
val aliceSession1 = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession1 = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
...@@ -307,6 +312,7 @@ class KeyShareTests : InstrumentedTest { ...@@ -307,6 +312,7 @@ class KeyShareTests : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_ImproperKeyShareBug() { fun test_ImproperKeyShareBug() {
val aliceSession = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = commonTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
......
...@@ -18,8 +18,10 @@ package org.matrix.android.sdk.internal.crypto.gossiping ...@@ -18,8 +18,10 @@ package org.matrix.android.sdk.internal.crypto.gossiping
import android.util.Log import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import org.junit.Assert import org.junit.Assert
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -39,12 +41,14 @@ import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode ...@@ -39,12 +41,14 @@ import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest
class WithHeldTests : InstrumentedTest { class WithHeldTests : InstrumentedTest {
private val testHelper = CommonTestHelper(context()) private val testHelper = CommonTestHelper(context())
private val cryptoTestHelper = CryptoTestHelper(testHelper) private val cryptoTestHelper = CryptoTestHelper(testHelper)
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_WithHeldUnverifiedReason() { fun test_WithHeldUnverifiedReason() {
// ============================= // =============================
// ARRANGE // ARRANGE
...@@ -129,6 +133,7 @@ class WithHeldTests : InstrumentedTest { ...@@ -129,6 +133,7 @@ class WithHeldTests : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_WithHeldNoOlm() { fun test_WithHeldNoOlm() {
val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = testData.firstSession val aliceSession = testData.firstSession
...@@ -199,6 +204,7 @@ class WithHeldTests : InstrumentedTest { ...@@ -199,6 +204,7 @@ class WithHeldTests : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_WithHeldKeyRequest() { fun test_WithHeldKeyRequest() {
val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val testData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = testData.firstSession val aliceSession = testData.firstSession
......
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
package org.matrix.android.sdk.internal.crypto.keysbackup package org.matrix.android.sdk.internal.crypto.keysbackup
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -47,6 +49,7 @@ import java.util.concurrent.CountDownLatch ...@@ -47,6 +49,7 @@ import java.util.concurrent.CountDownLatch
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest
class KeysBackupTest : InstrumentedTest { class KeysBackupTest : InstrumentedTest {
private val testHelper = CommonTestHelper(context()) private val testHelper = CommonTestHelper(context())
...@@ -59,6 +62,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -59,6 +62,7 @@ class KeysBackupTest : InstrumentedTest {
* - Reset keys backup markers * - Reset keys backup markers
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun roomKeysTest_testBackupStore_ok() { fun roomKeysTest_testBackupStore_ok() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -157,6 +161,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -157,6 +161,7 @@ class KeysBackupTest : InstrumentedTest {
* - Check the backup completes * - Check the backup completes
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun backupAfterCreateKeysBackupVersionTest() { fun backupAfterCreateKeysBackupVersionTest() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -197,6 +202,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -197,6 +202,7 @@ class KeysBackupTest : InstrumentedTest {
* Check that backupAllGroupSessions() returns valid data * Check that backupAllGroupSessions() returns valid data
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun backupAllGroupSessionsTest() { fun backupAllGroupSessionsTest() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -241,6 +247,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -241,6 +247,7 @@ class KeysBackupTest : InstrumentedTest {
* - Compare the decrypted megolm key with the original one * - Compare the decrypted megolm key with the original one
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testEncryptAndDecryptKeysBackupData() { fun testEncryptAndDecryptKeysBackupData() {
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -282,6 +289,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -282,6 +289,7 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful * - Restore must be successful
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupTest() { fun restoreKeysBackupTest() {
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null) val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
...@@ -365,6 +373,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -365,6 +373,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now * - It must be trusted and must have with 2 signatures now
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionTest() { fun trustKeyBackupVersionTest() {
// - Do an e2e backup to the homeserver with a recovery key // - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device // - And log Alice on a new device
...@@ -424,6 +433,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -424,6 +433,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now * - It must be trusted and must have with 2 signatures now
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithRecoveryKeyTest() { fun trustKeyBackupVersionWithRecoveryKeyTest() {
// - Do an e2e backup to the homeserver with a recovery key // - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device // - And log Alice on a new device
...@@ -481,6 +491,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -481,6 +491,7 @@ class KeysBackupTest : InstrumentedTest {
* - The backup must still be untrusted and disabled * - The backup must still be untrusted and disabled
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithWrongRecoveryKeyTest() { fun trustKeyBackupVersionWithWrongRecoveryKeyTest() {
// - Do an e2e backup to the homeserver with a recovery key // - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device // - And log Alice on a new device
...@@ -522,6 +533,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -522,6 +533,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now * - It must be trusted and must have with 2 signatures now
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithPasswordTest() { fun trustKeyBackupVersionWithPasswordTest() {
val password = "Password" val password = "Password"
...@@ -581,6 +593,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -581,6 +593,7 @@ class KeysBackupTest : InstrumentedTest {
* - The backup must still be untrusted and disabled * - The backup must still be untrusted and disabled
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithWrongPasswordTest() { fun trustKeyBackupVersionWithWrongPasswordTest() {
val password = "Password" val password = "Password"
val badPassword = "Bad Password" val badPassword = "Bad Password"
...@@ -621,6 +634,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -621,6 +634,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail * - It must fail
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupWithAWrongRecoveryKeyTest() { fun restoreKeysBackupWithAWrongRecoveryKeyTest() {
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null) val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
...@@ -654,6 +668,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -654,6 +668,7 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful * - Restore must be successful
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testBackupWithPassword() { fun testBackupWithPassword() {
val password = "password" val password = "password"
...@@ -709,6 +724,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -709,6 +724,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail * - It must fail
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupWithAWrongPasswordTest() { fun restoreKeysBackupWithAWrongPasswordTest() {
val password = "password" val password = "password"
val wrongPassword = "passw0rd" val wrongPassword = "passw0rd"
...@@ -745,6 +761,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -745,6 +761,7 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful * - Restore must be successful
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testUseRecoveryKeyToRestoreAPasswordBasedKeysBackup() { fun testUseRecoveryKeyToRestoreAPasswordBasedKeysBackup() {
val password = "password" val password = "password"
...@@ -773,6 +790,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -773,6 +790,7 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail * - It must fail
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testUsePasswordToRestoreARecoveryKeyBasedKeysBackup() { fun testUsePasswordToRestoreARecoveryKeyBasedKeysBackup() {
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null) val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
...@@ -804,6 +822,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -804,6 +822,7 @@ class KeysBackupTest : InstrumentedTest {
* - Check the returned KeysVersionResult is trusted * - Check the returned KeysVersionResult is trusted
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testIsKeysBackupTrusted() { fun testIsKeysBackupTrusted() {
// - Create a backup version // - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -847,6 +866,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -847,6 +866,7 @@ class KeysBackupTest : InstrumentedTest {
* -> The new alice session must back up to the same version * -> The new alice session must back up to the same version
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testCheckAndStartKeysBackupWhenRestartingAMatrixSession() { fun testCheckAndStartKeysBackupWhenRestartingAMatrixSession() {
// - Create a backup version // - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
...@@ -978,6 +998,7 @@ class KeysBackupTest : InstrumentedTest { ...@@ -978,6 +998,7 @@ class KeysBackupTest : InstrumentedTest {
* -> It must success * -> It must success
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun testBackupAfterVerifyingADevice() { fun testBackupAfterVerifyingADevice() {
// - Create a backup version // - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
......
...@@ -22,6 +22,7 @@ import org.junit.Assert.assertEquals ...@@ -22,6 +22,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull import org.junit.Assert.assertNull
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -47,8 +48,6 @@ import org.matrix.android.sdk.internal.crypto.secrets.DefaultSharedSecretStorage ...@@ -47,8 +48,6 @@ import org.matrix.android.sdk.internal.crypto.secrets.DefaultSharedSecretStorage
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
class QuadSTests : InstrumentedTest { class QuadSTests : InstrumentedTest {
private val testHelper = CommonTestHelper(context())
private val emptyKeySigner = object : KeySigner { private val emptyKeySigner = object : KeySigner {
override fun sign(canonicalJson: String): Map<String, Map<String, String>>? { override fun sign(canonicalJson: String): Map<String, Map<String, String>>? {
return null return null
...@@ -57,6 +56,8 @@ class QuadSTests : InstrumentedTest { ...@@ -57,6 +56,8 @@ class QuadSTests : InstrumentedTest {
@Test @Test
fun test_Generate4SKey() { fun test_Generate4SKey() {
val testHelper = CommonTestHelper(context())
val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
val quadS = aliceSession.sharedSecretStorageService val quadS = aliceSession.sharedSecretStorageService
...@@ -108,6 +109,8 @@ class QuadSTests : InstrumentedTest { ...@@ -108,6 +109,8 @@ class QuadSTests : InstrumentedTest {
@Test @Test
fun test_StoreSecret() { fun test_StoreSecret() {
val testHelper = CommonTestHelper(context())
val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
val keyId = "My.Key" val keyId = "My.Key"
val info = generatedSecret(aliceSession, keyId, true) val info = generatedSecret(aliceSession, keyId, true)
...@@ -151,6 +154,8 @@ class QuadSTests : InstrumentedTest { ...@@ -151,6 +154,8 @@ class QuadSTests : InstrumentedTest {
@Test @Test
fun test_SetDefaultLocalEcho() { fun test_SetDefaultLocalEcho() {
val testHelper = CommonTestHelper(context())
val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
val quadS = aliceSession.sharedSecretStorageService val quadS = aliceSession.sharedSecretStorageService
...@@ -171,6 +176,8 @@ class QuadSTests : InstrumentedTest { ...@@ -171,6 +176,8 @@ class QuadSTests : InstrumentedTest {
@Test @Test
fun test_StoreSecretWithMultipleKey() { fun test_StoreSecretWithMultipleKey() {
val testHelper = CommonTestHelper(context())
val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
val keyId1 = "Key.1" val keyId1 = "Key.1"
val key1Info = generatedSecret(aliceSession, keyId1, true) val key1Info = generatedSecret(aliceSession, keyId1, true)
...@@ -217,7 +224,10 @@ class QuadSTests : InstrumentedTest { ...@@ -217,7 +224,10 @@ class QuadSTests : InstrumentedTest {
} }
@Test @Test
@Ignore("Test is working locally, not in GitHub actions")
fun test_GetSecretWithBadPassphrase() { fun test_GetSecretWithBadPassphrase() {
val testHelper = CommonTestHelper(context())
val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) val aliceSession = testHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true))
val keyId1 = "Key.1" val keyId1 = "Key.1"
val passphrase = "The good pass phrase" val passphrase = "The good pass phrase"
...@@ -264,6 +274,8 @@ class QuadSTests : InstrumentedTest { ...@@ -264,6 +274,8 @@ class QuadSTests : InstrumentedTest {
} }
private fun assertAccountData(session: Session, type: String): UserAccountDataEvent { private fun assertAccountData(session: Session, type: String): UserAccountDataEvent {
val testHelper = CommonTestHelper(context())
var accountData: UserAccountDataEvent? = null var accountData: UserAccountDataEvent? = null
testHelper.waitWithLatch { testHelper.waitWithLatch {
val liveAccountData = session.accountDataService().getLiveUserAccountDataEvent(type) val liveAccountData = session.accountDataService().getLiveUserAccountDataEvent(type)
...@@ -281,6 +293,7 @@ class QuadSTests : InstrumentedTest { ...@@ -281,6 +293,7 @@ class QuadSTests : InstrumentedTest {
private fun generatedSecret(session: Session, keyId: String, asDefault: Boolean = true): SsssKeyCreationInfo { private fun generatedSecret(session: Session, keyId: String, asDefault: Boolean = true): SsssKeyCreationInfo {
val quadS = session.sharedSecretStorageService val quadS = session.sharedSecretStorageService
val testHelper = CommonTestHelper(context())
val creationInfo = testHelper.runBlockingTest { val creationInfo = testHelper.runBlockingTest {
quadS.generateKey(keyId, null, keyId, emptyKeySigner) quadS.generateKey(keyId, null, keyId, emptyKeySigner)
...@@ -300,6 +313,7 @@ class QuadSTests : InstrumentedTest { ...@@ -300,6 +313,7 @@ class QuadSTests : InstrumentedTest {
private fun generatedSecretFromPassphrase(session: Session, passphrase: String, keyId: String, asDefault: Boolean = true): SsssKeyCreationInfo { private fun generatedSecretFromPassphrase(session: Session, passphrase: String, keyId: String, asDefault: Boolean = true): SsssKeyCreationInfo {
val quadS = session.sharedSecretStorageService val quadS = session.sharedSecretStorageService
val testHelper = CommonTestHelper(context())
val creationInfo = testHelper.runBlockingTest { val creationInfo = testHelper.runBlockingTest {
quadS.generateKeyWithPassphrase( quadS.generateKeyWithPassphrase(
......
...@@ -25,6 +25,7 @@ import org.junit.Assert.assertNull ...@@ -25,6 +25,7 @@ import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
import org.junit.Assert.fail import org.junit.Assert.fail
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -53,11 +54,11 @@ import java.util.concurrent.CountDownLatch ...@@ -53,11 +54,11 @@ import java.util.concurrent.CountDownLatch
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
class SASTest : InstrumentedTest { class SASTest : InstrumentedTest {
private val testHelper = CommonTestHelper(context())
private val cryptoTestHelper = CryptoTestHelper(testHelper)
@Test @Test
fun test_aliceStartThenAliceCancel() { fun test_aliceStartThenAliceCancel() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
...@@ -137,7 +138,10 @@ class SASTest : InstrumentedTest { ...@@ -137,7 +138,10 @@ class SASTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_key_agreement_protocols_must_include_curve25519() { fun test_key_agreement_protocols_must_include_curve25519() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
fail("Not passing for the moment") fail("Not passing for the moment")
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
...@@ -194,7 +198,10 @@ class SASTest : InstrumentedTest { ...@@ -194,7 +198,10 @@ class SASTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_key_agreement_macs_Must_include_hmac_sha256() { fun test_key_agreement_macs_Must_include_hmac_sha256() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
fail("Not passing for the moment") fail("Not passing for the moment")
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
...@@ -232,7 +239,10 @@ class SASTest : InstrumentedTest { ...@@ -232,7 +239,10 @@ class SASTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_key_agreement_short_code_include_decimal() { fun test_key_agreement_short_code_include_decimal() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
fail("Not passing for the moment") fail("Not passing for the moment")
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
...@@ -303,6 +313,8 @@ class SASTest : InstrumentedTest { ...@@ -303,6 +313,8 @@ class SASTest : InstrumentedTest {
// If a device has two verifications in progress with the same device, then it should cancel both verifications. // If a device has two verifications in progress with the same device, then it should cancel both verifications.
@Test @Test
fun test_aliceStartTwoRequests() { fun test_aliceStartTwoRequests() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
...@@ -342,7 +354,10 @@ class SASTest : InstrumentedTest { ...@@ -342,7 +354,10 @@ class SASTest : InstrumentedTest {
* Test that when alice starts a 'correct' request, bob agrees. * Test that when alice starts a 'correct' request, bob agrees.
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun test_aliceAndBobAgreement() { fun test_aliceAndBobAgreement() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
...@@ -402,6 +417,8 @@ class SASTest : InstrumentedTest { ...@@ -402,6 +417,8 @@ class SASTest : InstrumentedTest {
@Test @Test
fun test_aliceAndBobSASCode() { fun test_aliceAndBobSASCode() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
...@@ -458,6 +475,8 @@ class SASTest : InstrumentedTest { ...@@ -458,6 +475,8 @@ class SASTest : InstrumentedTest {
@Test @Test
fun test_happyPath() { fun test_happyPath() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
...@@ -527,9 +546,6 @@ class SASTest : InstrumentedTest { ...@@ -527,9 +546,6 @@ class SASTest : InstrumentedTest {
val bobDeviceInfoFromAlicePOV: CryptoDeviceInfo? = aliceSession.cryptoService().getDeviceInfo(bobUserId, bobDeviceId) val bobDeviceInfoFromAlicePOV: CryptoDeviceInfo? = aliceSession.cryptoService().getDeviceInfo(bobUserId, bobDeviceId)
val aliceDeviceInfoFromBobPOV: CryptoDeviceInfo? = bobSession.cryptoService().getDeviceInfo(aliceSession.myUserId, aliceSession.cryptoService().getMyDevice().deviceId) val aliceDeviceInfoFromBobPOV: CryptoDeviceInfo? = bobSession.cryptoService().getDeviceInfo(aliceSession.myUserId, aliceSession.cryptoService().getMyDevice().deviceId)
// latch wait a bit again
Thread.sleep(1000)
assertTrue("alice device should be verified from bob point of view", aliceDeviceInfoFromBobPOV!!.isVerified) assertTrue("alice device should be verified from bob point of view", aliceDeviceInfoFromBobPOV!!.isVerified)
assertTrue("bob device should be verified from alice point of view", bobDeviceInfoFromAlicePOV!!.isVerified) assertTrue("bob device should be verified from alice point of view", bobDeviceInfoFromAlicePOV!!.isVerified)
cryptoTestData.cleanUp(testHelper) cryptoTestData.cleanUp(testHelper)
...@@ -537,6 +553,8 @@ class SASTest : InstrumentedTest { ...@@ -537,6 +553,8 @@ class SASTest : InstrumentedTest {
@Test @Test
fun test_ConcurrentStart() { fun test_ConcurrentStart() {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
......
...@@ -40,8 +40,6 @@ import kotlin.coroutines.resume ...@@ -40,8 +40,6 @@ import kotlin.coroutines.resume
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
class VerificationTest : InstrumentedTest { class VerificationTest : InstrumentedTest {
private val testHelper = CommonTestHelper(context())
private val cryptoTestHelper = CryptoTestHelper(testHelper)
data class ExpectedResult( data class ExpectedResult(
val sasIsSupported: Boolean = false, val sasIsSupported: Boolean = false,
...@@ -155,6 +153,8 @@ class VerificationTest : InstrumentedTest { ...@@ -155,6 +153,8 @@ class VerificationTest : InstrumentedTest {
bobSupportedMethods: List<VerificationMethod>, bobSupportedMethods: List<VerificationMethod>,
expectedResultForAlice: ExpectedResult, expectedResultForAlice: ExpectedResult,
expectedResultForBob: ExpectedResult) { expectedResultForBob: ExpectedResult) {
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom() val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession val aliceSession = cryptoTestData.firstSession
......
...@@ -21,6 +21,7 @@ import org.commonmark.parser.Parser ...@@ -21,6 +21,7 @@ import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer import org.commonmark.renderer.html.HtmlRenderer
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
...@@ -132,6 +133,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -132,6 +133,7 @@ class MarkdownParserTest : InstrumentedTest {
* Note: the test is not passing, it does not work on Element Web neither * Note: the test is not passing, it does not work on Element Web neither
*/ */
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseStrike_not_passing() { fun parseStrike_not_passing() {
testType( testType(
name = "strike", name = "strike",
...@@ -141,6 +143,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -141,6 +143,7 @@ class MarkdownParserTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseStrikeNewLines() { fun parseStrikeNewLines() {
testTypeNewLines( testTypeNewLines(
name = "strike", name = "strike",
...@@ -160,6 +163,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -160,6 +163,7 @@ class MarkdownParserTest : InstrumentedTest {
// TODO. Improve testTypeNewLines function to cover <pre><code class="language-code">test</code></pre> // TODO. Improve testTypeNewLines function to cover <pre><code class="language-code">test</code></pre>
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseCodeNewLines_not_passing() { fun parseCodeNewLines_not_passing() {
testTypeNewLines( testTypeNewLines(
name = "code", name = "code",
...@@ -179,6 +183,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -179,6 +183,7 @@ class MarkdownParserTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseCode2NewLines_not_passing() { fun parseCode2NewLines_not_passing() {
testTypeNewLines( testTypeNewLines(
name = "code", name = "code",
...@@ -197,6 +202,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -197,6 +202,7 @@ class MarkdownParserTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseCode3NewLines_not_passing() { fun parseCode3NewLines_not_passing() {
testTypeNewLines( testTypeNewLines(
name = "code", name = "code",
...@@ -233,6 +239,7 @@ class MarkdownParserTest : InstrumentedTest { ...@@ -233,6 +239,7 @@ class MarkdownParserTest : InstrumentedTest {
} }
@Test @Test
@Ignore("This test will be ignored until it is fixed")
fun parseQuote_not_passing() { fun parseQuote_not_passing() {
"> quoted\nline2".let { markdownParser.parse(it).expect(it, "<blockquote><p>quoted<br />line2</p></blockquote>") } "> quoted\nline2".let { markdownParser.parse(it).expect(it, "<blockquote><p>quoted<br />line2</p></blockquote>") }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment