From 8674c5db305ceca3571fcc72ca368742c3cc3b2d Mon Sep 17 00:00:00 2001 From: Tadeas Kriz Date: Fri, 12 Apr 2024 09:21:50 -0400 Subject: [PATCH] Add basic Gradle tests. --- .github/workflows/smoke-tests.yml | 24 ++ ....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 | 147 +++++++++++ .../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 ++ ...DarwinTargetsAllFrameworkArtifactsTests.kt | 54 ++++ ...rwinTargetsSingleFrameworkArtifactTests.kt | 54 ++++ ...ArtifactDsl_Framework_SingleTargetTests.kt | 50 ++++ ...ctDsl_XCFramework_AllDarwinTargetsTests.kt | 63 +++++ ...tifactDsl_XCFramework_SingleTargetTests.kt | 65 +++++ ...naryDsl_Framework_AllDarwinPresetsTests.kt | 39 +++ ...inBinaryDsl_Framework_SinglePresetTests.kt | 41 +++ ...inBinaryDsl_Framework_SingleTargetTests.kt | 40 +++ .../basic/NoArtifact_AllDarwinTargetsTests.kt | 24 ++ .../basic/NoArtifact_SingleTargetTests.kt | 28 +++ .../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 | 233 ++++++++++++++++++ .../skie/test/trait/gradle/BuildGradleFile.kt | 14 ++ .../gradle/GradleBuildFileBuilderTrait.kt | 11 + .../test/util/BuildResult.shouldBeSuccess.kt | 9 + .../test/util/BuildTask.shouldBeSuccess.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 ++ 82 files changed, 2042 insertions(+), 6 deletions(-) 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/basic/KotlinArtifactDsl_Framework_AllDarwinTargetsAllFrameworkArtifactsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_Framework_AllDarwinTargetsSingleFrameworkArtifactTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_Framework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_XCFramework_AllDarwinTargetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinArtifactDsl_XCFramework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_AllDarwinPresetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_SinglePresetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/KotlinBinaryDsl_Framework_SingleTargetTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/NoArtifact_AllDarwinTargetsTests.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/suite/gradle/basic/NoArtifact_SingleTargetTests.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/BuildResult.shouldBeSuccess.kt create mode 100644 test-runner/src/test/kotlin/co/touchlab/skie/test/util/BuildTask.shouldBeSuccess.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/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 4af15e079..d16409672 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -134,3 +134,27 @@ jobs: # check_name: "Smoke Test Reports - External Libraries Tests" # report_paths: 'SKIE/acceptance-tests/build/test-results/libraries__*/TEST-*.xml' # require_tests: true + + gradle-tests: + name: Gradle Tests + runs-on: macos-14 + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }} + - name: Prepare Worker + uses: ./.github/actions/prepare-worker + - name: Run Gradle Tests + uses: gradle/gradle-build-action@v2.4.2 + id: run-tests + with: + arguments: >- + :test + -PtestLevel=smoke + -PtestType=gradle + -Pmatrix.targets=${{ inputs.target }} + -Pmatrix.configurations=${{ inputs.configuration}} + -Pmatrix.linkModes=${{ inputs.linkage }} + build-root-directory: test-runner \ No newline at end of file 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 @@