Skip to content

Commit b0d84c5

Browse files
authored
W-20004524: Onboard core-modules tests (#100)
1 parent bf61284 commit b0d84c5

6 files changed

Lines changed: 32 additions & 23 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
# version: ${{env.GRAALVM_VERSION}}
4343
java-version: '24'
44-
distribution: 'graalvm'
44+
distribution: 'graalvm-community'
4545
github-token: ${{ secrets.GITHUB_TOKEN }}
4646

4747
# Runs a single command using the runners shell
@@ -50,11 +50,10 @@ jobs:
5050
./gradlew --stacktrace --no-problems-report build
5151
shell: bash
5252
#Run regression tests
53-
- name: Run regression test 2.9.0
53+
- name: Run regression test 2.9.8
5454
run: |
55-
./gradlew --stacktrace -PweaveTestSuiteVersion=2.9.0 -DweaveSuiteVersion=2.9.0 native-cli-integration-tests:test
55+
./gradlew --stacktrace -PweaveTestSuiteVersion=2.9.8 -DweaveSuiteVersion=2.9.8 native-cli-integration-tests:test
5656
shell: bash
57-
#Run regression tests
5857
- name: Run regression test 2.10
5958
run: |
6059
./gradlew --stacktrace -PweaveTestSuiteVersion=2.10.0 -DweaveSuiteVersion=2.10.0 native-cli-integration-tests:test

.github/workflows/release.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ jobs:
1212
RELEASE_EXTENSION:
1313
strategy:
1414
matrix:
15-
os: [macos-latest, ubuntu-latest, windows-latest]
15+
# os: [macos-latest, ubuntu-latest, windows-latest]
16+
os: [ ubuntu-latest, windows-latest ]
1617
include:
17-
- os: windows-latest
18-
script_name: windows
18+
# - os: windows-latest
19+
# script_name: windows
1920
- os: ubuntu-latest
2021
script_name: linux
2122
- os: macos-latest
@@ -25,21 +26,18 @@ jobs:
2526
# Steps represent a sequence of tasks that will be executed as part of the job
2627
steps:
2728
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28-
- uses: actions/checkout@v2
29-
30-
# Read graalvm version
31-
- name: Read Graalvm version
32-
run: |
33-
echo "GRAALVM_VERSION=$(grep graalvmVersion gradle.properties | cut -d '=' -f2)" >> $GITHUB_ENV
34-
shell: bash
35-
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup Gradle
32+
uses: gradle/actions/setup-gradle@v3
33+
3634
# Setup Graalvm
3735
- name: Setup Graalvm
3836
uses: graalvm/setup-graalvm@v1
3937
with:
40-
version: ${{env.GRAALVM_VERSION}}
38+
# version: ${{env.GRAALVM_VERSION}}
4139
java-version: '24'
42-
components: 'native-image'
40+
distribution: 'graalvm-community'
4341
github-token: ${{ secrets.GITHUB_TOKEN }}
4442

4543
- name: Guess Extension Version

native-cli-integration-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919

2020
weaveSuite "org.mule.weave:runtime:${weaveTestSuiteVersion}:test@zip"
2121
weaveSuite "org.mule.weave:yaml-module:${weaveTestSuiteVersion}:test@zip"
22+
weaveSuite "org.mule.weave:core-modules:${weaveTestSuiteVersion}:test@zip"
2223
testRuntimeOnly 'com.vladsch.flexmark:flexmark-all:0.64.8'
2324
// https://mvnrepository.com/artifact/org.scalatest/scalatest
2425
testImplementation group: 'org.scalatest', name: 'scalatest_2.12', version: '3.2.19'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 to 10

native-cli-integration-tests/src/test/scala/org/mule/weave/clinative/NativeCliTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.scalatest.freespec.AnyFreeSpec
66
import org.scalatest.matchers.should.Matchers
77

88
import java.io.File
9-
import java.net.URL
109

1110
class NativeCliTest extends AnyFreeSpec
1211
with Matchers
@@ -25,7 +24,8 @@ class NativeCliTest extends AnyFreeSpec
2524
}
2625

2726
"it should execute simple case correctly" in {
28-
val (_, output, _) = NativeCliITTestRunner(Array("run", "1 to 10")).execute()
27+
val transformationPath = getResourcePath("scripts/Range.dwl")
28+
val (_, output, _) = NativeCliITTestRunner(Array("run", "-f", transformationPath)).execute()
2929
output shouldBe "[\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10\n]"
3030
}
3131

native-cli-integration-tests/src/test/scala/org/mule/weave/clinative/TCKCliTest.scala

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class TCKCliTest extends AnyFunSpec with Matchers
4949

5050
val testSuites = Seq(
5151
TestSuite("runtime-tests", loadTestZipFile(s"weave-suites/runtime-$weaveVersion-test.zip")),
52-
TestSuite("yaml-tests", loadTestZipFile(s"weave-suites/yaml-module-$weaveVersion-test.zip"))
52+
TestSuite("yaml-tests", loadTestZipFile(s"weave-suites/yaml-module-$weaveVersion-test.zip")),
53+
TestSuite("core-modules-tests", loadTestZipFile(s"weave-suites/core-modules-$weaveVersion-test.zip"))
5354
)
5455

5556
private def loadTestZipFile(testSuiteExample: String): File = {
@@ -300,9 +301,7 @@ class TCKCliTest extends AnyFunSpec with Matchers
300301
"try-handle-materialized-object-with-failures",
301302
"try-handle-name-value-pair-value-with-failures",
302303
"try-handle-schema-property-value-with-failures",
303-
"try-handle-schema-value-with-failures",
304-
"try-handle-lazy-values-with-failures",
305-
"math-toRadians",
304+
"try-handle-schema-value-with-failures"
306305
)
307306

308307
val testToIgnore = if (versionString == "2.4") {
@@ -341,6 +340,17 @@ class TCKCliTest extends AnyFunSpec with Matchers
341340
} else if (versionString == "2.7") {
342341
baseArray ++
343342
Array("weave_ast_module")
343+
} else if (versionString == "2.9") {
344+
baseArray ++
345+
Array(
346+
"math-toRadians",
347+
"try-handle-lazy-values-with-failures"
348+
)
349+
} else if (versionString == "2.10") {
350+
baseArray ++
351+
Array(
352+
"try-handle-lazy-values-with-failures"
353+
)
344354
} else {
345355
baseArray
346356
}

0 commit comments

Comments
 (0)