Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(@W-15110550): remove migrator command #95

Merged
merged 8 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
OSX_LINUX_WINDOWS:
BUILD:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
Expand Down Expand Up @@ -54,16 +54,16 @@ jobs:
#Run regression tests
- name: Run regression test 2.7
run: |
./gradlew --stacktrace -PweaveTestSuiteVersion=2.7.0-SNAPSHOT native-cli-integration-tests:test
./gradlew --stacktrace -PweaveTestSuiteVersion=2.7.0-SNAPSHOT -DweaveSuiteVersion=2.7.0-SNAPSHOT native-cli-integration-tests:test
shell: bash
#Run regression tests
- name: Run regression test 2.6
run: |
./gradlew --stacktrace -PweaveTestSuiteVersion=2.6.1 native-cli-integration-tests:test
./gradlew --stacktrace -PweaveTestSuiteVersion=2.6.1 -DweaveSuiteVersion=2.6.1 native-cli-integration-tests:test
shell: bash
- name: Run regression test 2.4
run: |
./gradlew --stacktrace -PweaveTestSuiteVersion=2.4.0-HF-SNAPSHOT native-cli-integration-tests:test
./gradlew --stacktrace -PweaveTestSuiteVersion=2.4.0-HF-SNAPSHOT -DweaveSuiteVersion=2.4.0-HF-SNAPSHOT native-cli-integration-tests:test
shell: bash

