-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using test parameter to feed BAAS URL to device farm (#1642)
* Using AndroidTestRunner to parametrise the URL of the BAAS server when running Sync tests on Device Farm
- Loading branch information
Showing
7 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/test-sync/src/androidMain/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.realm.kotlin.test.mongodb | ||
|
||
import android.os.Bundle | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
|
||
actual fun baasTestUrl(): String { | ||
val arguments: Bundle = InstrumentationRegistry.getArguments() | ||
// if the test runner provided an argument for the BAAS URL use it | ||
// Example: adb shell am instrument -w -e baas_url "http"//8.8.8.8:2134" -r io.realm.sync.testapp.test/androidx.test.runner.AndroidJUnitRunner | ||
return arguments.getString("baas_url") ?: SyncServerConfig.url | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/test-sync/src/jvmMain/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.realm.kotlin.test.mongodb | ||
|
||
actual fun baasTestUrl(): String = SyncServerConfig.url |
3 changes: 3 additions & 0 deletions
3
packages/test-sync/src/nativeDarwin/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.realm.kotlin.test.mongodb | ||
|
||
actual fun baasTestUrl(): String = SyncServerConfig.url |