Skip to content

Commit

Permalink
CI build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wkal-pubnub committed Aug 2, 2024
1 parent 948d068 commit fd33e50
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 44 deletions.
1 change: 1 addition & 0 deletions .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
- name: Checkout release actions
if: steps.user-check.outputs.expected-user == 'true'
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
with:
# This should be the same as the one specified for on.pull_request.branches
ref: master
submodules: recursive
- name: Checkout actions
uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release/chat-maven-build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
echo "Build Chat SDK module artifacts"
./gradlew jar --no-configuration-cache
./gradlew jar
2 changes: 1 addition & 1 deletion .github/workflows/release/chat-maven-publish.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew publishToSonatype closeSonatypeStagingRepository --no-configuration-cache
./gradlew publishToSonatype closeSonatypeStagingRepository
2 changes: 1 addition & 1 deletion .github/workflows/release/pre-github-pages-publish.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew :dokkaGfmMultiModule --no-configuration-cache
./gradlew :dokkaGfmMultiModule
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
./gradlew check
env:
SDK_PUB_KEY: ${{ secrets.SDK_PUB_KEY }}
SDK_SUB_KEY: ${{ secrets.SDK_PUB_KEY }}
SDK_SUB_KEY: ${{ secrets.SDK_SUB_KEY }}
SDK_PAM_SUB_KEY: ${{ secrets.SDK_PAM_SUB_KEY }}
SDK_PAM_PUB_KEY: ${{ secrets.SDK_PAM_PUB_KEY }}
SDK_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate clean build
run: ./gradlew apiCheck ktlintFormat publishAllPublicationsToRepoRepository
run: ./gradlew apiCheck ktlintFormat publishAllPublicationsToRepoRepository -PRELEASE_SIGNING_ENABLED=false
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official
org.gradle.configuration-cache=true
org.gradle.caching=true
org.gradle.parallel=true
kotlin.mpp.applyDefaultHierarchyTemplate=false

org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ abstract class BaseChatIntegrationTest : BaseIntegrationTest() {
}