# Generate distro
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ Commands:
wizard Wizard actions.
add Adds a new Wizard to your network of trusted wizards.
validate Validate if a script is valid or not.
migrate Translates a DW1 script into a DW2 script.
spell Runs the specified Spell.
create Creates a new spell with the given name.
list List all available spells.
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
weaveVersion=2.7.0-SNAPSHOT
weaveTestSuiteVersion=2.7.0-SNAPSHOT
weaveVersion=2.8.0-SNAPSHOT
weaveTestSuiteVersion=2.8.0-SNAPSHOT
nativeVersion=100.100.100
scalaVersion=2.12.15
ioVersion=1.0.0-SNAPSHOT
Expand Down
8 changes: 7 additions & 1 deletion native-cli-integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ task downloadTestSuites(type: Copy) {

downloadTestSuites.dependsOn(cleanTestSuites)
test.dependsOn(downloadTestSuites)
test.dependsOn(":native-cli:nativeCompile")
test.dependsOn(":native-cli:nativeCompile")

test {
if (System.getProperty("weaveSuiteVersion") != null) {
systemProperty "weaveSuiteVersion", System.getProperty("weaveSuiteVersion")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ class NativeCliRuntimeIT extends AnyFunSpec
private val INPUT_FILE_PATTERN = Pattern.compile("in[0-9]+\\.[a-zA-Z]+")
private val OUTPUT_FILE_PATTERN = Pattern.compile("out\\.[a-zA-Z]+")

private val versionString: String = DataWeaveVersion(ComponentVersion.weaveSuiteVersion).toString()
private val weaveVersion = System.getProperty("weaveSuiteVersion", ComponentVersion.weaveVersion)
println(s"****** Running with weaveSuiteVersion: $weaveVersion *******")
private val versionString: String = DataWeaveVersion(weaveVersion).toString()

val testSuites = Seq(
TestSuite("master", loadTestZipFile(s"weave-suites/runtime-${ComponentVersion.weaveSuiteVersion}-test.zip")),
TestSuite("yaml", loadTestZipFile(s"weave-suites/yaml-module-${ComponentVersion.weaveSuiteVersion}-test.zip"))
TestSuite("master", loadTestZipFile(s"weave-suites/runtime-$weaveVersion-test.zip")),
TestSuite("yaml", loadTestZipFile(s"weave-suites/yaml-module-$weaveVersion-test.zip"))
)

private def loadTestZipFile(testSuiteExample: String): File = {
Expand Down Expand Up @@ -366,6 +368,7 @@ class NativeCliRuntimeIT extends AnyFunSpec
"import-lib-with-alias",
"import-named-lib",
"import-star",
"lazy_metadata_definition",
"module-singleton",
"multipart-write-binary",
"read-binary-files",
Expand Down Expand Up @@ -397,6 +400,7 @@ class NativeCliRuntimeIT extends AnyFunSpec
Array("update-op") ++
// Take too long time
Array("array-concat") ++
Array("big_intersection") ++
Array("sql_date_mapping") ++
Array("runtime_run")

Expand Down Expand Up @@ -426,12 +430,17 @@ class NativeCliRuntimeIT extends AnyFunSpec
Array("as-operator",
"type-equality"
) ++
Array("xml_doctype", "stringutils_unwrap")
Array("xml_doctype", "stringutils_unwrap", "weave_ast_module")
} else if (versionString == "2.5") {
baseArray ++
Array("xml_doctype", "stringutils_unwrap")
}
else {
} else if (versionString == "2.6") {
baseArray ++
Array("weave_ast_module")
} else if (versionString == "2.7") {
baseArray ++
Array("weave_ast_module")
} else {
baseArray
}
testToIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,6 @@ class NativeCliTest extends AnyFreeSpec
DEFAULT_DW_CLI_HOME.mkdirs()
}

"it should execute simple migration correctly" in {
val stream: URL = getClass.getClassLoader.getResource("dw1/SimpleFile.dw1")
val file = new File(stream.toURI)
val (_, output, _) = NativeCliITTestRunner(Array("migrate", file.getAbsolutePath)).execute()
output.trim shouldBe
"""
|%dw 2.0
|var arr = ["foo"]
|---
|{
| a: [0, 1, 2] contains [1, 2],
| b: sum(1 to 1000),
| c: sizeOf(("123"))
|}
|""".stripMargin.trim
}

"it should execute simple case correctly" in {
val (_, output, _) = NativeCliITTestRunner(Array("run", "1 to 10")).execute()
output shouldBe "[\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10\n]"
Expand Down
2 changes: 0 additions & 2 deletions native-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
implementation group: 'org.mule.weave', name: 'xmlschema-module', version: weaveVersion
implementation group: 'org.mule.weave', name: 'http-module', version: ioVersion
implementation group: 'org.mule.weave', name: 'process-module', version: ioVersion
implementation group: 'org.mule.weave', name: 'migrant', version: '2.6.0-SNAPSHOT'
implementation(group: 'org.mule.weave', name: 'http-netty-module', version: ioVersion) {
exclude group: 'org.slf4j'
}
Expand Down Expand Up @@ -64,7 +63,6 @@ task genVersions() {
outputPrinter.println("object ComponentVersion {")
outputPrinter.println("\tval weaveVersion = \"" + weaveVersion + "\"")
outputPrinter.println("\tval nativeVersion = \"" + nativeVersion + "\"")
outputPrinter.println("\tval weaveSuiteVersion = \"" + weaveTestSuiteVersion + "\"")
outputPrinter.println("}")
outputPrinter.close()
}
Expand Down
2 changes: 0 additions & 2 deletions native-cli/src/main/java/org/mule/weave/cli/DWCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.mule.weave.cli.pico.PicoRepl;
import org.mule.weave.cli.pico.PicoRunScript;
import org.mule.weave.cli.pico.PicoRunSpell;
import org.mule.weave.cli.pico.PicoMigrate;
import org.mule.weave.cli.pico.PicoUpdateSpells;
import org.mule.weave.cli.pico.PicoValidateScript;
import org.mule.weave.cli.pico.PicoVersionProvider;
Expand Down Expand Up @@ -48,7 +47,6 @@ public void run(String[] args, Console console) {
PicoRunScript.class,
PicoWizard.class,
PicoValidateScript.class,
PicoMigrate.class,
PicoRunSpell.class,
CommandLine.HelpCommand.class,
PicoRepl.class
Expand Down

This file was deleted.

This file was deleted.

Loading