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: ...@@ -25,11 +25,11 @@ jobs:
- shell: bash - shell: bash
name: 'Compile and run AWT tests' 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 - shell: bash
name: 'Compile and run macOS x64 tests' 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 - shell: bash
name: 'Publish to Maven Local, check AWT sample' name: 'Publish to Maven Local, check AWT sample'
...@@ -83,12 +83,12 @@ jobs: ...@@ -83,12 +83,12 @@ jobs:
max_attempts: 10 max_attempts: 10
timeout_minutes: 60 timeout_minutes: 60
shell: bash 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 # iosSimulatorArm64Test will build the binary but the tests will be skipped due to X64 host machine
- shell: bash - shell: bash
name: 'Compile iOS arm64 tests' 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 # TODO run iOS specific tests on iPhone simulator
- shell: bash - shell: bash
...@@ -118,9 +118,9 @@ jobs: ...@@ -118,9 +118,9 @@ jobs:
- shell: bash - shell: bash
run: | 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 # 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 - uses: actions/upload-artifact@v4
if: always() if: always()
...@@ -170,21 +170,25 @@ jobs: ...@@ -170,21 +170,25 @@ jobs:
name: 'Compile and run Linux x64 tests' name: 'Compile and run Linux x64 tests'
run: | run: |
export DISPLAY=:0 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 # Linux arm64 tests are executed on a separate runner
- shell: bash - shell: bash
name: 'Compile Linux arm64 tests' name: 'Compile Linux arm64 tests'
run: | 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 - shell: bash
name: 'Compile and run AWT tests' name: 'Compile and run AWT tests'
run: | run: |
export DISPLAY=:0 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 timeout-minutes: 25
- name: Clean Gradle cache to recover disk space
run: |
rm -rf ~/.gradle/caches
- shell: bash - shell: bash
name: 'Publish to Maven Local, check AWT sample' name: 'Publish to Maven Local, check AWT sample'
env: env:
...@@ -250,7 +254,7 @@ jobs: ...@@ -250,7 +254,7 @@ jobs:
name: 'Compile and run AWT tests' name: 'Compile and run AWT tests'
run: | run: |
export DISPLAY=:0 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 timeout-minutes: 25
- shell: bash - shell: bash
...@@ -287,7 +291,7 @@ jobs: ...@@ -287,7 +291,7 @@ jobs:
# OPENGL is ignored as it doesn't exist on the Windows GitHub agent # OPENGL is ignored as it doesn't exist on the Windows GitHub agent
- shell: bash - shell: bash
name: 'Compile and run AWT tests' 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 - shell: bash
name: 'Publish to Maven Local, check AWT sample' name: 'Publish to Maven Local, check AWT sample'
......
...@@ -13,6 +13,7 @@ import org.junit.Test ...@@ -13,6 +13,7 @@ import org.junit.Test
import java.awt.Point import java.awt.Point
import javax.swing.WindowConstants import javax.swing.WindowConstants
import kotlin.math.* import kotlin.math.*
import kotlin.time.Duration.Companion.nanoseconds
@Suppress("BlockingMethodInNonBlockingContext", "SameParameterValue") @Suppress("BlockingMethodInNonBlockingContext", "SameParameterValue")
class SkiaLayerPerformanceTest { class SkiaLayerPerformanceTest {
...@@ -75,6 +76,13 @@ class SkiaLayerPerformanceTest { ...@@ -75,6 +76,13 @@ class SkiaLayerPerformanceTest {
println("Deltas " + millis.map { String.format("%.1f", it) }) println("Deltas " + millis.map { String.format("%.1f", it) })
println("Average %.2f".format(millis.average())) println("Average %.2f".format(millis.average()))
println("Standard deviation %.2f".format(millis.stddev())) 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 { fun deviateMessage(percent: Double, deviated: List<Long>): String {
val deviatedStr = deviated.map { String.format("%.1f", it / 1E6) } val deviatedStr = deviated.map { String.format("%.1f", it / 1E6) }
......
...@@ -829,8 +829,8 @@ class SkiaLayerTest { ...@@ -829,8 +829,8 @@ class SkiaLayerTest {
val dt = renderTimes.last() - renderTimes.first() val dt = renderTimes.last() - renderTimes.first()
assertTrue( assertTrue(
actual = dt < 100, actual = dt < 150,
message = "2nd frame drawn ${dt}ms after 1st" message = "2nd frame drawn ${dt}ms after 1st: ${renderTimes.map { it - renderTimes.first() }}}"
) )
renderTimes.clear() renderTimes.clear()
} }
......
...@@ -59,7 +59,7 @@ class ScreenshotTestRule : TestRule { ...@@ -59,7 +59,7 @@ class ScreenshotTestRule : TestRule {
} }
if (expectedFile.exists()) { if (expectedFile.exists()) {
val expected = Image.makeFromEncoded(expectedFile.readBytes()) 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)) { if (!isContentSame(expected, actual, sensitivity = 0.25)) {
actualFile.writeBytes(actual.encodeToData()!!.bytes) actualFile.writeBytes(actual.encodeToData()!!.bytes)
throw AssertionError( 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