@AfterTest
fun afterTest() = runTest(timeout = defaultTimeout) {
fun afterTest() = runTest {
pubnub.removeUUIDMetadata(someUser.id).await()
pubnub.removeUUIDMetadata(userPam.id).await()
pubnub.removeChannelMetadata(channel01.id).await()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds

class ChannelIntegrationTest : BaseChatIntegrationTest() {
@Test
fun join() = runTest(timeout = defaultTimeout) {
fun join() = runTest {
val channel = chat.createChannel(randomString()).await()

val result = channel.join {}.await()
Expand All @@ -32,31 +32,31 @@ class ChannelIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun join_receivesMessages() = runTest(timeout = defaultTimeout) {
fun join_receivesMessages() = runTest {
}

@Test
fun join_close_disconnects() = runTest(timeout = defaultTimeout) {
fun join_close_disconnects() = runTest {
}

@Test
fun join_updates_lastReadMessageTimetoken() = runTest(timeout = defaultTimeout) {
fun join_updates_lastReadMessageTimetoken() = runTest {
}

@Test
fun connect() = runTest(timeout = defaultTimeout) {
fun connect() = runTest {
}

@Test
fun connect_receivesMessages() = runTest(timeout = defaultTimeout) {
fun connect_receivesMessages() = runTest {
}

@Test
fun connect_close_disconnects() = runTest(timeout = defaultTimeout) {
fun connect_close_disconnects() = runTest {
}

@Test
fun getUserRestrictions() = runTest(timeout = defaultTimeout) {
fun getUserRestrictions() = runTest {
val userId = "userId"
val user = UserImpl(chat = chatPam, id = userId)
val ban = true
Expand All @@ -74,7 +74,7 @@ class ChannelIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun getUsersRestrictions() = runTest(timeout = defaultTimeout) {
fun getUsersRestrictions() = runTest {
val userId01 = "userId01"
val userId02 = "userId02"
val ban = true
Expand Down Expand Up @@ -108,13 +108,13 @@ class ChannelIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun shouldReturnNoUserSuggestions_whenNoDatInCacheAndNoChannelsInChat() = runTest(timeout = defaultTimeout) {
fun shouldReturnNoUserSuggestions_whenNoDatInCacheAndNoChannelsInChat() = runTest {
val userSuggestions = channel01.getUserSuggestions("sas@las").await()
assertEquals(0, userSuggestions.size)
}

@Test
fun shouldReturnUserSuggestions_whenNoDataInCacheButUserAvailableInChat() = runTest(timeout = defaultTimeout) {
fun shouldReturnUserSuggestions_whenNoDataInCacheButUserAvailableInChat() = runTest {
// given
val userName = "userName_${someUser.id}"
val user: User = chat.createUser(id = someUser.id, name = userName).await()
Expand Down Expand Up @@ -173,7 +173,7 @@ class ChannelIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun streamUpdatesOn() = runTest(timeout = defaultTimeout) {
fun streamUpdatesOn() = runTest {
val newName = "newName"
chat.createChannel(
channel01.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ import kotlin.test.assertTrue

class ChatIntegrationTest : BaseChatIntegrationTest() {
@Test
fun createUser() = runTest(timeout = defaultTimeout) {
fun createUser() = runTest {
val user = chat.createUser(someUser).await()

assertEquals(someUser, user.asImpl().copy(updated = null, lastActiveTimestamp = null))
assertNotNull(user.updated)
}

@Test
fun updateUser() = runTest(timeout = defaultTimeout) {
fun updateUser() = runTest {
val user = chat.createUser(someUser).await()
val expectedUser = user.asImpl().copy(
name = randomString(),
Expand Down Expand Up @@ -84,7 +84,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun updateUser_doesntExist() = runTest(timeout = defaultTimeout) {
fun updateUser_doesntExist() = runTest {
val e = assertFailsWith<PubNubException> {
chat.updateUser(someUser.id, name = randomString()).await()
}
Expand All @@ -94,7 +94,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun createDirectConversation() = runTest(timeout = defaultTimeout) {
fun createDirectConversation() = runTest {
chat.initialize().await()
// when
val result = chat.createDirectConversation(someUser).await()
Expand All @@ -114,7 +114,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun createGroupConversation() = runTest(timeout = defaultTimeout) {
fun createGroupConversation() = runTest {
val otherUsers = listOf(UserImpl(chat, randomString()), UserImpl(chat, randomString()))

// when
Expand All @@ -138,7 +138,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun can_markAllMessagesAsRead() = runTest(timeout = defaultTimeout) {
fun can_markAllMessagesAsRead() = runTest {
// create two membership for user one with "lastReadMessageTimetoken" and second without.
val lastReadMessageTimetokenValue: Long = 17195737006492403
val custom: CustomObject =
Expand Down Expand Up @@ -219,7 +219,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {

@Ignore // fails from time to time
@Test
fun can_getUnreadMessagesCount_onMembership() = runTest(timeout = defaultTimeout) {
fun can_getUnreadMessagesCount_onMembership() = runTest {
val channelId01 = channel01.id

// send message
Expand Down Expand Up @@ -253,7 +253,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {

@Ignore // fails from time to time
@Test
fun can_getUnreadMessageCounts_global() = runTest(timeout = defaultTimeout) {
fun can_getUnreadMessageCounts_global() = runTest {
val channelId01 = channel01.id
val channelId02 = channel02.id

Expand Down Expand Up @@ -302,14 +302,14 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun shouldReturnNoChannelSuggestions_whenNoDataInCacheAndNoChannelsInChat() = runTest(timeout = defaultTimeout) {
fun shouldReturnNoChannelSuggestions_whenNoDataInCacheAndNoChannelsInChat() = runTest {
val channelSuggestions: Set<Channel> = chat.getChannelSuggestions("sas#las").await()
assertEquals(0, channelSuggestions.size)
}

@Test
fun shouldReturnChannelSuggestions_whenNoDataInCacheButChannelAvailableInChat() =
runTest(timeout = defaultTimeout) {
runTest {
val channelName = "channelName_${channel01.id}"
chat.createChannel(id = channel01.id, name = channelName).await()

Expand All @@ -321,13 +321,13 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun shouldReturnNoUserSuggestions_whenNoDatInCacheAndNoChannelsInChat() = runTest(timeout = defaultTimeout) {
fun shouldReturnNoUserSuggestions_whenNoDatInCacheAndNoChannelsInChat() = runTest {
val userSuggestions = chat.getUserSuggestions("sas@las").await()
assertEquals(0, userSuggestions.size)
}

@Test
fun shouldReturnUserSuggestions_whenNoDataInCacheButUserAvailableInChat() = runTest(timeout = defaultTimeout) {
fun shouldReturnUserSuggestions_whenNoDataInCacheButUserAvailableInChat() = runTest {
val userName = "userName_${someUser.id}"
chat.createUser(id = someUser.id, name = userName).await()

Expand All @@ -339,7 +339,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun register_unregister_list_pushNotificationOnChannel() = runTest(timeout = defaultTimeout) {
fun register_unregister_list_pushNotificationOnChannel() = runTest {
// set up push config
val chatConfig = ChatConfiguration(
pushNotifications = PushNotificationsConfig(
Expand Down Expand Up @@ -385,7 +385,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun can_getEventsHistory() = runTest(timeout = defaultTimeout) {
fun can_getEventsHistory() = runTest {
// given
val channelId01 = channel01.id
val userId = someUser.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlin.test.assertEquals

class MembershipIntegrationTest : BaseChatIntegrationTest() {
@Test
fun streamUpdatesOn() = runTest(timeout = defaultTimeout) {
fun streamUpdatesOn() = runTest {
chat.createChannel(
channel01.id,
channel01.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlin.test.assertEquals

class MessageIntegrationTest : BaseChatIntegrationTest() {
@Test
fun streamUpdatesOn() = runTest(timeout = defaultTimeout) {
fun streamUpdatesOn() = runTest {
chat.createChannel(
channel01.id,
channel01.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlin.test.assertTrue

class UserIntegrationTest : BaseChatIntegrationTest() {
@Test
fun getChannelRestrictions() = runTest(timeout = defaultTimeout) {
fun getChannelRestrictions() = runTest {
val channelId = "channelId01"
val channel = ChannelImpl(chat = chatPam, id = channelId)
val ban = true
Expand All @@ -44,7 +44,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun getChannelsRestrictions_sortAsc() = runTest(timeout = defaultTimeout) {
fun getChannelsRestrictions_sortAsc() = runTest {
val channelId01 = "channelId01"
val channelId02 = "channelId02"
val ban = true
Expand Down Expand Up @@ -84,7 +84,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun getChannelsRestrictions_sortDsc() = runTest(timeout = defaultTimeout) {
fun getChannelsRestrictions_sortDsc() = runTest {
val channelId01 = "channelId01"
val channelId02 = "channelId02"
val ban = true
Expand Down Expand Up @@ -117,7 +117,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun streamUpdatesOn() = runTest(timeout = defaultTimeout) {
fun streamUpdatesOn() = runTest {
val newName = "newName"
val expectedUpdates = listOf(
listOf(someUser),
Expand Down Expand Up @@ -148,7 +148,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun calling_active_should_throw_exception_when_storeUserActivityTimestamps_is_false() = runTest(timeout = defaultTimeout) {
fun calling_active_should_throw_exception_when_storeUserActivityTimestamps_is_false() = runTest {
val e = assertFailsWith<PubNubException> {
someUser.active().await()
}
Expand All @@ -160,7 +160,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun whenUserDoesNotExist_init_should_create_it_with_lastActiveTimestamp() = runTest(timeout = defaultTimeout) {
fun whenUserDoesNotExist_init_should_create_it_with_lastActiveTimestamp() = runTest {
// set up storeUserActivityTimestamps
val chatConfig = ChatConfiguration(
storeUserActivityTimestamps = true
Expand All @@ -176,7 +176,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun whenUserExists_init_should_update_lastActiveTimestamp() = runTest(timeout = defaultTimeout) {
fun whenUserExists_init_should_update_lastActiveTimestamp() = runTest {
// set up storeUserActivityTimestamps
val chatConfig = ChatConfiguration(
storeUserActivityTimestamps = true
Expand All @@ -196,7 +196,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() {
}

@Test
fun adminCanSubscribeToInternalChannelAndGetReportedUserEvent() = runTest(timeout = defaultTimeout) {
fun adminCanSubscribeToInternalChannelAndGetReportedUserEvent() = runTest {
val reason = "rude"
val assertionErrorInListener01 = CompletableDeferred<AssertionError?>()
val removeListenerAndUnsubscribe: AutoCloseable = chat.listenForEvents<EventContent.Report>(
Expand Down
2 changes: 1 addition & 1 deletion pubnub-kotlin
Submodule pubnub-kotlin updated 20 files
+1 −1 .github/workflows/release/kotlin-maven-build.sh
+1 −1 .github/workflows/release/kotlin-maven-publish.sh
+1 −1 .github/workflows/run-tests.yml
+1 −1 .github/workflows/run-validations.yml
+3 −0 build-logic/gradle-plugins/src/main/kotlin/com/pubnub/gradle/PubNubKotlinMultiplatformPlugin.kt
+0 −1 gradle.properties
+6 −5 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/ChannelMetadataTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/DeleteMessagesTest.kt
+5 −5 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/EntitiesTest.kt
+2 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/FetchMessagesTest.kt
+3 −3 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/HereWhereNowTest.kt
+3 −3 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/MembersTest.kt
+5 −5 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/MembershipsTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/MessageActionsTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/MessageCountsTest.kt
+20 −13 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/PublishTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/PushTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/TimeTest.kt
+7 −6 pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/UserMetadataTest.kt
+0 −3 pubnub-kotlin/pubnub-kotlin-test/src/commonMain/kotlin/com.pubnub.test/BaseIntegrationTest.kt

0 comments on commit fd33e50

Please sign in to comment.