Skip to content

Commit

Permalink
[Automated] Merge releases into main (#1794)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 5, 2024
1 parent 17e92c2 commit 195b221
Show file tree
Hide file tree
Showing 10 changed files with 594 additions and 202 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
cd ~
curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb
- name: Build JNI Stub
working-directory: ./packages
run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false
Expand All @@ -97,7 +96,7 @@ jobs:
retention-days: 1

build-jvm-linux-native-lib:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [check-cache, build-jni-swig-stub]
if: |
always() &&
Expand Down Expand Up @@ -133,21 +132,9 @@ jobs:
name: jni-stub-${{ needs.check-cache.outputs.version-label }}
path: ./packages/jni-swig-stub/build/generated/sources/jni

- name: Build Docker image
uses: docker/build-push-action@v5
with:
tags: jvm-native-lib-linux:latest
file: ./packages/cinterop/src/jvmMain/generic.Dockerfile
push: false

- name: Build native lib
uses: addnab/docker-run-action@v3
with:
image: jvm-native-lib-linux:latest
shell: bash
options: -v ${{ github.workspace }}:/work
run: |
cd /work/packages/cinterop
working-directory: ./packages/cinterop
run: |
mkdir build
cd build
rm -rf realmLinuxBuild
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ object Versions {
const val latestKotlin = "2.0.0" // https://kotlinlang.org/docs/eap.html#build-details
const val kotlinCompileTesting = "0.5.0-alpha07" // https://github.com/zacsweers/kotlin-compile-testing
const val ktlint = "0.45.2" // https://github.com/pinterest/ktlint
const val ktor = "2.3.7" // https://github.com/ktorio/ktor
const val ktor = "2.3.12" // https://github.com/ktorio/ktor
const val multidex = "2.0.1" // https://developer.android.com/jetpack/androidx/releases/multidex
const val nexusPublishPlugin = "1.1.0" // https://github.com/gradle-nexus/publish-plugin
const val okio = "3.2.0" // https://square.github.io/okio/#releases
const val relinker = "1.4.5" // https://github.com/KeepSafe/ReLinker
const val serialization = "1.6.0" // https://kotlinlang.org/docs/releases.html#release-details
const val serialization = "1.7.1" // https://kotlinlang.org/docs/releases.html#release-details
const val shadowJar = "6.1.0" // https://mvnrepository.com/artifact/com.github.johnrengelman.shadow/com.github.johnrengelman.shadow.gradle.plugin?repo=gradle-plugins
const val snakeYaml = "1.33" // https://github.com/snakeyaml/snakeyaml
val sourceCompatibilityVersion = JavaVersion.VERSION_1_8 // Language level of any Java source code.
Expand Down
31 changes: 0 additions & 31 deletions packages/cinterop/src/jvmMain/generic.Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions packages/test-sync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ kotlin {
implementation("io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}")
implementation("io.ktor:ktor-client-content-negotiation:${Versions.ktor}")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}")

implementation("com.squareup.okio:okio:${Versions.okio}")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package io.realm.kotlin.test.mongodb

import io.realm.kotlin.Realm
import io.realm.kotlin.annotations.ExperimentalRealmSerializerApi
import io.realm.kotlin.internal.interop.RealmInterop
import io.realm.kotlin.internal.interop.SynchronizableObject
Expand All @@ -31,8 +30,6 @@ import io.realm.kotlin.mongodb.AppConfiguration
import io.realm.kotlin.mongodb.Credentials
import io.realm.kotlin.mongodb.User
import io.realm.kotlin.mongodb.internal.AppConfigurationImpl
import io.realm.kotlin.mongodb.sync.SyncConfiguration
import io.realm.kotlin.test.mongodb.common.FLEXIBLE_SYNC_SCHEMA
import io.realm.kotlin.test.mongodb.util.AppAdmin
import io.realm.kotlin.test.mongodb.util.AppAdminImpl
import io.realm.kotlin.test.mongodb.util.AppServicesClient
Expand All @@ -41,7 +38,6 @@ import io.realm.kotlin.test.mongodb.util.Service
import io.realm.kotlin.test.mongodb.util.TestAppInitializer.initializeDefault
import io.realm.kotlin.test.platform.PlatformUtils
import io.realm.kotlin.test.util.TestHelper
import io.realm.kotlin.test.util.use
import kotlinx.coroutines.CloseableCoroutineDispatcher
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down Expand Up @@ -119,28 +115,6 @@ open class TestApp private constructor(
)
)

init {
// For apps with Flexible Sync, we need to bootstrap all the schemas to work around
// https://github.com/realm/realm-core/issues/7297.
// So we create a dummy Realm, upload all the schemas and close the Realm again.
if (app.configuration.appId.startsWith(TEST_APP_FLEX, ignoreCase = false)) {
runBlocking {
val user = app.login(Credentials.anonymous())
val config = SyncConfiguration.create(user, FLEXIBLE_SYNC_SCHEMA)
try {
Realm.open(config).use {
// Using syncSession.uploadAllLocalChanges() seems to just hang forever.
// This is tracked by the above Core issue. Instead use the Sync Progress
// endpoint to signal when the schemas are ready.
pairAdminApp.second.waitForSyncBootstrap()
}
} finally {
user.delete()
}
}
}
}

fun createUserAndLogin(): User = runBlocking {
val (email, password) = TestHelper.randomEmail() to "password1234"
emailPasswordAuth.registerUser(email, password).run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ package io.realm.kotlin.test.mongodb.util

import io.realm.kotlin.mongodb.sync.SyncMode
import io.realm.kotlin.mongodb.sync.SyncSession
import kotlinx.coroutines.delay
import kotlinx.serialization.json.JsonObject
import kotlin.time.Duration.Companion.seconds

/**
* Wrapper around App Services Server Admin functions needed for tests.
Expand Down Expand Up @@ -103,11 +101,6 @@ interface AppAdmin {
*/
suspend fun deleteDocuments(database: String, clazz: String, query: String): JsonObject?

/**
* Wait for Sync bootstrap to complete for all model classes.
*/
suspend fun waitForSyncBootstrap()

fun closeClient()
}

Expand Down Expand Up @@ -208,20 +201,6 @@ class AppAdminImpl(
app.deleteDocument(database, clazz, query)
}

override suspend fun waitForSyncBootstrap() {
baasClient.run {
var limit = 300
var i = 0
while (!app.initialSyncComplete() && i < limit) {
delay(1.seconds)
i++
}
if (!app.initialSyncComplete()) {
throw IllegalStateException("Test server did not finish bootstrapping sync in time: $limit s.")
}
}
}

override fun closeClient() {
baasClient.closeClient()
}
Expand Down
Loading

0 comments on commit 195b221

Please sign in to comment.