From f9c322ee21359352981c667d3b963f3870e93dfd Mon Sep 17 00:00:00 2001 From: RDPerera Date: Wed, 6 Mar 2024 12:16:25 +0530 Subject: [PATCH 1/5] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 2 +- ballerina/Dependencies.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 49b25dd..b946506 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "toml" -version = "0.5.0" +version = "0.5.1" authors = ["Ballerina"] keywords = ["toml"] repository = "https://github.com/ballerina-platform/module-ballerina-toml" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 7115982..b47783c 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -91,7 +91,7 @@ modules = [ [[package]] org = "ballerina" name = "toml" -version = "0.5.0" +version = "0.5.1" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, From eb99a2e962ac4ebcecabd176fd7f7ca6eff1e743 Mon Sep 17 00:00:00 2001 From: RDPerera Date: Thu, 7 Mar 2024 11:05:28 +0530 Subject: [PATCH 2/5] Add community-driven test suites --- ballerina/build.gradle | 24 ++++++++++++++++++++++++ ballerina/tests/it.bal | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index cd6cc8e..7f405e6 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -104,6 +104,30 @@ publishing { } } +task cloneTestRepo { + doLast { + def tempDir = new File("${project.buildDir}/tempTestRepo") + def testResourcesDir = new File("${project.projectDir}/tests/resources") + if (!testResourcesDir.exists()) { + testResourcesDir.mkdirs() + } + exec { + workingDir testResourcesDir.parentFile + commandLine 'git', 'clone', 'https://github.com/nipunayf/toml-test.git', testResourcesDir.name, '-b', 'resources' + } + } +} + +task cleanupTestRepo { + doLast { + def testResourcesDir = new File("${project.projectDir}/tests/resources") + testResourcesDir.deleteDir() + } +} + +test.finalizedBy cleanupTestRepo +test.dependsOn cloneTestRepo + updateTomlFiles.dependsOn copyStdlibs build.dependsOn "generatePomFileForMavenPublication" diff --git a/ballerina/tests/it.bal b/ballerina/tests/it.bal index 179341a..21699c8 100644 --- a/ballerina/tests/it.bal +++ b/ballerina/tests/it.bal @@ -16,7 +16,7 @@ import ballerina/test; @test:Config { dataProvider: validTomlDataGen, - enable: false + enable: true } function testValidTOML(string inputPath, json expectedOutput) returns error? { map output = check readFile(inputPath, {parseOffsetDateTime: false}); @@ -25,7 +25,7 @@ function testValidTOML(string inputPath, json expectedOutput) returns error? { @test:Config { dataProvider: invalidTomlDataGen, - enable: false + enable: true } function testInvalidTOML(string inputPath) { map|error output = readFile(inputPath); From 861ec7fe39a1e92b337140b295642def3d428e9f Mon Sep 17 00:00:00 2001 From: RDPerera Date: Thu, 7 Mar 2024 11:22:16 +0530 Subject: [PATCH 3/5] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index b47783c..c3d1921 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.8.0" +distribution-version = "2201.9.0-20240229-103900-a949e6d4" [[package]] org = "ballerina" @@ -38,6 +38,26 @@ org = "ballerina" name = "jballerina.java" version = "0.0.0" +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + [[package]] org = "ballerina" name = "lang.error" @@ -47,6 +67,12 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + [[package]] org = "ballerina" name = "lang.value" @@ -71,6 +97,7 @@ version = "0.0.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.error"} ] modules = [ From 3b584ba43401d8f7acb75320cae0a22cf9d684ec Mon Sep 17 00:00:00 2001 From: RDPerera Date: Thu, 7 Mar 2024 12:53:47 +0530 Subject: [PATCH 4/5] Remove unnecessary variable --- ballerina/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 7f405e6..43c0749 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -106,7 +106,6 @@ publishing { task cloneTestRepo { doLast { - def tempDir = new File("${project.buildDir}/tempTestRepo") def testResourcesDir = new File("${project.projectDir}/tests/resources") if (!testResourcesDir.exists()) { testResourcesDir.mkdirs() From 62e28a436f66e6cd9e1de784942b215a09af4785 Mon Sep 17 00:00:00 2001 From: RDPerera Date: Fri, 8 Mar 2024 10:07:56 +0530 Subject: [PATCH 5/5] Address review comments --- .gitmodules | 4 ++++ ballerina/Dependencies.toml | 29 +---------------------------- ballerina/build.gradle | 24 +++++------------------- ballerina/tests/it.bal | 6 ++---- ballerina/tests/resources | 1 + 5 files changed, 13 insertions(+), 51 deletions(-) create mode 100644 .gitmodules create mode 160000 ballerina/tests/resources diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5712cf2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "ballerina/tests/resources"] + path = ballerina/tests/resources + url = https://github.com/nipunayf/toml-test + branch = resources diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index c3d1921..b47783c 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.9.0-20240229-103900-a949e6d4" +distribution-version = "2201.8.0" [[package]] org = "ballerina" @@ -38,26 +38,6 @@ org = "ballerina" name = "jballerina.java" version = "0.0.0" -[[package]] -org = "ballerina" -name = "lang.__internal" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.object"} -] - -[[package]] -org = "ballerina" -name = "lang.array" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.__internal"} -] - [[package]] org = "ballerina" name = "lang.error" @@ -67,12 +47,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] -[[package]] -org = "ballerina" -name = "lang.object" -version = "0.0.0" -scope = "testOnly" - [[package]] org = "ballerina" name = "lang.value" @@ -97,7 +71,6 @@ version = "0.0.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.array"}, {org = "ballerina", name = "lang.error"} ] modules = [ diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 43c0749..fa14c06 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -104,29 +104,15 @@ publishing { } } -task cloneTestRepo { +task checkAndUpdateSubmodule { doLast { - def testResourcesDir = new File("${project.projectDir}/tests/resources") - if (!testResourcesDir.exists()) { - testResourcesDir.mkdirs() - } - exec { - workingDir testResourcesDir.parentFile - commandLine 'git', 'clone', 'https://github.com/nipunayf/toml-test.git', testResourcesDir.name, '-b', 'resources' - } + def initCommand = ['git', 'submodule', 'update', '--init', '--recursive'] + initCommand.execute(null, projectDir).waitFor() + println "Submodule initialized successfully." } } -task cleanupTestRepo { - doLast { - def testResourcesDir = new File("${project.projectDir}/tests/resources") - testResourcesDir.deleteDir() - } -} - -test.finalizedBy cleanupTestRepo -test.dependsOn cloneTestRepo - +test.dependsOn checkAndUpdateSubmodule updateTomlFiles.dependsOn copyStdlibs build.dependsOn "generatePomFileForMavenPublication" diff --git a/ballerina/tests/it.bal b/ballerina/tests/it.bal index 21699c8..2bb1cbc 100644 --- a/ballerina/tests/it.bal +++ b/ballerina/tests/it.bal @@ -15,8 +15,7 @@ import ballerina/test; @test:Config { - dataProvider: validTomlDataGen, - enable: true + dataProvider: validTomlDataGen } function testValidTOML(string inputPath, json expectedOutput) returns error? { map output = check readFile(inputPath, {parseOffsetDateTime: false}); @@ -24,8 +23,7 @@ function testValidTOML(string inputPath, json expectedOutput) returns error? { } @test:Config { - dataProvider: invalidTomlDataGen, - enable: true + dataProvider: invalidTomlDataGen } function testInvalidTOML(string inputPath) { map|error output = readFile(inputPath); diff --git a/ballerina/tests/resources b/ballerina/tests/resources new file mode 160000 index 0000000..eae1ebf --- /dev/null +++ b/ballerina/tests/resources @@ -0,0 +1 @@ +Subproject commit eae1ebf0b95f4bd63a5c647c3c1eb47f47cbdf57