mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Fix native tests in CircleCI (#514)
Fix an issue where the CI job attempts to install the wrong executable when on macOS/aarch64. Also, adjusts native test definitions in pkl-server to match pkl-core.
This commit is contained in:
@@ -24,15 +24,62 @@ tasks.test {
|
||||
exclude("**/NativeServerTest.*")
|
||||
}
|
||||
|
||||
val nativeTest by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:assembleNative")
|
||||
private fun Test.configureNativeTest() {
|
||||
testClassesDirs = files(tasks.test.get().testClassesDirs)
|
||||
classpath = tasks.test.get().classpath
|
||||
include("**/NativeServerTest.*")
|
||||
}
|
||||
|
||||
val testNative by tasks.existing
|
||||
testNative {
|
||||
dependsOn(nativeTest)
|
||||
val testMacExecutableAarch64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:macExecutableAarch64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testMacExecutableAmd64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:macExecutableAmd64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testLinuxExecutableAmd64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:linuxExecutableAmd64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testLinuxExecutableAarch64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:linuxExecutableAarch64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testAlpineExecutableAmd64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:alpineExecutableAmd64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testWindowsExecutableAmd64 by tasks.registering(Test::class) {
|
||||
dependsOn(":pkl-cli:windowsExecutableAmd64")
|
||||
configureNativeTest()
|
||||
}
|
||||
|
||||
val testNative by tasks.existing
|
||||
testNative {
|
||||
when {
|
||||
buildInfo.os.isMacOsX -> {
|
||||
dependsOn(testMacExecutableAmd64)
|
||||
if (buildInfo.arch == "aarch64") {
|
||||
dependsOn(testMacExecutableAarch64)
|
||||
}
|
||||
}
|
||||
buildInfo.os.isWindows -> {
|
||||
dependsOn(testWindowsExecutableAmd64)
|
||||
}
|
||||
buildInfo.os.isLinux && buildInfo.arch == "aarch64" -> {
|
||||
dependsOn(testLinuxExecutableAarch64)
|
||||
}
|
||||
buildInfo.os.isLinux && buildInfo.arch == "amd64" -> {
|
||||
dependsOn(testLinuxExecutableAmd64)
|
||||
if (buildInfo.hasMuslToolchain) {
|
||||
dependsOn(testAlpineExecutableAmd64)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user