Skip to content

Commit 1e45235

Browse files
authored
Merge pull request #850 from vector-im/feature/bma/fixTests
Ensure CI run all the tests.
2 parents 281d0dd + 0d45096 commit 1e45235

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

.github/workflows/nightlyReports.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
distribution: 'temurin' # See 'Supported distributions' for available options
2727
java-version: '17'
2828

29+
- name: ⚙️ Run unit & screenshot tests, debug and release
30+
run: ./gradlew test $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
31+
2932
- name: ⚙️ Run unit & screenshot tests, generate kover report
3033
run: ./gradlew koverMergedReport $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
3134

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
with:
3838
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
3939

40+
- name: ⚙️ Run unit & screenshot tests, debug and release
41+
run: ./gradlew test $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
42+
4043
- name: ⚙️ Run unit & screenshot tests, generate kover report
4144
run: ./gradlew koverMergedReport $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
4245

features/messages/impl/src/test/kotlin/io/element/android/features/messages/forward/ForwardMessagesPresenterTests.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class ForwardMessagesPresenterTests {
6565
}.test {
6666
val initialState = awaitItem()
6767
skipItems(1)
68-
val summary = aRoomSummaryDetail()
6968

7069
initialState.eventSink(ForwardMessagesEvents.ToggleSearchActive)
7170
assertThat(awaitItem().isSearchActive).isTrue()

libraries/core/src/main/kotlin/io/element/android/libraries/core/extensions/BasicExtensions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fun String?.insertBeforeLast(insert: String, delimiter: String = "."): String {
6464
* Throws if length is < 1.
6565
*/
6666
fun String.ellipsize(length: Int): String {
67-
require(length > 1)
67+
require(length >= 1)
6868

6969
if (this.length <= length) {
7070
return this

libraries/deeplink/src/main/kotlin/io/element/android/libraries/deeplink/DeeplinkParser.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package io.element.android.libraries.deeplink
1818

1919
import android.content.Intent
2020
import android.net.Uri
21-
import io.element.android.libraries.core.data.tryOrNull
2221
import io.element.android.libraries.matrix.api.core.RoomId
2322
import io.element.android.libraries.matrix.api.core.SessionId
2423
import io.element.android.libraries.matrix.api.core.ThreadId
@@ -37,21 +36,15 @@ class DeeplinkParser @Inject constructor() {
3736
if (host != HOST) return null
3837
val pathBits = path.orEmpty().split("/").drop(1)
3938
val sessionId = pathBits.elementAtOrNull(0)?.let(::SessionId) ?: return null
40-
val screenPathComponent = pathBits.elementAtOrNull(1)
41-
val roomId = tryOrNull { screenPathComponent?.let(::RoomId) }
4239

43-
return when {
44-
roomId != null -> {
40+
return when (val screenPathComponent = pathBits.elementAtOrNull(1)) {
41+
null -> DeeplinkData.Root(sessionId)
42+
DeepLinkPaths.INVITE_LIST -> DeeplinkData.InviteList(sessionId)
43+
else -> {
44+
val roomId = screenPathComponent.let(::RoomId)
4545
val threadId = pathBits.elementAtOrNull(2)?.let(::ThreadId)
4646
DeeplinkData.Room(sessionId, roomId, threadId)
4747
}
48-
screenPathComponent == DeepLinkPaths.INVITE_LIST -> {
49-
DeeplinkData.InviteList(sessionId)
50-
}
51-
screenPathComponent == null -> {
52-
DeeplinkData.Root(sessionId)
53-
}
54-
else -> null
5548
}
5649
}
5750
}

libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/RoomMembershipContentFormatter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RoomMembershipContentFormatter @Inject constructor(
3434
): CharSequence? {
3535
val userId = membershipContent.userId
3636
val memberIsYou = matrixClient.isMe(userId)
37-
return when (val change = membershipContent.change) {
37+
return when (membershipContent.change) {
3838
MembershipChange.JOINED -> if (memberIsYou) {
3939
sp.getString(R.string.state_event_room_join_by_you)
4040
} else {

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/room/MatrixRoom.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ interface MatrixRoom : Closeable {
8686

8787
suspend fun toggleReaction(emoji: String, eventId: EventId): Result<Unit>
8888

89-
suspend fun forwardEvent(eventId: EventId, rooms: List<RoomId>): Result<Unit>
89+
suspend fun forwardEvent(eventId: EventId, roomIds: List<RoomId>): Result<Unit>
9090

9191
suspend fun retrySendMessage(transactionId: String): Result<Unit>
9292

libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/room/FakeMatrixRoom.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class FakeMatrixRoom(
239239

240240
override suspend fun sendFile(file: File, fileInfo: FileInfo, progressCallback: ProgressCallback?): Result<Unit> = fakeSendMedia(progressCallback)
241241

242-
override suspend fun forwardEvent(eventId: EventId, rooms: List<RoomId>): Result<Unit> = simulateLongTask {
242+
override suspend fun forwardEvent(eventId: EventId, roomIds: List<RoomId>): Result<Unit> = simulateLongTask {
243243
forwardEventResult
244244
}
245245

libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotificationFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class NotificationFactory @Inject constructor(
123123
val roomMeta = roomNotifications.filterIsInstance<RoomNotification.Message>().map { it.meta }
124124
val invitationMeta = invitationNotifications.filterIsInstance<OneShotNotification.Append>().map { it.meta }
125125
val simpleMeta = simpleNotifications.filterIsInstance<OneShotNotification.Append>().map { it.meta }
126-
val fallbackMeta = simpleNotifications.filterIsInstance<OneShotNotification.Append>().map { it.meta }
126+
val fallbackMeta = fallbackNotifications.filterIsInstance<OneShotNotification.Append>().map { it.meta }
127127
return when {
128128
roomMeta.isEmpty() && invitationMeta.isEmpty() && simpleMeta.isEmpty() -> SummaryNotification.Removed
129129
else -> SummaryNotification.Update(

0 commit comments

Comments
 (0)