diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 48f71d24..a38ac9a8 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5850a79..228366ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.github/workflows/release/chat-maven-build.sh b/.github/workflows/release/chat-maven-build.sh index be41994a..5587166f 100644 --- a/.github/workflows/release/chat-maven-build.sh +++ b/.github/workflows/release/chat-maven-build.sh @@ -1,2 +1,2 @@ echo "Build Chat SDK module artifacts" -./gradlew jar --no-configuration-cache \ No newline at end of file +./gradlew jar \ No newline at end of file diff --git a/.github/workflows/release/chat-maven-publish.sh b/.github/workflows/release/chat-maven-publish.sh index 15db904b..04a7637a 100644 --- a/.github/workflows/release/chat-maven-publish.sh +++ b/.github/workflows/release/chat-maven-publish.sh @@ -1 +1 @@ -./gradlew publishToSonatype closeSonatypeStagingRepository --no-configuration-cache +./gradlew publishToSonatype closeSonatypeStagingRepository diff --git a/.github/workflows/release/pre-github-pages-publish.sh b/.github/workflows/release/pre-github-pages-publish.sh index 0e289f10..fb521b17 100644 --- a/.github/workflows/release/pre-github-pages-publish.sh +++ b/.github/workflows/release/pre-github-pages-publish.sh @@ -1 +1 @@ -./gradlew :dokkaGfmMultiModule --no-configuration-cache \ No newline at end of file +./gradlew :dokkaGfmMultiModule \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4fb40864..601e52ec 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 }} diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index b3e93b91..e19268d7 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -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 diff --git a/gradle.properties b/gradle.properties index 83989355..c01d2dea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/BaseChatIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/BaseChatIntegrationTest.kt index 34d49a15..969a12cb 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/BaseChatIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/BaseChatIntegrationTest.kt @@ -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() diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChannelIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChannelIntegrationTest.kt index 2f2eb767..3913be48 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChannelIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChannelIntegrationTest.kt @@ -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() @@ -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 @@ -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 @@ -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() @@ -173,7 +173,7 @@ class ChannelIntegrationTest : BaseChatIntegrationTest() { } @Test - fun streamUpdatesOn() = runTest(timeout = defaultTimeout) { + fun streamUpdatesOn() = runTest { val newName = "newName" chat.createChannel( channel01.id, diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt index 0c25f9ba..1da3f1cd 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt @@ -46,7 +46,7 @@ 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)) @@ -54,7 +54,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() { } @Test - fun updateUser() = runTest(timeout = defaultTimeout) { + fun updateUser() = runTest { val user = chat.createUser(someUser).await() val expectedUser = user.asImpl().copy( name = randomString(), @@ -84,7 +84,7 @@ class ChatIntegrationTest : BaseChatIntegrationTest() { } @Test - fun updateUser_doesntExist() = runTest(timeout = defaultTimeout) { + fun updateUser_doesntExist() = runTest { val e = assertFailsWith { chat.updateUser(someUser.id, name = randomString()).await() } @@ -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() @@ -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 @@ -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 = @@ -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 @@ -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 @@ -302,14 +302,14 @@ class ChatIntegrationTest : BaseChatIntegrationTest() { } @Test - fun shouldReturnNoChannelSuggestions_whenNoDataInCacheAndNoChannelsInChat() = runTest(timeout = defaultTimeout) { + fun shouldReturnNoChannelSuggestions_whenNoDataInCacheAndNoChannelsInChat() = runTest { val channelSuggestions: Set = 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() @@ -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() @@ -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( @@ -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 diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MembershipIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MembershipIntegrationTest.kt index cda8bf8e..ea20abaf 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MembershipIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MembershipIntegrationTest.kt @@ -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, diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MessageIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MessageIntegrationTest.kt index 503a5879..4eb2dc43 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MessageIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/MessageIntegrationTest.kt @@ -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, diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/UserIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/UserIntegrationTest.kt index 68f44926..845a73f4 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/UserIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/UserIntegrationTest.kt @@ -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 @@ -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 @@ -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 @@ -117,7 +117,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() { } @Test - fun streamUpdatesOn() = runTest(timeout = defaultTimeout) { + fun streamUpdatesOn() = runTest { val newName = "newName" val expectedUpdates = listOf( listOf(someUser), @@ -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 { someUser.active().await() } @@ -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 @@ -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 @@ -196,7 +196,7 @@ class UserIntegrationTest : BaseChatIntegrationTest() { } @Test - fun adminCanSubscribeToInternalChannelAndGetReportedUserEvent() = runTest(timeout = defaultTimeout) { + fun adminCanSubscribeToInternalChannelAndGetReportedUserEvent() = runTest { val reason = "rude" val assertionErrorInListener01 = CompletableDeferred() val removeListenerAndUnsubscribe: AutoCloseable = chat.listenForEvents( diff --git a/pubnub-kotlin b/pubnub-kotlin index c14c2005..8b7eb393 160000 --- a/pubnub-kotlin +++ b/pubnub-kotlin @@ -1 +1 @@ -Subproject commit c14c2005b222389c7af028bf2aefd364d9eeb3d9 +Subproject commit 8b7eb393d98b2e98728e3e09a040dbbea0d73441