File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
src/commonTest/kotlin/co/pokeapi/pokekotlin/test Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,13 @@ jobs:
3030 os : windows
3131 - target : iosSimulatorArm64
3232 os : macos
33+ simulator : iOS
3334 - target : tvosSimulatorArm64
3435 os : macos
36+ simulator : tvOS
3537 - target : watchosSimulatorArm64
3638 os : macos
39+ simulator : watchOS
3740 runs-on : " ${{ matrix.os }}-latest"
3841 name : " test (${{ matrix.target }})"
3942 steps :
4245 fetch-depth : 0
4346 submodules : recursive
4447 - uses : " ./.github/actions/setup"
48+ - uses : " futureware-tech/simulator-action@v4"
49+ if : " ${{ matrix.simulator }}"
50+ id : simulator_setup
51+ with :
52+ wait_for_boot : true
53+ os : " ${{ matrix.simulator }}"
4554 - run : " just test-server-background"
4655 - run : " ./gradlew ${{ matrix.target }}Test"
56+ env :
57+ ORG_GRADLE_PROJECT_appleNativeSimulatorDevice : " ${{ steps.simulator_setup.outputs.udid }}"
4758
4859 build-docs :
4960 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 33import com.vanniktech.maven.publish.SonatypeHost
44import fr.brouillard.oss.jgitver.Strategies
55import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
6+ import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
67import ru.vyarus.gradle.plugin.mkdocs.task.MkdocsTask
78
89plugins {
@@ -98,8 +99,17 @@ kotlin {
9899 }
99100}
100101
102+ // Gradle complains if we don't have this; unclear why.
101103tasks.getByName(" sourcesJar" ).dependsOn(" kspCommonMainKotlinMetadata" )
102104
105+ // Standalone mode is missing certificates, which causes our LiveTest to fail.
106+ // This should resolve it but requires us to start the simulator(s) beforehand.
107+ // https://youtrack.jetbrains.com/issue/KT-38317
108+ tasks.withType<KotlinNativeSimulatorTest > {
109+ standalone.set(false )
110+ (project.findProperty(" appleNativeSimulatorDevice" ) as ? String )?.let { device.set(it) }
111+ }
112+
103113publishing {
104114 repositories {
105115 maven {
Original file line number Diff line number Diff line change @@ -3,13 +3,11 @@ package co.pokeapi.pokekotlin.test
33import co.pokeapi.pokekotlin.PokeApi
44import io.ktor.client.plugins.ClientRequestException
55import io.ktor.http.HttpStatusCode.Companion.NotFound
6- import kotlin.test.Ignore
76import kotlin.test.Test
87import kotlin.test.assertEquals
98import kotlin.test.assertIs
109import kotlinx.coroutines.test.runTest
1110
12- @Ignore
1311class LiveTest {
1412
1513 @Test fun resource () = runTest { assertEquals(" sitrus" , PokeApi .getBerry(10 ).getOrThrow().name) }
You can’t perform that action at this time.
0 commit comments