From 30c597e526b828039373dd8324ab1f895cd9006b Mon Sep 17 00:00:00 2001 From: Tadeas Kriz Date: Thu, 11 Apr 2024 09:55:42 -0400 Subject: [PATCH] [WIP] Add new test-runner. --- .github/workflows/new-smoke-tests.yml | 74 ++++ ....xml => Tests_Acceptance_Selected.run.xml} | 4 +- .../buildsetup/plugins/DevAcceptanceTests.kt | 2 +- .../buildsetup/plugins/SkiePublishable.kt | 15 + common-gradle/gradle.properties | 6 + common-gradle/gradle/libs.versions.toml | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- test-runner/build.gradle.kts | 70 ++++ test-runner/buildSrc/build.gradle.kts | 7 + .../skie/PublishSkieToTempMavenTask.kt | 40 ++ test-runner/gradle | 1 + test-runner/gradle.properties | 1 + test-runner/gradlew | 1 + test-runner/gradlew.bat | 1 + test-runner/settings.gradle.kts | 14 + .../skie/test/annotation/MatrixTest.kt | 13 + .../skie/test/annotation/filter/Exclude.kt | 17 + .../skie/test/annotation/filter/Filter.kt | 7 + .../skie/test/annotation/filter/Include.kt | 17 + .../skie/test/annotation/filter/OnlyDebug.kt | 8 + .../test/annotation/filter/OnlyDynamic.kt | 8 + .../skie/test/annotation/filter/OnlyFor.kt | 15 + .../skie/test/annotation/filter/OnlyIos.kt | 8 + .../skie/test/annotation/filter/OnlyMacos.kt | 8 + .../test/annotation/filter/OnlyRelease.kt | 8 + .../skie/test/annotation/filter/OnlyStatic.kt | 8 + .../skie/test/annotation/filter/Smoke.kt | 5 + .../skie/test/annotation/filter/SmokeOnly.kt | 6 + .../test/annotation/type/AcceptanceTests.kt | 7 + .../skie/test/annotation/type/DemoTests.kt | 7 + .../annotation/type/ExternalLibrariesTests.kt | 7 + .../skie/test/annotation/type/GradleTests.kt | 7 + .../test/annotation/type/PerformanceTests.kt | 7 + .../skie/test/annotation/type/SkieTestType.kt | 10 + .../test/annotation/type/TypeMappingTests.kt | 7 + .../skie/test/base/BaseGradleTests.kt | 136 +++++++ .../skie/test/runner/BuildConfiguration.kt | 6 + .../touchlab/skie/test/runner/MatrixFilter.kt | 36 ++ .../skie/test/runner/SkieMatrixExtension.kt | 19 + .../skie/test/runner/SkieTestMatrix.kt | 41 ++ .../skie/test/runner/SkieTestMatrixContext.kt | 25 ++ .../skie/test/runner/SkieTestRunner.kt | 36 ++ .../runner/SkieTestRunnerConfiguration.kt | 140 +++++++ .../co/touchlab/skie/test/runner/TestLevel.kt | 6 + .../co/touchlab/skie/test/runner/TestType.kt | 10 + .../runner/condition/SmokeTestCondition.kt | 27 ++ .../runner/condition/TestTypeCondition.kt | 20 + .../KotlinArtifactDsl_Framework_Tests.kt | 137 +++++++ .../KotlinArtifactDsl_NoArtifact_Tests.kt | 24 ++ .../KotlinArtifactDsl_XCFramework_Tests.kt | 355 ++++++++++++++++++ .../basic/BasicGradle_AllDarwinPresets.kt | 79 ++++ .../gradle/basic/BasicGradle_SinglePreset.kt | 41 ++ .../gradle/basic/BasicGradle_SingleTarget.kt | 40 ++ .../touchlab/skie/test/template/Template.kt | 6 + .../test/template/TemplateBuilderScope.kt | 7 + .../skie/test/template/TemplateFile.kt | 14 + .../touchlab/skie/test/template/Templates.kt | 10 + .../skie/test/template/buildTemplate.kt | 38 ++ .../skie/test/trait/TestUtilsTrait.kt | 22 ++ .../test/trait/gradle/BuildGradleBuilder.kt | 186 +++++++++ .../skie/test/trait/gradle/BuildGradleFile.kt | 14 + .../gradle/GradleBuildFileBuilderTrait.kt | 11 + .../touchlab/skie/test/util/CommandResult.kt | 3 + .../touchlab/skie/test/util/GradleVersion.kt | 7 + .../touchlab/skie/test/util/KotlinTarget.kt | 123 ++++++ .../skie/test/util/KotlinTargetOrPreset.kt | 36 ++ .../touchlab/skie/test/util/KotlinVersion.kt | 7 + .../co/touchlab/skie/test/util/LinkMode.kt | 9 + .../skie/test/util/RawKotlinTarget.kt | 11 + .../skie/test/util/SkieBinaryTarget.kt | 11 + .../touchlab/skie/test/util/String.execute.kt | 43 +++ .../skie/test/util/StringBuilderScope.kt | 7 + .../co/touchlab/skie/test/util/buildString.kt | 17 + .../test/resources/junit-platform.properties | 7 + .../templates/basic/BasicSkieFeatures.kt | 25 ++ .../test/resources/templates/basic/main.swift | 22 ++ 76 files changed, 2232 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/new-smoke-tests.yml rename SKIE/.run/{Latest_Tests_Acceptance_Selected.run.xml => Tests_Acceptance_Selected.run.xml} (96%) create mode 100644 test-runner/build.gradle.kts create mode 100644 test-runner/buildSrc/build.gradle.kts create mode 100644 test-runner/buildSrc/src/main/kotlin/co/touchlab/skie/PublishSkieToTempMavenTask.kt create mode 120000 test-runner/gradle create mode 120000 test-runner/gradle.properties create mode 120000 test-runner/gradlew create mode 120000 test-runner/gradlew.bat create mode 100644 test-runner/settings.gradle.kts create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/MatrixTest.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Exclude.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Filter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Include.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyDebug.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyDynamic.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyFor.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyIos.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyMacos.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyRelease.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/OnlyStatic.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/Smoke.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/filter/SmokeOnly.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/AcceptanceTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/DemoTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/ExternalLibrariesTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/GradleTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/PerformanceTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/SkieTestType.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/annotation/type/TypeMappingTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/base/BaseGradleTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/BuildConfiguration.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/MatrixFilter.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieMatrixExtension.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestMatrix.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestMatrixContext.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestRunner.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/SkieTestRunnerConfiguration.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/TestLevel.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/TestType.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/condition/SmokeTestCondition.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/runner/condition/TestTypeCondition.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/artifact/KotlinArtifactDsl_Framework_Tests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/artifact/KotlinArtifactDsl_NoArtifact_Tests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/artifact/KotlinArtifactDsl_XCFramework_Tests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/BasicGradle_AllDarwinPresets.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/BasicGradle_SinglePreset.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/BasicGradle_SingleTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/Template.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/TemplateBuilderScope.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/TemplateFile.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/Templates.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/template/buildTemplate.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/TestUtilsTrait.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/BuildGradleBuilder.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/BuildGradleFile.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/trait/gradle/GradleBuildFileBuilderTrait.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/CommandResult.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/GradleVersion.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinTargetOrPreset.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/KotlinVersion.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/LinkMode.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/RawKotlinTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/SkieBinaryTarget.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/String.execute.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/StringBuilderScope.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/buildString.kt create mode 100644 test-runner/src/test/resources/junit-platform.properties create mode 100644 test-runner/src/test/resources/templates/basic/BasicSkieFeatures.kt create mode 100644 test-runner/src/test/resources/templates/basic/main.swift diff --git a/.github/workflows/new-smoke-tests.yml b/.github/workflows/new-smoke-tests.yml new file mode 100644 index 000000000..da027a54c --- /dev/null +++ b/.github/workflows/new-smoke-tests.yml @@ -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 }} diff --git a/SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml b/SKIE/.run/Tests_Acceptance_Selected.run.xml similarity index 96% rename from SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml rename to SKIE/.run/Tests_Acceptance_Selected.run.xml index 6fb27d8bf..9bfaaa1af 100644 --- a/SKIE/.run/Latest_Tests_Acceptance_Selected.run.xml +++ b/SKIE/.run/Tests_Acceptance_Selected.run.xml @@ -3,7 +3,7 @@