-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dab30e0
commit 30c597e
Showing
76 changed files
with
2,232 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Smoke Tests [New] | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - '**' | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
demo: | ||
name: Demo Tests | ||
runs-on: ${{ matrix.host }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [ios_arm64, macos_arm64 ... ] | ||
link_mode: [static, dynamic] | ||
build_configuration: [debug, release] | ||
kotlin: [1.8.0, 1.8.10, 1.8.20, 1.8.21, 1.8.22, 1.9.0, 1.9.10, 1.9.20, 1.9.21, 1.9.22] | ||
k2enabled: [true, false] | ||
xcode: ["15.0"] | ||
host: [macos-14, macos-13, macos-12, ubuntu-latest, windows-latest] | ||
include: | ||
- host: green | ||
- color: pink | ||
animal: cat | ||
- fruit: apple | ||
shape: circle | ||
- fruit: banana | ||
- fruit: banana | ||
animal: cat | ||
|
||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} | ||
gradle: | ||
name: Gradle Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} | ||
acceptance: | ||
name: Acceptance Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} | ||
type-mapping: | ||
name: Type Mapping Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} | ||
libraries: | ||
name: External Libraries Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} | ||
performance: | ||
name: Performance Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: touchlab/SKIE@tk/smoke-tests | ||
with: | ||
github-token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,70 @@ | ||
import co.touchlab.skie.PublishSkieToTempMavenTask | ||
import org.gradle.tooling.GradleConnector | ||
|
||
plugins { | ||
kotlin("jvm") version "1.9.22" | ||
} | ||
|
||
dependencies { | ||
implementation(kotlin("test")) | ||
implementation(gradleTestKit()) | ||
implementation(libs.kotlinPoet) | ||
implementation(libs.bundles.kotest) | ||
} | ||
|
||
println("Start: ${gradle.startParameter}") | ||
|
||
val smokeTestRepository = layout.buildDirectory.dir("smokeTestRepo") | ||
|
||
|
||
val publishSkieToTempMaven by tasks.registering(PublishSkieToTempMavenTask::class) { | ||
skieSources = rootDir.resolve("../SKIE") | ||
tempRepository = smokeTestRepository | ||
} | ||
|
||
testing { | ||
suites { | ||
val test by getting(JvmTestSuite::class) { | ||
useJUnitJupiter("5.10.1") | ||
|
||
dependencies { | ||
implementation("org.junit.platform:junit-platform-suite:1.10.2") | ||
implementation("org.junit.platform:junit-platform-reporting:1.10.2") | ||
} | ||
|
||
targets.all { | ||
testTask.configure { | ||
minHeapSize = "1024m" | ||
maxHeapSize = "4024m" | ||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) | ||
|
||
dependsOn(publishSkieToTempMaven) | ||
|
||
systemProperty("smokeTestRepository", smokeTestRepository.get().asFile.absolutePath) | ||
systemProperty("junit.platform.reporting.open.xml.enabled", "true") | ||
systemProperty("junit.platform.reporting.output.dir", reports.junitXml.outputLocation.get().asFile.absolutePath.also { | ||
println("Junitxml: ${it}") | ||
}) | ||
|
||
listOf( | ||
"testLevel", | ||
"testTypes", | ||
"matrix.targets", | ||
"matrix.configurations", | ||
"matrix.linkModes", | ||
"matrix.kotlinVersions", | ||
"matrix.gradleVersions", | ||
).forEach { property -> | ||
val propertyValue = findProperty(property) ?: return@forEach | ||
systemProperty(property, propertyValue) | ||
} | ||
|
||
testLogging { | ||
events("passed", "skipped", "failed") | ||
showStandardStreams = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
40 changes: 40 additions & 0 deletions
40
test-runner/buildSrc/src/main/kotlin/co/touchlab/skie/PublishSkieToTempMavenTask.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,40 @@ | ||
package co.touchlab.skie | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.tasks.InputDirectory | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.tooling.GradleConnector | ||
import javax.inject.Inject | ||
|
||
abstract class PublishSkieToTempMavenTask @Inject constructor(objects: ObjectFactory): DefaultTask() { | ||
// This is @Internal because we only want `.kt` files to be considered as inputs, which we do in `init { }` | ||
@get:Internal | ||
val skieSources: DirectoryProperty = objects.directoryProperty() | ||
|
||
@get:OutputDirectory | ||
val tempRepository: DirectoryProperty = objects.directoryProperty() | ||
|
||
init { | ||
inputs.files(skieSources.map { it.asFileTree.matching { this.include { it.file.extension == "kt" } }.also { println(it.files.joinToString("\n") { it.absolutePath }) } }) | ||
} | ||
|
||
@TaskAction | ||
fun publish() { | ||
GradleConnector.newConnector() | ||
.forProjectDirectory(skieSources.get().asFile) | ||
.connect() | ||
.use { projectConnection -> | ||
projectConnection.newBuild() | ||
.forTasks("publishAllPublicationsToSmokeTestTmpRepository") | ||
.setStandardInput(System.`in`) | ||
.setStandardOutput(System.out) | ||
.setStandardError(System.err) | ||
.addArguments("-PsmokeTestTmpRepositoryPath=${tempRepository.get().asFile.absolutePath}") | ||
.run() | ||
} | ||
} | ||
} |
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 @@ | ||
../common-gradle/gradle |
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 @@ | ||
../common-gradle/gradle.properties |
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 @@ | ||
../common-gradle/gradlew |
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 @@ | ||
../common-gradle/gradlew.bat |
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,14 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
google() | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/MatrixTest.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,13 @@ | ||
package co.touchlab.skie.test.annotation | ||
|
||
import co.touchlab.skie.test.runner.SkieTestRunner | ||
import co.touchlab.skie.test.runner.condition.SmokeTestCondition | ||
import org.junit.jupiter.api.TestTemplate | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
|
||
@TestTemplate | ||
@ExtendWith(SkieTestRunner::class) | ||
@ExtendWith(SmokeTestCondition::class) | ||
@Target(AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
annotation class MatrixTest |
17 changes: 17 additions & 0 deletions
17
test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Exclude.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,17 @@ | ||
package co.touchlab.skie.test.annotation.filter | ||
|
||
import org.intellij.lang.annotations.Language | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Repeatable | ||
annotation class Exclude( | ||
@Language("RegExp") | ||
val targets: String = ".*", | ||
@Language("RegExp") | ||
val configurations: String = ".*", | ||
@Language("RegExp") | ||
val linkModes: String = ".*", | ||
@Language("RegExp") | ||
val kotlinVersions: String = ".*" | ||
) |
7 changes: 7 additions & 0 deletions
7
test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Filter.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,7 @@ | ||
package co.touchlab.skie.test.annotation.filter | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
annotation class Filter( | ||
|
||
) |
17 changes: 17 additions & 0 deletions
17
test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Include.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,17 @@ | ||
package co.touchlab.skie.test.annotation.filter | ||
|
||
import org.intellij.lang.annotations.Language | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Repeatable | ||
annotation class Include( | ||
@Language("RegExp") | ||
val targets: String = ".*", | ||
@Language("RegExp") | ||
val configurations: String = ".*", | ||
@Language("RegExp") | ||
val linkModes: String = ".*", | ||
@Language("RegExp") | ||
val kotlinVersions: String = ".*" | ||
) |
8 changes: 8 additions & 0 deletions
8
test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyDebug.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,8 @@ | ||
package co.touchlab.skie.test.annotation.filter | ||
|
||
import co.touchlab.skie.test.runner.BuildConfiguration | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@OnlyFor(configurations = [BuildConfiguration.Debug]) | ||
annotation class OnlyDebug |
Oops, something went wrong.