Unverified Commit ffbff629 authored by Alexander Maryanovsky's avatar Alexander Maryanovsky Committed by GitHub

Fix invocation of tests that only run on CI (#1108)

parent a29209ba
......@@ -25,11 +25,11 @@ jobs:
- shell: bash
name: 'Compile and run AWT tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:awtTest
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:awtTest
- shell: bash
name: 'Compile and run macOS x64 tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:macosX64Test
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:macosX64Test
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
......@@ -83,12 +83,12 @@ jobs:
max_attempts: 10
timeout_minutes: 60
shell: bash
command: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true -Pskiko.iosSimulatorUUID="${{ env.IOS_SIM_UUID }}" :skiko:iosX64TestWithMetal
command: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false -Pskiko.iosSimulatorUUID="${{ env.IOS_SIM_UUID }}" :skiko:iosX64TestWithMetal
# iosSimulatorArm64Test will build the binary but the tests will be skipped due to X64 host machine
- shell: bash
name: 'Compile iOS arm64 tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:iosSimulatorArm64Test
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:iosSimulatorArm64Test
# TODO run iOS specific tests on iPhone simulator
- shell: bash
......@@ -118,9 +118,9 @@ jobs:
- shell: bash
run: |
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:tvosX64Test
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:tvosX64Test
# tvosSimulatorArm64Test will build the binary but the tests will be skipped due to X64 host machine
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:tvosSimulatorArm64Test
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:tvosSimulatorArm64Test
- uses: actions/upload-artifact@v4
if: always()
......@@ -170,21 +170,25 @@ jobs:
name: 'Compile and run Linux x64 tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Pskiko.test.onci=true :skiko:linuxX64Test
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:linuxX64Test
# Linux arm64 tests are executed on a separate runner
- shell: bash
name: 'Compile Linux arm64 tests'
run: |
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:linkDebugTestLinuxArm64
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:linkDebugTestLinuxArm64
- shell: bash
name: 'Compile and run AWT tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Pskiko.test.onci=true :skiko:awtTest
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:awtTest
timeout-minutes: 25
- name: Clean Gradle cache to recover disk space
run: |
rm -rf ~/.gradle/caches
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
env:
......@@ -250,7 +254,7 @@ jobs:
name: 'Compile and run AWT tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.test.onci=true :skiko:awtTest
./gradlew --no-daemon --stacktrace --info -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false :skiko:awtTest
timeout-minutes: 25
- shell: bash
......@@ -287,7 +291,7 @@ jobs:
# OPENGL is ignored as it doesn't exist on the Windows GitHub agent
- shell: bash
name: 'Compile and run AWT tests'
run: ./gradlew --stacktrace --info -Pskiko.test.onci=true -Pskiko.test.ui.renderApi.ignoreAssertsFor=OPENGL :skiko:awtTest
run: ./gradlew --stacktrace --info -Dskiko.test.onci=true -Dskiko.test.performance.enabled=false -Dskiko.test.ui.renderApi.ignoreAssertsFor=OPENGL :skiko:awtTest
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
......
......@@ -13,6 +13,7 @@ import org.junit.Test
import java.awt.Point
import javax.swing.WindowConstants
import kotlin.math.*
import kotlin.time.Duration.Companion.nanoseconds
@Suppress("BlockingMethodInNonBlockingContext", "SameParameterValue")
class SkiaLayerPerformanceTest {
......@@ -75,6 +76,13 @@ class SkiaLayerPerformanceTest {
println("Deltas " + millis.map { String.format("%.1f", it) })
println("Average %.2f".format(millis.average()))
println("Standard deviation %.2f".format(millis.stddev()))
println("Expected frame time: " +
"${if (expectedFrameNanos.isFinite()) {
expectedFrameNanos.nanoseconds.inWholeMilliseconds
} else {
expectedFrameNanos
}} ms."
)
fun deviateMessage(percent: Double, deviated: List<Long>): String {
val deviatedStr = deviated.map { String.format("%.1f", it / 1E6) }
......
......@@ -829,8 +829,8 @@ class SkiaLayerTest {
val dt = renderTimes.last() - renderTimes.first()
assertTrue(
actual = dt < 100,
message = "2nd frame drawn ${dt}ms after 1st"
actual = dt < 150,
message = "2nd frame drawn ${dt}ms after 1st: ${renderTimes.map { it - renderTimes.first() }}}"
)
renderTimes.clear()
}
......
......@@ -59,7 +59,7 @@ class ScreenshotTestRule : TestRule {
}
if (expectedFile.exists()) {
val expected = Image.makeFromEncoded(expectedFile.readBytes())
// macOs screenshots can have different color on different configurations
// macOS screenshots can have different color on different configurations
if (!isContentSame(expected, actual, sensitivity = 0.25)) {
actualFile.writeBytes(actual.encodeToData()!!.bytes)
throw AssertionError(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment