From 7d78d107d631bd9180179104da538fc4b6a917b7 Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:03:50 +0530 Subject: [PATCH] Add parallel test flag for test package --- ballerina-tests/build.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ballerina-tests/build.gradle b/ballerina-tests/build.gradle index a139510dc0..17f37b90d9 100644 --- a/ballerina-tests/build.gradle +++ b/ballerina-tests/build.gradle @@ -122,6 +122,7 @@ def debugParams = "" def balJavaDebugParam = "" def testParams = "" def graalvmFlag = "" +def parallelTestFlag = "" def skipTests = false task initializeVariables { @@ -140,6 +141,9 @@ task initializeVariables { if (project.hasProperty('balGraalVMTest')) { graalvmFlag = '--graalvm' } + if (project.hasProperty('balParallelTest')) { + parallelTestFlag = '--parallel' + } if (project.hasProperty('balTests')) { testPackages = project.findProperty('balTests').toString().split(",") } @@ -208,10 +212,10 @@ task ballerinaTest { environment "JAVA_OPTS", "-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true" if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine 'cmd', '/c', "${balJavaDebugParam} ${distributionBinPath}/bal.bat test ${graalvmFlag}" + - " ${testParams} ${groupParams} ${disableGroups} ${windowsDisableGroups} ${debugParams}" + - " && exit %%ERRORLEVEL%%" + " ${parallelTestFlag} ${testParams} ${groupParams} ${disableGroups} ${windowsDisableGroups}" + + " ${debugParams} && exit %%ERRORLEVEL%%" } else { - commandLine 'sh', '-c', "${distributionBinPath}/bal test ${graalvmFlag} ${testParams}" + + commandLine 'sh', '-c', "${distributionBinPath}/bal test ${graalvmFlag} ${parallelTestFlag} ${testParams}" + " ${groupParams} ${disableGroups} ${debugParams}" } }