diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/testable/TestArguments.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/testable/TestArguments.java index 6b09dd6d3b27..73fb7031e6c4 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/testable/TestArguments.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/testable/TestArguments.java @@ -28,7 +28,7 @@ */ public class TestArguments { - private static final int ARGUMENTS_NUMBER = 10; + private static final int ARGUMENTS_NUMBER = 11; private final Class[] argTypes; private final Object[] argValues; @@ -49,6 +49,7 @@ public TestArguments(String... args) { assignValues(7, args[7]); assignValues(8, args[8]); assignValues(9, args[9]); + assignValues(10, args[10]); } public Object[] getArgValues() { diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/TestCommand.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/TestCommand.java index 9b9dc83130f3..17cee10e564c 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/TestCommand.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/TestCommand.java @@ -132,6 +132,9 @@ public TestCommand() { @CommandLine.Option(names = "--debug", description = "start in remote debugging mode") private String debugPort; + @CommandLine.Option(names = "--parallel", description = "enable parallel execution", defaultValue = "false") + private boolean isParallelExecution; + @CommandLine.Option(names = "--list-groups", description = "list the groups available in the tests") private boolean listGroups; @@ -343,10 +346,10 @@ public void execute() { .addTask(new CompileTask(outStream, errStream, false, isPackageModified, buildOptions.enableCache())) // .addTask(new CopyResourcesTask(), listGroups) // merged with CreateJarTask .addTask(new RunTestsTask(outStream, errStream, rerunTests, groupList, disableGroupList, testList, - includes, coverageFormat, moduleMap, listGroups, excludes, cliArgs), + includes, coverageFormat, moduleMap, listGroups, excludes, cliArgs, isParallelExecution), project.buildOptions().nativeImage()) .addTask(new RunNativeImageTestTask(outStream, rerunTests, groupList, disableGroupList, - testList, includes, coverageFormat, moduleMap, listGroups), + testList, includes, coverageFormat, moduleMap, listGroups, isParallelExecution), !project.buildOptions().nativeImage()) .addTask(new DumpBuildTimeTask(outStream), !project.buildOptions().dumpBuildTime()) .build(); diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunNativeImageTestTask.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunNativeImageTestTask.java index 8ea430c39458..d952262c96f9 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunNativeImageTestTask.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunNativeImageTestTask.java @@ -135,12 +135,13 @@ public void run() { private boolean isRerunTestExecution; private String singleExecTests; private boolean listGroups; + private final boolean isParallelExecution; TestReport testReport; public RunNativeImageTestTask(PrintStream out, boolean rerunTests, String groupList, String disableGroupList, String testList, String includes, String coverageFormat, - Map modules, boolean listGroups) { + Map modules, boolean listGroups, boolean isParallelExecution) { this.out = out; this.isRerunTestExecution = rerunTests; @@ -154,6 +155,7 @@ public RunNativeImageTestTask(PrintStream out, boolean rerunTests, String groupL singleExecTests = testList; } this.listGroups = listGroups; + this.isParallelExecution = isParallelExecution; } @@ -556,6 +558,7 @@ private int runTestSuiteWithNativeImage(Package currentPackage, Target target, cmdArgs.add(this.singleExecTests != null ? this.singleExecTests : ""); cmdArgs.add(Boolean.toString(isRerunTestExecution)); cmdArgs.add(Boolean.toString(listGroups)); // 8 + cmdArgs.add(Boolean.toString(isParallelExecution)); builder.command(cmdArgs.toArray(new String[0])); process = builder.start(); diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunTestsTask.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunTestsTask.java index 9d04a339edcf..eb673698d543 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunTestsTask.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/RunTestsTask.java @@ -108,6 +108,8 @@ public class RunTestsTask implements Task { private boolean listGroups; private final List cliArgs; + private final boolean isParallelExecution; + TestReport testReport; private static final Boolean isWindows = System.getProperty("os.name").toLowerCase(Locale.getDefault()) .contains("win"); @@ -122,11 +124,13 @@ public class RunTestsTask implements Task { public RunTestsTask(PrintStream out, PrintStream err, boolean rerunTests, String groupList, String disableGroupList, String testList, String includes, String coverageFormat, - Map modules, boolean listGroups, String excludes, String[] cliArgs) { + Map modules, boolean listGroups, String excludes, String[] cliArgs, + boolean isParallelExecution) { this.out = out; this.err = err; this.isRerunTestExecution = rerunTests; this.cliArgs = List.of(cliArgs); + this.isParallelExecution = isParallelExecution; if (disableGroupList != null) { this.disableGroupList = disableGroupList; @@ -349,6 +353,7 @@ private int runTestSuite(Target target, Package currentPackage, JBallerinaBacken cmdArgs.add(this.singleExecTests != null ? this.singleExecTests : ""); cmdArgs.add(Boolean.toString(isRerunTestExecution)); cmdArgs.add(Boolean.toString(listGroups)); + cmdArgs.add(Boolean.toString(isParallelExecution)); cliArgs.forEach((arg) -> { cmdArgs.add(arg); }); diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/NativeUtils.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/NativeUtils.java index fa38368926e4..cf931cbc3e5d 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/NativeUtils.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/utils/NativeUtils.java @@ -65,17 +65,18 @@ public class NativeUtils { private static final ReflectConfigClassMethod REFLECTION_CONFIG_EXECUTE_METHOD = new ReflectConfigClassMethod( TEST_EXEC_FUNCTION, new String[]{"io.ballerina.runtime.internal.scheduling.Strand", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString", - "io.ballerina.runtime.api.values.BString" - }); + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString", + "io.ballerina.runtime.api.values.BString" + }); //Add dynamically loading classes and methods to reflection config public static void createReflectConfig(Path nativeConfigPath, Package currentPackage, diff --git a/cli/ballerina-cli/src/main/resources/cli-help/ballerina-test.help b/cli/ballerina-cli/src/main/resources/cli-help/ballerina-test.help index 494e582d6c20..bc93df3da266 100755 --- a/cli/ballerina-cli/src/main/resources/cli-help/ballerina-test.help +++ b/cli/ballerina-cli/src/main/resources/cli-help/ballerina-test.help @@ -90,6 +90,8 @@ OPTIONS --graalvm-build-options Additional build options to be passed to the GraalVM native image. + --parallel + Enable parallel execution of tests. ARGUMENTS (-Ckey=value)... diff --git a/cli/ballerina-cli/src/test/resources/test-resources/balTestWithStickyFlag/project_b_100/resources/expectedDeps.toml b/cli/ballerina-cli/src/test/resources/test-resources/balTestWithStickyFlag/project_b_100/resources/expectedDeps.toml index 9aa444443339..46d0b588b37c 100644 --- a/cli/ballerina-cli/src/test/resources/test-resources/balTestWithStickyFlag/project_b_100/resources/expectedDeps.toml +++ b/cli/ballerina-cli/src/test/resources/test-resources/balTestWithStickyFlag/project_b_100/resources/expectedDeps.toml @@ -13,6 +13,26 @@ name = "jballerina.java" version = "0.0.0" scope = "testOnly" +[[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" @@ -22,6 +42,12 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + [[package]] org = "ballerina" name = "test" @@ -29,6 +55,7 @@ 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/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TestFunctionVisitor.java b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TestFunctionVisitor.java index c76d1188805f..66173548c58b 100644 --- a/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TestFunctionVisitor.java +++ b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TestFunctionVisitor.java @@ -39,15 +39,18 @@ public class TestFunctionVisitor extends NodeVisitor { static final List TEST_STATIC_ANNOTATION_NAMES = List.of( "Config", "BeforeSuite", "AfterSuite", "BeforeGroups", "AfterGroups", "BeforeEach", "AfterEach"); + static final String CONFIG_ANNOTATION = "Config"; private static final String TEST_DYNAMIC_ANNOTATION_NAME = "Factory"; private static final String TEST_MODULE_NAME = "test"; - private final List testStaticFunctions; + private final List testSetUpTearDownFunctions; private final List testDynamicFunctions; + private final List testFunctions; public TestFunctionVisitor() { - this.testStaticFunctions = new ArrayList<>(); + this.testSetUpTearDownFunctions = new ArrayList<>(); this.testDynamicFunctions = new ArrayList<>(); + this.testFunctions = new ArrayList<>(); } @Override @@ -73,7 +76,11 @@ public void visit(FunctionDefinitionNode functionDefinitionNode) { String identifier = qualifiedNameReferenceNode.identifier().text(); if (TEST_MODULE_NAME.equals(modulePrefix)) { if (TEST_STATIC_ANNOTATION_NAMES.contains(identifier)) { - testStaticFunctions.add(functionDefinitionNode); + if (CONFIG_ANNOTATION.equals(identifier)) { + testFunctions.add(functionDefinitionNode); + } else { + testSetUpTearDownFunctions.add(functionDefinitionNode); + } } else if (TEST_DYNAMIC_ANNOTATION_NAME.equals(identifier)) { testDynamicFunctions.add(functionDefinitionNode); } @@ -83,7 +90,9 @@ public void visit(FunctionDefinitionNode functionDefinitionNode) { } public List getTestStaticFunctions() { - return this.testStaticFunctions; + List testStaticFunctions = new ArrayList<>(testSetUpTearDownFunctions); + testStaticFunctions.addAll(testFunctions); + return testStaticFunctions; } public List getTestDynamicFunctions() { diff --git a/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginConstants.java b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginConstants.java index 36e97a941d25..c8cab84384ee 100644 --- a/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginConstants.java +++ b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginConstants.java @@ -46,6 +46,7 @@ public class TesterinaCompilerPluginConstants { public static final String TESTS_PARAMETER = "tests"; public static final String RERUN_FAILED_PARAMETER = "rerunFailed"; public static final String LIST_GROUPS_PARAMETER = "listGroups"; + public static final String PARALLEL_EXECUTION_PARAMETER = "parallelExecution"; private TesterinaCompilerPluginConstants() {} } diff --git a/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginUtils.java b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginUtils.java index 090171ab4673..f6e099bd7c69 100644 --- a/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginUtils.java +++ b/misc/testerina/modules/testerina-compiler-plugin/src/main/java/org/ballerinalang/testerina/compiler/TesterinaCompilerPluginUtils.java @@ -78,7 +78,8 @@ public static void addSetTestOptionsCall(List statements) { getPositionalArg(TesterinaCompilerPluginConstants.DISABLE_GROUPS_PARAMETER), getPositionalArg(TesterinaCompilerPluginConstants.TESTS_PARAMETER), getPositionalArg(TesterinaCompilerPluginConstants.RERUN_FAILED_PARAMETER), - getPositionalArg(TesterinaCompilerPluginConstants.LIST_GROUPS_PARAMETER))))); + getPositionalArg(TesterinaCompilerPluginConstants.LIST_GROUPS_PARAMETER), + getPositionalArg(TesterinaCompilerPluginConstants.PARALLEL_EXECUTION_PARAMETER))))); } public static void addStartSuiteCall(List statements) { @@ -284,7 +285,9 @@ public static FunctionSignatureNode getFunctionSignature() { NodeFactory.createToken(SyntaxKind.COMMA_TOKEN), getStringParameter(TesterinaCompilerPluginConstants.RERUN_FAILED_PARAMETER), NodeFactory.createToken(SyntaxKind.COMMA_TOKEN), - getStringParameter(TesterinaCompilerPluginConstants.LIST_GROUPS_PARAMETER)), + getStringParameter(TesterinaCompilerPluginConstants.LIST_GROUPS_PARAMETER), + NodeFactory.createToken(SyntaxKind.COMMA_TOKEN), + getStringParameter(TesterinaCompilerPluginConstants.PARALLEL_EXECUTION_PARAMETER)), NodeFactory.createToken(SyntaxKind.CLOSE_PAREN_TOKEN), returnTypeDescriptorNode); } diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/annotation_processor.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/annotation_processor.bal index 3e8dafc86c89..9cde5d80f107 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/annotation_processor.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/annotation_processor.bal @@ -17,13 +17,13 @@ type AnnotationProcessor function (string name, function f) returns boolean; AnnotationProcessor[] annotationProcessors = [ - processConfigAnnotation, processBeforeSuiteAnnotation, processAfterSuiteAnnotation, processBeforeEachAnnotation, processAfterEachAnnotation, processBeforeGroupsAnnotation, - processAfterGroupsAnnotation + processAfterGroupsAnnotation, + processConfigAnnotation ]; public function registerTest(string name, function f) { @@ -46,30 +46,116 @@ public function registerTest(string name, function f) { function processConfigAnnotation(string name, function f) returns boolean { TestConfig? config = (typeof f).@Config; if config != () { + // Evaluate the test function to determine the parallelizability of the test function. + boolean isTestFunctionIsolated = f is isolated function; + boolean isDataProviderIsolated = true; + boolean isTestFunctionParamSafe = true; + string[] reasonForSerialExecution = []; + boolean isSatisfiedParallelizableConditions = isTestFunctionIsolated && + isBeforeAfterFuncSetIsolated(config, reasonForSerialExecution); DataProviderReturnType? params = (); error? diagnostics = (); if config.dataProvider != () { var providerFn = config.dataProvider; - if providerFn is function () returns (DataProviderReturnType?) { + isDataProviderIsolated = (providerFn is isolated function); + isTestFunctionParamSafe = isFunctionParamConcurrencySafe(f); + isSatisfiedParallelizableConditions = isSatisfiedParallelizableConditions + && isDataProviderIsolated && isTestFunctionParamSafe; + DataProviderReturnType providerOutput = providerFn(); - params = providerOutput; + params = providerOutput; } else { diagnostics = error("Failed to execute the data provider"); } } + + // Register the reason for serial execution. + if !isTestFunctionIsolated { + reasonForSerialExecution.push("non-isolated test function"); + } + if !isDataProviderIsolated { + reasonForSerialExecution.push("non-isolated data-provider function"); + } + if !isTestFunctionParamSafe { + reasonForSerialExecution.push("unsafe test parameters"); + } + + // If the test function is not parallelizable, then print the reason for serial execution. + if !isSatisfiedParallelizableConditions && !(config?.serialExecution == () ? false : true) + && conMgr.isParallelExecutionEnabled() { + println(string `WARNING: Test function '${name}' cannot be parallelized, reason: ${string:'join(", ", ...reasonForSerialExecution)}`); + } + boolean enabled = config.enable && (filterGroups.length() == 0 ? true : hasGroup(config.groups, filterGroups)) - && (filterDisableGroups.length() == 0 ? true : !hasGroup(config.groups, filterDisableGroups)) && hasTest(name); + && (filterDisableGroups.length() == 0 ? true : !hasGroup(config.groups, filterDisableGroups)) + && hasTest(name); config.groups.forEach('group => groupStatusRegistry.incrementTotalTest('group, enabled)); - - testRegistry.addFunction(name = name, executableFunction = f, params = params, before = config.before, - after = config.after, groups = config.groups, diagnostics = diagnostics, dependsOn = config.dependsOn, - enabled = enabled, dependsOnCount = config.dependsOn.length(), config = config); - return true; + dataDrivenTestParams[name] = params; + testRegistry.addFunction(name = name, executableFunction = f, before = config.before, + after = config.after, groups = config.groups.cloneReadOnly(), diagnostics = diagnostics, + dependsOn = config.dependsOn.cloneReadOnly(), serialExecution = ((config?.serialExecution != ()) + || !isSatisfiedParallelizableConditions || !conMgr.isParallelExecutionEnabled()), + config = config.cloneReadOnly()); + conMgr.createTestFunctionMetaData(functionName = name, dependsOnCount = config.dependsOn.length(), + enabled = enabled); } return false; } +function isBeforeAfterFuncSetIsolated(TestConfig config, string[] reasonForSerialExecution) returns boolean { + boolean isBeforeAfterFunctionSetIsolated = true; + (function () returns any|error)? before = config.before; + if before !is () { + if before !is isolated function () returns any|error { + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated before function"); + } + } + (function () returns any|error)? after = config.after; + if after !is () { + if after !is isolated function () returns any|error { + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated after function"); + } + } + foreach string 'group in config.groups { + TestFunction[]? beforeGroupFunctions = beforeGroupsRegistry.getFunctions('group); + if beforeGroupFunctions !is () { + foreach TestFunction beforeGroupFunction in beforeGroupFunctions { + if beforeGroupFunction.executableFunction !is isolated function { + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated before-group function"); + } + } + } + TestFunction[]? afterGroupFunctions = afterGroupsRegistry.getFunctions('group); + if afterGroupFunctions !is () { + foreach TestFunction afterGroupFunction in afterGroupFunctions { + if afterGroupFunction.executableFunction !is isolated function { // TODO: move exaclamation before is + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated after-group function"); + } + } + } + } + TestFunction[] beforeEachFunctions = beforeEachRegistry.getFunctions(); + foreach TestFunction beforeEachFunction in beforeEachFunctions { + if beforeEachFunction.executableFunction !is isolated function { + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated before-each function"); + } + } + TestFunction[] afterEachFunctions = afterEachRegistry.getFunctions(); + foreach TestFunction afterEachFunction in afterEachFunctions { + if afterEachFunction.executableFunction !is isolated function { + isBeforeAfterFunctionSetIsolated = false; + reasonForSerialExecution.push("non-isolated after-each function"); + } + } + return isBeforeAfterFunctionSetIsolated; +} + function processBeforeSuiteAnnotation(string name, function f) returns boolean { boolean? isTrue = (typeof f).@BeforeSuite; if isTrue == true { @@ -135,21 +221,19 @@ function hasGroup(string[] groups, string[] filter) returns boolean { return false; } -function hasTest(string name) returns boolean { - if hasFilteredTests { +isolated function hasTest(string name) returns boolean { + if testOptions.getHasFilteredTests() { string testName = name; - int? testIndex = filterTests.indexOf(testName); + int? testIndex = testOptions.getFilterTestIndex(testName); if testIndex == () { - foreach string filter in filterTests { - if (filter.includes(WILDCARD)) { + foreach string filter in testOptions.getFilterTests() { + if filter.includes(WILDCARD) { boolean|error wildCardMatch = matchWildcard(testName, filter); - if (wildCardMatch is boolean && wildCardMatch && matchModuleName(filter)) { - return true; - } + return (wildCardMatch is boolean && wildCardMatch && matchModuleName(filter)); } } return false; - } else if (matchModuleName(testName)) { + } else if matchModuleName(testName) { return true; } return false; @@ -157,7 +241,7 @@ function hasTest(string name) returns boolean { return true; } -function matchModuleName(string testName) returns boolean { - string? filterModule = filterTestModules[testName]; +isolated function matchModuleName(string testName) returns boolean { + string? filterModule = testOptions.getFilterTestModule(testName); return filterModule == () ? true : filterModule == getFullModuleName(); } diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/annotations.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/annotations.bal index 5e25a168261a..cbeec74b3653 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/annotations.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/annotations.bal @@ -22,6 +22,7 @@ # + before - Function to be run before the test is run # + after - Function to be run after the test is run # + dependsOn - A list of functions the test function depends on and will be run before the test +# + serialExecution - Flag to enable/disable parallization for a test function public type TestConfig record { boolean enable = true; string[] groups = []; @@ -29,6 +30,7 @@ public type TestConfig record { function () returns (any|error) before?; function () returns (any|error) after?; function[] dependsOn = []; + true serialExecution?; }; # Configuration of the function to be mocked. diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/concurrentExecuter.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/concurrentExecuter.bal new file mode 100644 index 000000000000..fd4113c2798a --- /dev/null +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/concurrentExecuter.bal @@ -0,0 +1,165 @@ +// Copyright (c) 2024 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +isolated function executeTestIsolated(TestFunction testFunction, DataProviderReturnType? testFunctionArgs) { + if !isTestReadyToExecute(testFunction, testFunctionArgs) { + return; + } + executeBeforeGroupFunctionsIsolated(testFunction); + executeBeforeEachFunctionsIsolated(); + boolean shouldSkipDependents = false; + if !isSkipFunction(testFunction) { + if isDataDrivenTest(testFunctionArgs) { + executeDataDrivenTestSetIsolated(testFunction, testFunctionArgs); + } else { + shouldSkipDependents = executeNonDataDrivenTestIsolated(testFunction, testFunctionArgs); + } + } else { + reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunctionArgs)); + shouldSkipDependents = true; + } + testFunction.groups.forEach('group => groupStatusRegistry.incrementExecutedTest('group)); + executeAfterEachFunctionsIsolated(); + executeAfterGroupFunctionsIsolated(testFunction); + finishTestExecution(testFunction, shouldSkipDependents); +} + +isolated function executeBeforeGroupFunctionsIsolated(TestFunction testFunction) { + foreach string 'group in testFunction.groups { + TestFunction[]? beforeGroupFunctions = beforeGroupsRegistry.getFunctions('group); + if beforeGroupFunctions != () && !groupStatusRegistry.firstExecuted('group) { + handleBeforeGroupOutput(testFunction, 'group, executeFunctionsIsolated(beforeGroupFunctions, getShouldSkip())); + } + } +} + +isolated function executeBeforeEachFunctionsIsolated() => + handleBeforeEachOutput(executeFunctionsIsolated(beforeEachRegistry.getFunctions(), getShouldSkip())); + +isolated function executeDataDrivenTestSetIsolated(TestFunction testFunction, DataProviderReturnType? testFunctionArgs) { + string[] keys = []; + AnyOrError[][] values = []; + TestType testType = prepareDataSet(testFunctionArgs, keys, values); + map futuresMap = {}; + while keys.length() != 0 { + string key = keys.remove(0); + AnyOrError[] value = values.remove(0); + final readonly & readonly[] readOnlyVal = from any|error item in value + where item is readonly + select item; + if readOnlyVal.length() != value.length() { + reportData.onFailed(name = testFunction.name, suffix = key, message = string `[fail data provider for the function ${testFunction.name}]${"\n"} Data provider returned non-readonly values`, testType = testType); + println(string `${"\n"}${testFunction.name}:${key} has failed.${"\n"}`); + enableExit(); + } + future<()> futureResult = start prepareDataDrivenTestIsolated(testFunction, key, readOnlyVal, testType); + futuresMap[key] = futureResult; + } + foreach [string, future] futureResult in futuresMap.entries() { + string suffix = futureResult[0]; + any|error parallelDataProviderResult = wait futureResult[1]; + if parallelDataProviderResult is error { + reportData.onFailed(name = testFunction.name, suffix = suffix, message = string `[fail data provider for the function ${testFunction.name}]${"\n"} ${getErrorMessage(parallelDataProviderResult)}`, testType = testType); + println(string `${"\n"}${testFunction.name}:${suffix} has failed.${"\n"}`); + enableExit(); + } + } +} + +isolated function executeNonDataDrivenTestIsolated(TestFunction testFunction, DataProviderReturnType? testFunctionArgs) returns boolean { + if executeBeforeFunctionIsolated(testFunction) { + conMgr.setSkip(testFunction.name); + reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunctionArgs)); + return true; + } + boolean failed = handleNonDataDrivenTestOutput(testFunction, executeTestFunctionIsolated(testFunction, "", GENERAL_TEST)); + if executeAfterFunctionIsolated(testFunction) { + return true; + } + return failed; +} + +isolated function executeAfterEachFunctionsIsolated() => + handleAfterEachOutput(executeFunctionsIsolated(afterEachRegistry.getFunctions(), getShouldSkip())); + +isolated function executeAfterGroupFunctionsIsolated(TestFunction testFunction) { + foreach string 'group in testFunction.groups { + TestFunction[]? afterGroupFunctions = afterGroupsRegistry.getFunctions('group); + if afterGroupFunctions != () && groupStatusRegistry.lastExecuted('group) { + ExecutionError? err = executeFunctionsIsolated(afterGroupFunctions, + getShouldSkip() || groupStatusRegistry.getSkipAfterGroup('group)); + handleAfterGroupOutput(err); + } + } +} + +isolated function executeFunctionsIsolated(TestFunction[] testFunctions, boolean skip = false) returns ExecutionError? { + foreach TestFunction testFunction in testFunctions { + if !skip || testFunction.alwaysRun { + check executeFunctionIsolated(testFunction); + } + } +} + +isolated function prepareDataDrivenTestIsolated(TestFunction testFunction, string key, AnyOrError[] value, TestType testType) { + if executeBeforeFunctionIsolated(testFunction) { + reportData.onSkipped(name = testFunction.name, testType = testType); + } else { + executeDataDrivenTestIsolated(testFunction, key, testType, value); + _ = executeAfterFunctionIsolated(testFunction); + } +} + +isolated function executeDataDrivenTestIsolated(TestFunction testFunction, string suffix, TestType testType, AnyOrError[] params) { + if skipDataDrivenTest(testFunction, suffix, testType) { + return; + } + ExecutionError|boolean err = executeTestFunctionIsolated(testFunction, suffix, testType, params); + handleDataDrivenTestOutput(err, testFunction, suffix, testType); +} + +isolated function executeBeforeFunctionIsolated(TestFunction testFunction) returns boolean { + boolean failed = false; + if isBeforeFuncConditionMet(testFunction) { + failed = handleBeforeFunctionOutput(executeFunctionIsolated(testFunction.before)); + } + return failed; +} + +isolated function executeTestFunctionIsolated(TestFunction testFunction, string suffix, TestType testType, AnyOrError[]? params = ()) returns ExecutionError|boolean { + isolated function isolatedTestFunction = testFunction.executableFunction; + any|error output = params == () ? trap function:call(isolatedTestFunction) + : trap function:call(isolatedTestFunction, ...params); + return handleTestFuncOutput(output, testFunction, suffix, testType); +} + +isolated function executeAfterFunctionIsolated(TestFunction testFunction) returns boolean { + boolean failed = false; + if isAfterFuncConditionMet(testFunction) { + failed = handleAfterFunctionOutput(executeFunctionIsolated(testFunction.after)); + } + return failed; +} + +isolated function executeFunctionIsolated(TestFunction|function testFunction) returns ExecutionError? { + isolated function isolatedTestFunction = (testFunction is function ? testFunction : testFunction.executableFunction); + // casting is done outside the function to avoid the error of casting inside the function and trapping it. + any|error output = trap function:call(isolatedTestFunction); + if output is error { + enableExit(); + return error(getErrorMessage(output), functionName = testFunction is function ? "" : testFunction.name); + } +} diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/execute.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/execute.bal index adda3d0293a8..cbb5b8a4f270 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/execute.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/execute.bal @@ -13,17 +13,20 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. - import ballerina/lang.'error as langError; -boolean shouldSkip = false; +isolated boolean shouldSkip = false; boolean shouldAfterSuiteSkip = false; -int exitCode = 0; +isolated int exitCode = 0; +final ConcurrentExecutionManager conMgr = new; +map dataDrivenTestParams = {}; public function startSuite() returns int { // exit if setTestOptions has failed - if exitCode > 0 { - return exitCode; + lock { + if exitCode > 0 { + return exitCode; + } } if listGroups { string[] groupsList = groupStatusRegistry.getGroupsList(); @@ -36,249 +39,328 @@ public function startSuite() returns int { } else { if testRegistry.getFunctions().length() == 0 && testRegistry.getDependentFunctions().length() == 0 { println("\tNo tests found"); - return exitCode; + lock { + return exitCode; + } } - error? err = orderTests(); if err is error { - exitCode = 1; + enableExit(); println(err.message()); } else { executeBeforeSuiteFunctions(); - executeTests(); + err = executeTests(); + if err is error { + enableExit(); + println(err.message()); + } executeAfterSuiteFunctions(); reportGenerators.forEach(reportGen => reportGen(reportData)); } } - return exitCode; + lock { + return exitCode; + } } -function executeTests() { +function executeTests() returns error? { + decimal startTime = currentTimeInMillis(); foreach TestFunction testFunction in testRegistry.getFunctions() { - executeTest(testFunction); + if !testFunction.serialExecution { + conMgr.addInitialParallelTest(testFunction); + continue; + } + conMgr.addInitialSerialTest(testFunction); + } + while !conMgr.isExecutionDone() { + if conMgr.getSerialQueueLength() != 0 && conMgr.countTestInExecution() == 0 { + TestFunction testFunction = conMgr.getSerialTest(); + conMgr.addTestInExecution(testFunction); + executeTest(testFunction); + } else if conMgr.getParallelQueueLength() != 0 { + TestFunction testFunction = conMgr.getParallelTest(); + conMgr.addTestInExecution(testFunction); + DataProviderReturnType? testFunctionArgs = dataDrivenTestParams[testFunction.name]; + _ = start executeTestIsolated(testFunction, testFunctionArgs); + } + conMgr.populateExecutionQueues(); } + println(string `${"\n"}${"\t"}${"\t"}Test execution time : ${currentTimeInMillis() - startTime}ms${"\n"}`); } -function executeTest(TestFunction testFunction) { - if !testFunction.enabled { - return; - } - error? diagnoseError = testFunction.diagnostics; - if diagnoseError is error { - reportData.onFailed(name = testFunction.name, message = diagnoseError.message(), testType = getTestType(testFunction)); - exitCode = 1; - return; +function executeBeforeSuiteFunctions() { + ExecutionError? err = executeFunctions(beforeSuiteRegistry.getFunctions()); + if err is ExecutionError { + enableShouldSkip(); + shouldAfterSuiteSkip = true; + enableExit(); + printExecutionError(err, "before test suite function"); } - if testFunction.dependsOnCount > 1 { - testFunction.dependsOnCount -= 1; - return; +} + +function executeAfterSuiteFunctions() { + ExecutionError? err = executeFunctions(afterSuiteRegistry.getFunctions(), shouldAfterSuiteSkip); + if err is ExecutionError { + enableExit(); + printExecutionError(err, "after test suite function"); } +} - executeBeforeGroupFunctions(testFunction); - executeBeforeEachFunctions(); +function orderTests() returns error? { + string[] descendants = []; + from TestFunction testFunction in testRegistry.getDependentFunctions() + where !conMgr.isVisited(testFunction.name) && conMgr.isEnabled(testFunction.name) + do { + check restructureTest(testFunction, descendants); + }; +} - boolean shouldSkipDependents = false; - if !testFunction.skip && !shouldSkip { - if (isDataDrivenTest(testFunction)) { - executeDataDrivenTestSet(testFunction); - } else { - shouldSkipDependents = executeNonDataDrivenTest(testFunction); +function restructureTest(TestFunction testFunction, string[] descendants) returns error? { + descendants.push(testFunction.name); + foreach function dependsOnFunction in testFunction.dependsOn { + TestFunction dependsOnTestFunction = check testRegistry.getTestFunction(dependsOnFunction); + + // if the dependsOnFunction is disabled by the user, throw an error + // dependsOnTestFunction.config?.enable is used instead of dependsOnTestFunction.enable to ensure that + // the user has deliberately passed enable=false + boolean? dependentEnabled = dependsOnTestFunction.config?.enable; + if dependentEnabled == false { + string errMsg = string `error: Test [${testFunction.name}] depends on function [${dependsOnTestFunction.name}], ` + + string `but it is either disabled or not included.`; + return error(errMsg); + } + conMgr.addDependent(dependsOnTestFunction.name, testFunction); + + // Contains cyclic dependencies + int? startIndex = descendants.indexOf(dependsOnTestFunction.name); + if startIndex is int { + string[] newCycle = descendants.slice(startIndex); + newCycle.push(dependsOnTestFunction.name); + return error("Cyclic test dependencies detected: " + string:'join(" -> ", ...newCycle)); + } else if !conMgr.isVisited(dependsOnTestFunction.name) { + check restructureTest(dependsOnTestFunction, descendants); } - } else { - reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunction)); - shouldSkipDependents = true; } + conMgr.setEnabled(testFunction.name); + conMgr.setVisited(testFunction.name); + _ = descendants.pop(); +} + +isolated function printExecutionError(ExecutionError err, string functionSuffix) { + println("\t[fail] " + err.detail().functionName + "[" + functionSuffix + "]" + ":\n\t " + formatFailedError(err.message(), 2)); +} - testFunction.groups.forEach('group => groupStatusRegistry.incrementExecutedTest('group)); - executeAfterEachFunctions(); - executeAfterGroupFunctions(testFunction); +isolated function getErrorMessage(error err) returns string { + string message = err.toBalString(); + string accumulatedTrace = ""; + from langError:StackFrame stackFrame in err.stackTrace() + do { + accumulatedTrace = accumulatedTrace + "\t" + stackFrame.toString() + "\n"; + }; + return message + "\n" + accumulatedTrace; +} - if shouldSkipDependents { - testFunction.dependents.forEach(function(TestFunction dependent) { - dependent.skip = true; - }); +isolated function getTestType(DataProviderReturnType? params) returns TestType { + if params is map { + return DATA_DRIVEN_MAP_OF_TUPLE; } - testFunction.dependents.forEach(dependent => executeTest(dependent)); + if params is AnyOrError[][] { + return DATA_DRIVEN_TUPLE_OF_TUPLE; + } + return GENERAL_TEST; } -function executeDataDrivenTestSet(TestFunction testFunction) { - DataProviderReturnType? params = testFunction.params; - if params is map { - foreach [string, AnyOrError[]] entry in params.entries() { - boolean beforeFailed = executeBeforeFunction(testFunction); - if (beforeFailed) { - reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunction)); - } else { - executeDataDrivenTest(testFunction, entry[0], DATA_DRIVEN_MAP_OF_TUPLE, entry[1]); - var _ = executeAfterFunction(testFunction); - } +isolated function nestedEnabledDependentsAvailable(TestFunction[] dependents) returns boolean { + if dependents.length() == 0 { + return false; + } + TestFunction[] queue = []; + foreach TestFunction dependent in dependents { + if conMgr.isEnabled(dependent.name) { + return true; } - } else if params is AnyOrError[][] { - int i = 0; - foreach AnyOrError[] entry in params { - boolean beforeFailed = executeBeforeFunction(testFunction); - if (beforeFailed) { - reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunction)); - } else { - executeDataDrivenTest(testFunction, i.toString(), DATA_DRIVEN_TUPLE_OF_TUPLE, entry); - var _ = executeAfterFunction(testFunction); - } - i += 1; + foreach TestFunction superDependent in conMgr.getDependents(dependent.name) { + queue.push(superDependent); } } + return nestedEnabledDependentsAvailable(queue); } -function executeDataDrivenTest(TestFunction testFunction, string suffix, TestType testType, AnyOrError[] params) { - if (skipDataDrivenTest(testFunction, suffix, testType)) { - return; +isolated function isDataDrivenTest(DataProviderReturnType? params) returns boolean => + params is map || params is AnyOrError[][]; + +isolated function enableShouldSkip() { + lock { + shouldSkip = true; } +} - ExecutionError|boolean err = executeTestFunction(testFunction, suffix, testType, params); - if err is ExecutionError { - reportData.onFailed(name = testFunction.name, suffix = suffix, message = "[fail data provider for the function " + testFunction.name - + "]\n" + getErrorMessage(err), testType = testType); +isolated function getShouldSkip() returns boolean { + lock { + return shouldSkip; + } +} + +isolated function enableExit() { + lock { exitCode = 1; } } -function executeNonDataDrivenTest(TestFunction testFunction) returns boolean { - boolean failed = false; - boolean beforeFailed = executeBeforeFunction(testFunction); - if (beforeFailed) { - testFunction.skip = true; - reportData.onSkipped(name = testFunction.name, testType = getTestType(testFunction)); - return true; +isolated function isTestReadyToExecute(TestFunction testFunction, DataProviderReturnType? testFunctionArgs) returns boolean { + if !conMgr.isEnabled(testFunction.name) { + conMgr.setExecutionSuspended(testFunction.name); + return false; + } + error? diagnoseError = testFunction.diagnostics; + if diagnoseError is error { + reportData.onFailed(name = testFunction.name, message = diagnoseError.message(), testType = getTestType(testFunctionArgs)); + println(string `${"\n"}${testFunction.name} has failed.${"\n"}`); + enableExit(); + conMgr.setExecutionSuspended(testFunction.name); + return false; + } + return true; +} + +isolated function finishTestExecution(TestFunction testFunction, boolean shouldSkipDependents) { + if shouldSkipDependents { + conMgr.getDependents(testFunction.name).forEach(isolated function(TestFunction dependent) { + conMgr.setSkip(dependent.name); + }); + } + conMgr.setExecutionCompleted(testFunction.name); +} + +isolated function handleBeforeGroupOutput(TestFunction testFunction, string 'group, ExecutionError? err) { + if err is ExecutionError { + conMgr.setSkip(testFunction.name); + groupStatusRegistry.setSkipAfterGroup('group); + enableExit(); + printExecutionError(err, "before test group function for the test"); + } +} + +isolated function handleBeforeEachOutput(ExecutionError? err) { + if err is ExecutionError { + enableShouldSkip(); + enableExit(); + printExecutionError(err, "before each test function for the test"); } - ExecutionError|boolean output = executeTestFunction(testFunction, "", GENERAL_TEST); +} + +isolated function handleNonDataDrivenTestOutput(TestFunction testFunction, ExecutionError|boolean output) returns boolean { + boolean failed = false; if output is ExecutionError { failed = true; reportData.onFailed(name = testFunction.name, message = output.message(), testType = GENERAL_TEST); + println(string `${"\n"}${testFunction.name} has failed.${"\n"}`); } else if output { failed = true; } - boolean afterFailed = executeAfterFunction(testFunction); - if (afterFailed) { - return true; - } return failed; } -function executeBeforeSuiteFunctions() { - ExecutionError? err = executeFunctions(beforeSuiteRegistry.getFunctions()); +isolated function handleAfterEachOutput(ExecutionError? err) { if err is ExecutionError { - shouldSkip = true; - shouldAfterSuiteSkip = true; - exitCode = 1; - printExecutionError(err, "before test suite function"); + enableShouldSkip(); + enableExit(); + printExecutionError(err, "after each test function for the test"); } } -function executeAfterSuiteFunctions() { - ExecutionError? err = executeFunctions(afterSuiteRegistry.getFunctions(), shouldAfterSuiteSkip); +isolated function handleAfterGroupOutput(ExecutionError? err) { if err is ExecutionError { - exitCode = 1; - printExecutionError(err, "after test suite function"); + enableExit(); + printExecutionError(err, "after test group function for the test"); } } -function executeBeforeEachFunctions() { - ExecutionError? err = executeFunctions(beforeEachRegistry.getFunctions(), shouldSkip); +isolated function handleDataDrivenTestOutput(ExecutionError|boolean err, TestFunction testFunction, string suffix, + TestType testType) { if err is ExecutionError { - shouldSkip = true; - exitCode = 1; - printExecutionError(err, "before each test function for the test"); + reportData.onFailed(name = testFunction.name, suffix = suffix, message = string `[fail data provider for the function ${testFunction.name}]${"\n"} ${getErrorMessage(err)}`, testType = testType); + println(string `${"\n"}${testFunction.name}:${suffix} has failed.${"\n"}`); + enableExit(); } } -function executeAfterEachFunctions() { - ExecutionError? err = executeFunctions(afterEachRegistry.getFunctions(), shouldSkip); +isolated function handleBeforeFunctionOutput(ExecutionError? err) returns boolean { if err is ExecutionError { - shouldSkip = true; - exitCode = 1; - printExecutionError(err, "after each test function for the test"); + enableExit(); + printExecutionError(err, "before test function for the test"); + return true; } + return false; } -function executeBeforeFunction(TestFunction testFunction) returns boolean { - boolean failed = false; - if testFunction.before is function && !shouldSkip && !testFunction.skip { - ExecutionError? err = executeFunction(testFunction.before); - if err is ExecutionError { - exitCode = 1; - printExecutionError(err, "before test function for the test"); - failed = true; - } +isolated function handleAfterFunctionOutput(ExecutionError? err) returns boolean { + if err is ExecutionError { + enableExit(); + printExecutionError(err, "after test function for the test"); + return true; } - return failed; + return false; } -function executeAfterFunction(TestFunction testFunction) returns boolean { - boolean failed = false; - if testFunction.after is function && !shouldSkip && !testFunction.skip { - ExecutionError? err = executeFunction(testFunction.after); - if err is ExecutionError { - exitCode = 1; - printExecutionError(err, "after test function for the test"); - failed = true; - } +isolated function handleTestFuncOutput(any|error output, TestFunction testFunction, string suffix, TestType testType) returns ExecutionError|boolean { + if output is TestError { + enableExit(); + reportData.onFailed(name = testFunction.name, suffix = suffix, message = getErrorMessage(output), testType = testType); + println(string `${"\n"}${testFunction.name}:${suffix} has failed.${"\n"}`); + return true; } - return failed; -} - -function executeBeforeGroupFunctions(TestFunction testFunction) { - foreach string 'group in testFunction.groups { - TestFunction[]? beforeGroupFunctions = beforeGroupsRegistry.getFunctions('group); - if beforeGroupFunctions != () && !groupStatusRegistry.firstExecuted('group) { - ExecutionError? err = executeFunctions(beforeGroupFunctions, shouldSkip); - if err is ExecutionError { - testFunction.skip = true; - groupStatusRegistry.setSkipAfterGroup('group); - exitCode = 1; - printExecutionError(err, "before test group function for the test"); - } - } + if output is any { + reportData.onPassed(name = testFunction.name, suffix = suffix, testType = testType); + return false; } + enableExit(); + return error(getErrorMessage(output), functionName = testFunction.name); } -function executeAfterGroupFunctions(TestFunction testFunction) { - foreach string 'group in testFunction.groups { - TestFunction[]? afterGroupFunctions = afterGroupsRegistry.getFunctions('group); - if afterGroupFunctions != () && groupStatusRegistry.lastExecuted('group) { - ExecutionError? err = executeFunctions(afterGroupFunctions, - shouldSkip || groupStatusRegistry.getSkipAfterGroup('group)); - if err is ExecutionError { - exitCode = 1; - printExecutionError(err, "after test group function for the test"); - } +isolated function prepareDataSet(DataProviderReturnType? testFunctionArgs, string[] keys, + AnyOrError[][] values) returns TestType { + TestType testType = DATA_DRIVEN_MAP_OF_TUPLE; + if testFunctionArgs is map { + foreach [string, AnyOrError[]] [k, v] in testFunctionArgs.entries() { + keys.push(k); + values.push(v); + } + } else if testFunctionArgs is AnyOrError[][] { + testType = DATA_DRIVEN_TUPLE_OF_TUPLE; + foreach AnyOrError[] [k, v] in testFunctionArgs.enumerate() { + keys.push(k.toBalString()); + values.push(v); } } + return testType; } -function skipDataDrivenTest(TestFunction testFunction, string suffix, TestType testType) returns boolean { +isolated function skipDataDrivenTest(TestFunction testFunction, string suffix, TestType testType) returns boolean { string functionName = testFunction.name; - if (!hasFilteredTests) { + if !testOptions.getHasFilteredTests() { return false; } - TestFunction[] dependents = testFunction.dependents; + TestFunction[] dependents = conMgr.getDependents(functionName); // if a dependent in a below level is enabled, this test should run - if (dependents.length() > 0 && nestedEnabledDependentsAvailable(dependents)) { + if dependents.length() > 0 && nestedEnabledDependentsAvailable(dependents) { return false; } string functionKey = functionName; // check if prefix matches directly - boolean prefixMatch = filterSubTests.hasKey(functionName); + boolean prefixMatch = testOptions.isFilterSubTestsContains(functionName); // if prefix matches to a wildcard - if (!prefixMatch && hasTest(functionName)) { + if !prefixMatch && hasTest(functionName) { // get the matching wildcard prefixMatch = true; - foreach string filter in filterTests { - if (filter.includes(WILDCARD)) { + foreach string filter in testOptions.getFilterTests() { + if filter.includes(WILDCARD) { boolean|error wildCardMatch = matchWildcard(functionKey, filter); - if (wildCardMatch is boolean && wildCardMatch && matchModuleName(filter)) { + if wildCardMatch is boolean && wildCardMatch && matchModuleName(filter) { functionKey = filter; break; } @@ -287,15 +369,15 @@ function skipDataDrivenTest(TestFunction testFunction, string suffix, TestType t } // check if no filterSubTests found for a given prefix - boolean suffixMatch = !filterSubTests.hasKey(functionKey); + boolean suffixMatch = !testOptions.isFilterSubTestsContains(functionKey); // if a subtest is found specified - if (!suffixMatch) { - string[] subTests = filterSubTests.get(functionKey); + if !suffixMatch { + string[] subTests = testOptions.getFilterSubTest(functionKey); foreach string subFilter in subTests { string updatedSubFilter = subFilter; - if (testType == DATA_DRIVEN_MAP_OF_TUPLE) { - if (subFilter.startsWith(SINGLE_QUOTE) && subFilter.endsWith(SINGLE_QUOTE)) { + if testType == DATA_DRIVEN_MAP_OF_TUPLE { + if subFilter.startsWith(SINGLE_QUOTE) && subFilter.endsWith(SINGLE_QUOTE) { updatedSubFilter = subFilter.substring(1, subFilter.length() - 1); } } @@ -305,11 +387,11 @@ function skipDataDrivenTest(TestFunction testFunction, string suffix, TestType t string updatedSuffix = decodedSuffix is string ? decodedSuffix : suffix; boolean wildCardMatchBoolean = false; - if (updatedSubFilter.includes(WILDCARD)) { + if updatedSubFilter.includes(WILDCARD) { boolean|error wildCardMatch = matchWildcard(updatedSuffix, updatedSubFilter); wildCardMatchBoolean = wildCardMatch is boolean && wildCardMatch; } - if ((updatedSubFilter == updatedSuffix) || wildCardMatchBoolean) { + if (updatedSubFilter == updatedSuffix) || wildCardMatchBoolean { suffixMatch = true; break; } @@ -320,115 +402,11 @@ function skipDataDrivenTest(TestFunction testFunction, string suffix, TestType t return !(prefixMatch && suffixMatch); } -function printExecutionError(ExecutionError err, string functionSuffix) - => println("\t[fail] " + err.detail().functionName + "[" + functionSuffix + "]" + ":\n\t " + formatFailedError(err.message(), 2)); - -function executeFunctions(TestFunction[] testFunctions, boolean skip = false) returns ExecutionError? { - foreach TestFunction testFunction in testFunctions { - if !skip || testFunction.alwaysRun { - check executeFunction(testFunction); - } - } -} - -function executeTestFunction(TestFunction testFunction, string suffix, TestType testType, AnyOrError[]? params = ()) returns ExecutionError|boolean { - any|error output = params == () ? trap function:call(testFunction.executableFunction) - : trap function:call(testFunction.executableFunction, ...params); - if output is TestError { - exitCode = 1; - reportData.onFailed(name = testFunction.name, suffix = suffix, message = getErrorMessage(output), testType = testType); - return true; - } else if output is any { - reportData.onPassed(name = testFunction.name, suffix = suffix, testType = testType); - return false; - } else { - exitCode = 1; - return error(getErrorMessage(output), functionName = testFunction.name); - } -} - -function executeFunction(TestFunction|function testFunction) returns ExecutionError? { - any|error output = trap function:call(testFunction is function ? testFunction : testFunction.executableFunction); - if output is error { - exitCode = 1; - return error(getErrorMessage(output), functionName = testFunction is function ? "" : testFunction.name); - } -} - -function getErrorMessage(error err) returns string { - string message = err.toBalString(); - - string accumulatedTrace = ""; - foreach langError:StackFrame stackFrame in err.stackTrace() { - accumulatedTrace = accumulatedTrace + "\t" + stackFrame.toString() + "\n"; - } - return message + "\n" + accumulatedTrace; -} - -function orderTests() returns error? { - string[] descendants = []; - - foreach TestFunction testFunction in testRegistry.getDependentFunctions() { - if !testFunction.visited && testFunction.enabled { - check restructureTest(testFunction, descendants); - } - } -} - -function restructureTest(TestFunction testFunction, string[] descendants) returns error? { - descendants.push(testFunction.name); - - foreach function dependsOnFunction in testFunction.dependsOn { - TestFunction dependsOnTestFunction = check testRegistry.getTestFunction(dependsOnFunction); - - // if the dependsOnFunction is disabled by the user, throw an error - // dependsOnTestFunction.config?.enable is used instead of dependsOnTestFunction.enable to ensure that - // the user has deliberately passed enable=false - boolean? dependentEnabled = dependsOnTestFunction.config?.enable; - if dependentEnabled != () && !dependentEnabled { - string errMsg = string `error: Test [${testFunction.name}] depends on function [${dependsOnTestFunction.name}], ` - + string `but it is either disabled or not included.`; - return error(errMsg); - } - - dependsOnTestFunction.dependents.push(testFunction); - - // Contains cyclic dependencies - int? startIndex = descendants.indexOf(dependsOnTestFunction.name); - if startIndex is int { - string[] newCycle = descendants.slice(startIndex); - newCycle.push(dependsOnTestFunction.name); - return error("Cyclic test dependencies detected: " + string:'join(" -> ", ...newCycle)); - } else if !dependsOnTestFunction.visited { - check restructureTest(dependsOnTestFunction, descendants); - } - } - - testFunction.enabled = true; - testFunction.visited = true; - _ = descendants.pop(); -} +isolated function isBeforeFuncConditionMet(TestFunction testFunction) returns boolean => + testFunction.before is function && !getShouldSkip() && !conMgr.isSkip(testFunction.name); -function getTestType(TestFunction testFunction) returns TestType { - DataProviderReturnType? params = testFunction.params; - if (params is map) { - return DATA_DRIVEN_MAP_OF_TUPLE; - } else if (params is AnyOrError[][]) { - return DATA_DRIVEN_TUPLE_OF_TUPLE; - } - return GENERAL_TEST; -} +isolated function isAfterFuncConditionMet(TestFunction testFunction) returns boolean => + testFunction.after is function && !getShouldSkip() && !conMgr.isSkip(testFunction.name); -function nestedEnabledDependentsAvailable(TestFunction[] dependents) returns boolean { - if (dependents.length() == 0) { - return false; - } - TestFunction[] queue = []; - foreach TestFunction dependent in dependents { - if (dependent.enabled) { - return true; - } - dependent.dependents.forEach((superDependent) => queue.push(superDependent)); - } - return nestedEnabledDependentsAvailable(queue); -} +isolated function isSkipFunction(TestFunction testFunction) returns boolean => + conMgr.isSkip(testFunction.name) || getShouldSkip(); diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/external.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/external.bal index e0ee18282549..3ef563ee034f 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/external.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/external.bal @@ -13,10 +13,9 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License.` ` - import ballerina/jballerina.java; -handle outStreamObj = outStream(); +final handle outStreamObj = outStream(); isolated function print(handle printStream, any|error obj) = @java:Method { name: "print", @@ -24,11 +23,13 @@ isolated function print(handle printStream, any|error obj) = @java:Method { paramTypes: ["java.lang.Object"] } external; -function println(any|error... objs) { - foreach var obj in objs { - print(outStreamObj, obj); +isolated function println(anydata|error... objs) { + lock { + foreach var obj in objs.clone() { + print(outStreamObj, obj); + } + print(outStreamObj, "\n"); } - print(outStreamObj, "\n"); } isolated function outStream() returns handle = @java:FieldGet { @@ -48,56 +49,55 @@ isolated function splitExternal(handle receiver, handle delimiter) returns handl } external; isolated function getBallerinaStringArray(handle h) returns string[] = @java:Method { - 'class:"io.ballerina.runtime.api.utils.StringUtils", - name:"fromStringArray", - paramTypes:["[Ljava.lang.String;"] + 'class: "io.ballerina.runtime.api.utils.StringUtils", + name: "fromStringArray", + paramTypes: ["[Ljava.lang.String;"] } external; isolated function writeContent(string filePath, string content) returns error? = @java:Method { - 'class:"org.ballerinalang.testerina.natives.io.FileUtils", - name:"writeContent" + 'class: "org.ballerinalang.testerina.natives.io.FileUtils", + name: "writeContent" } external; isolated function readContent(string filePath) returns string = @java:Method { - 'class:"org.ballerinalang.testerina.natives.io.FileUtils", - name:"readContent" + 'class: "org.ballerinalang.testerina.natives.io.FileUtils", + name: "readContent" } external; isolated function fileExists(string filePath) returns boolean = @java:Method { - 'class:"org.ballerinalang.testerina.natives.io.FileUtils", - name:"fileExists" + 'class: "org.ballerinalang.testerina.natives.io.FileUtils", + name: "fileExists" } external; isolated function isSystemConsole() returns boolean = @java:Method { - 'class:"org.ballerinalang.testerina.natives.io.StringUtils", - name:"isSystemConsole" + 'class: "org.ballerinalang.testerina.natives.io.StringUtils", + name: "isSystemConsole" } external; isolated function sprintf(string format, (any|error)... args) returns string = @java:Method { - name : "sprintf", - 'class : "org.ballerinalang.testerina.natives.io.StringUtils" + name: "sprintf", + 'class: "org.ballerinalang.testerina.natives.io.StringUtils" } external; isolated function matchWildcard(string functionName, string functionPattern) returns boolean|error = @java:Method { - name : "matchWildcard", - 'class : "org.ballerinalang.testerina.natives.io.StringUtils" + name: "matchWildcard", + 'class: "org.ballerinalang.testerina.natives.io.StringUtils" } external; isolated function decode(string str, string charset) returns string|error = @java:Method { - name : "decode", - 'class : "org.ballerinalang.testerina.natives.io.StringUtils" + name: "decode", + 'class: "org.ballerinalang.testerina.natives.io.StringUtils" } external; isolated function getBallerinaType((any|error) value) returns string = @java:Method { - name : "getBallerinaType", - 'class : "org.ballerinalang.testerina.core.BallerinaTypeCheck" + name: "getBallerinaType", + 'class: "org.ballerinalang.testerina.core.BallerinaTypeCheck" } external; isolated function getStringDiff(string actual, string expected) returns string = @java:Method { - name : "getStringDiff", - 'class : "org.ballerinalang.testerina.core.AssertionDiffEvaluator" - } external; - + name: "getStringDiff", + 'class: "org.ballerinalang.testerina.core.AssertionDiffEvaluator" +} external; isolated function getKeysDiff(string[] actualKeys, string[] expectedKeys) returns string = @java:Method { name: "getKeysDiff", @@ -108,3 +108,13 @@ isolated function escapeSpecialCharacters(string key) returns string|error = @ja name: "escapeSpecialCharacters", 'class: "org.ballerinalang.testerina.natives.io.StringUtils" } external; + +isolated function currentTimeInMillis() returns decimal = @java:Method { + name: "currentTimeInMillis", + 'class: "org.ballerinalang.testerina.natives.CommonUtils" +} external; + +isolated function isFunctionParamConcurrencySafe(function func) returns boolean = @java:Method { + name: "isFunctionParamConcurrencySafe", + 'class: "org.ballerinalang.testerina.natives.CommonUtils" +} external; diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/filter.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/filter.bal index 7bdaebafb85c..d4dc23e83541 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/filter.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/filter.bal @@ -16,41 +16,37 @@ string[] filterGroups = []; string[] filterDisableGroups = []; -string[] filterTests = []; -map filterTestModules = {}; -map filterSubTests = {}; -string moduleName = ""; -string packageName = ""; -boolean hasFilteredTests = false; -string targetPath = ""; boolean terminate = false; boolean listGroups = false; +final TestOptions testOptions = new (); public function setTestOptions(string inTargetPath, string inPackageName, string inModuleName, string inReport, string inCoverage, string inGroups, string inDisableGroups, string inTests, string inRerunFailed, - string inListGroups) { - targetPath = inTargetPath; - packageName = inPackageName; - moduleName = inModuleName; + string inListGroups, string inIsParallelExecution) { + testOptions.setModuleName(inModuleName); + testOptions.setPackageName(inPackageName); + testOptions.setTargetPath(inTargetPath); filterGroups = parseStringArrayInput(inGroups); filterDisableGroups = parseStringArrayInput(inDisableGroups); boolean rerunFailed = parseBooleanInput(inRerunFailed, "rerun-failed"); boolean testReport = parseBooleanInput(inReport, "test-report"); boolean codeCoverage = parseBooleanInput(inCoverage, "code-coverage"); listGroups = parseBooleanInput(inListGroups, "list-groups"); + boolean isParallelExecution = parseBooleanInput(inIsParallelExecution, "isParallelExecution"); + conMgr.setParallelExecutionStatus(isParallelExecution); if rerunFailed { error? err = parseRerunJson(); if err is error { println("error: " + err.message()); - exitCode = 1; + enableExit(); return; } - hasFilteredTests = true; + testOptions.setHasFilteredTests(true); } else { string[] singleExecTests = parseStringArrayInput(inTests); - filterKeyBasedTests(inPackageName, moduleName, singleExecTests); - hasFilteredTests = filterTests.length() > 0; + filterKeyBasedTests(inPackageName, inModuleName, singleExecTests); + testOptions.setHasFilteredTests(testOptions.getFilterTestSize() > 0); } if testReport || codeCoverage { @@ -64,25 +60,26 @@ function filterKeyBasedTests(string packageName, string moduleName, string[] tes foreach string testName in tests { string updatedName = testName; string? prefix = (); - if (containsModulePrefix(packageName, moduleName, testName)) { + if containsModulePrefix(packageName, moduleName, testName) { int separatorIndex = updatedName.indexOf(MODULE_SEPARATOR); prefix = updatedName.substring(0, separatorIndex); updatedName = updatedName.substring(separatorIndex + 1); } - if (containsDataKeySuffix(updatedName)) { + if containsDataKeySuffix(updatedName) { int separatorIndex = updatedName.indexOf(DATA_KEY_SEPARATOR); string suffix = updatedName.substring(separatorIndex + 1); string testPart = updatedName.substring(0, separatorIndex); - if (filterSubTests.hasKey(updatedName) && filterSubTests[updatedName] is string[]) { - string[] subTestList = filterSubTests[testPart]; + if testOptions.isFilterSubTestsContains(updatedName) && testOptions.getFilterSubTest(updatedName) is string[] { + string[] subTestList = testOptions.getFilterSubTest(testPart); subTestList.push(suffix); + testOptions.addFilterSubTest(testPart, subTestList); } else { - filterSubTests[testPart] = [suffix]; + testOptions.addFilterSubTest(testPart, [suffix]); } updatedName = testPart; } - filterTests.push(updatedName); - filterTestModules[updatedName] = prefix; + testOptions.addFilterTest(updatedName); + testOptions.setFilterTestModule(updatedName, prefix); } } @@ -96,8 +93,18 @@ function parseBooleanInput(string input, string variableName) returns boolean { return booleanVariable; } +function parseIntegerInput(string input, string variableName) returns int { + int|error intVariable = int:fromString(input); + if intVariable is error { + println(string `Invalid '${variableName}' parameter: ${intVariable.message()}`); + terminate = true; + return 0; + } + return intVariable; +} + function parseRerunJson() returns error? { - string rerunJsonFilePath = targetPath + "/" + RERUN_JSON_FILE; + string rerunJsonFilePath = testOptions.getTargetPath() + "/" + RERUN_JSON_FILE; // if there are no previous `bal test`` runs if !fileExists(rerunJsonFilePath) { @@ -112,17 +119,17 @@ function parseRerunJson() returns error? { // but they are abstracted from the user return error("error while running failed tests : Invalid failed test data. Please run `bal test` command."); } - ModuleRerunJson? moduleRerunJson = rerunJson[moduleName]; + ModuleRerunJson? moduleRerunJson = rerunJson[testOptions.getModuleName()]; if moduleRerunJson is () { return error("error while running failed tests : Invalid failed test data. Please run `bal test` command."); } - filterTests = moduleRerunJson.testNames; - filterTestModules = moduleRerunJson.testModuleNames; - filterSubTests = moduleRerunJson.subTestNames; + testOptions.setFilterTests(moduleRerunJson.testNames); + testOptions.setFilterTestModules(moduleRerunJson.testModuleNames); + testOptions.setFilterSubTests(moduleRerunJson.subTestNames); } -function readRerunJson() returns map|error { - string|error content = trap readContent(targetPath + "/" + RERUN_JSON_FILE); +isolated function readRerunJson() returns map|error { + string|error content = trap readContent(testOptions.getTargetPath() + "/" + RERUN_JSON_FILE); if content is error { return content; } @@ -130,15 +137,15 @@ function readRerunJson() returns map|error { } function containsModulePrefix(string packageName, string moduleName, string testName) returns boolean { - if (containsAPrefix(testName)) { + if containsAPrefix(testName) { return isPrefixInCorrectFormat(packageName, moduleName, testName); } return false; } function containsAPrefix(string testName) returns boolean { - if (testName.includes(MODULE_SEPARATOR)) { - if (containsDataKeySuffix(testName)) { + if testName.includes(MODULE_SEPARATOR) { + if containsDataKeySuffix(testName) { return testName.indexOf(MODULE_SEPARATOR) < testName.indexOf(DATA_KEY_SEPARATOR); } return true; @@ -155,6 +162,7 @@ function isPrefixInCorrectFormat(string packageName, string moduleName, string t return prefix.includes(packageName) || prefix.includes(packageName + DOT + moduleName); } -function getFullModuleName() returns string { - return packageName == moduleName ? packageName : packageName + DOT + moduleName; +isolated function getFullModuleName() returns string { + return testOptions.getPackageName() == testOptions.getModuleName() ? testOptions.getPackageName() + : testOptions.getPackageName() + DOT + testOptions.getModuleName(); } diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/mock.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/mock.bal index b9df5b0117e6..729939cc76e5 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/mock.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/mock.bal @@ -228,10 +228,10 @@ public isolated function when(MockFunction mockFunction) returns FunctionStub { } # Represents a MockFunction object. -public class MockFunction { - string functionToMock = ""; - string functionToMockPackage = ""; - string[] mockFunctionClasses = []; +public isolated class MockFunction { + private string functionToMock = ""; + private string functionToMockPackage = ""; + private string[] mockFunctionClasses = []; } # Represents an object that allows stubbing function invocations. diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/register.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/register.bal index f36f75326251..70acd4171188 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/register.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/register.bal @@ -13,52 +13,402 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. +import ballerina/lang.array; -final TestRegistry testRegistry = new (); -final TestRegistry beforeSuiteRegistry = new (); -final TestRegistry afterSuiteRegistry = new (); -final TestRegistry beforeEachRegistry = new (); -final TestRegistry afterEachRegistry = new (); +final TestRegistry testRegistry = new; +final TestRegistry beforeSuiteRegistry = new; +final TestRegistry afterSuiteRegistry = new; +final TestRegistry beforeEachRegistry = new; +final TestRegistry afterEachRegistry = new; -final GroupRegistry beforeGroupsRegistry = new (); -final GroupRegistry afterGroupsRegistry = new (); -final GroupStatusRegistry groupStatusRegistry = new (); +final GroupRegistry beforeGroupsRegistry = new; +final GroupRegistry afterGroupsRegistry = new; +final GroupStatusRegistry groupStatusRegistry = new; type TestFunction record {| string name; function executableFunction; - boolean enabled = true; - DataProviderReturnType? params = (); function? before = (); function? after = (); boolean alwaysRun = false; - string[] groups = []; - boolean skip = false; + readonly & string[] groups = []; error? diagnostics = (); - function[] dependsOn = []; + readonly & function[] dependsOn = []; + boolean serialExecution = false; + TestConfig? config = (); +|} & readonly; + +type TestFunctionMetaData record {| + boolean enabled = true; + boolean skip = false; int dependsOnCount = 0; TestFunction[] dependents = []; boolean visited = false; - TestConfig? config = (); + boolean isReadyToExecute = false; + TestCompletionStatus executionCompletionStatus = YET_TO_COMPLETE; |}; -class TestRegistry { +isolated class ConcurrentExecutionManager { + private final TestFunction[] parallelTestExecutionList = []; + private final TestFunction[] serialTestExecutionList = []; + private final TestFunction[] testsInExecution = []; + private final map testMetaData = {}; + private boolean parallelExecutionEnabled = false; + + isolated function createTestFunctionMetaData(string functionName, int dependsOnCount, boolean enabled) { // accept as readonly (str, str, int,boolean) param and remove clone usage + lock { + self.testMetaData[functionName] = {dependsOnCount: dependsOnCount, enabled: enabled}; + } + } + + isolated function setExecutionCompleted(string functionName) { + lock { + self.testMetaData[functionName].executionCompletionStatus = COMPLETED; + } + } + + isolated function setExecutionSuspended(string functionName) { + lock { + self.testMetaData[functionName].executionCompletionStatus = SUSPENDED; + } + } + + isolated function setDisabled(string functionName) { + lock { + self.testMetaData[functionName].enabled = false; + } + } + + isolated function setEnabled(string functionName) { + lock { + self.testMetaData[functionName].enabled = true; + } + } + + isolated function isEnabled(string functionName) returns boolean { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[functionName]; + return testFunctionMetaData is TestFunctionMetaData && testFunctionMetaData.enabled; + } + } + + isolated function setVisited(string functionName) { + lock { + self.testMetaData[functionName].visited = true; + } + } + + isolated function isVisited(string functionName) returns boolean { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[functionName]; + return testFunctionMetaData is TestFunctionMetaData && testFunctionMetaData.visited; + } + } + + isolated function isSkip(string functionName) returns boolean { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[functionName]; + return testFunctionMetaData is TestFunctionMetaData && testFunctionMetaData.skip; + + } + } + + isolated function setSkip(string functionName) { + lock { + self.testMetaData[functionName].skip = true; + } + } + + isolated function addDependent(string functionName, TestFunction dependent) { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[functionName]; + if testFunctionMetaData is TestFunctionMetaData { + testFunctionMetaData.dependents.push(dependent); + } + } + } + + isolated function getDependents(string functionName) returns TestFunction[] { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[functionName]; + if testFunctionMetaData is TestFunctionMetaData { + return testFunctionMetaData.dependents.clone(); + } + return []; + } + } + + isolated function setParallelExecutionStatus(boolean isParalleleExecutionEnabled) { + lock { + self.parallelExecutionEnabled = isParalleleExecutionEnabled; + } + } + + isolated function isParallelExecutionEnabled() returns boolean { + lock { + return self.parallelExecutionEnabled; + } + } + + isolated function addInitialParallelTest(TestFunction testFunction) { + lock { + self.parallelTestExecutionList.unshift(testFunction); + } + } + + isolated function addInitialSerialTest(TestFunction testFunction) { + lock { + self.serialTestExecutionList.unshift(testFunction); + } + } + + isolated function countTestInExecution() returns int { + lock { + return self.testsInExecution.length(); + } + } + + isolated function addTestInExecution(TestFunction testFunction) { + lock { + self.testsInExecution.push(testFunction); + } + } + + isolated function getSerialQueueLength() returns int { + lock { + return self.serialTestExecutionList.length(); + } + } + + isolated function getParallelQueueLength() returns int { + lock { + return self.parallelTestExecutionList.length(); + } + } + + isolated function isExecutionDone() returns boolean { + lock { + return self.parallelTestExecutionList.length() == 0 && + self.serialTestExecutionList.length() == 0 && + self.testsInExecution.length() == 0; + } + } + + isolated function getParallelTest() returns TestFunction { + lock { + return self.parallelTestExecutionList.remove(0); + } + } + + isolated function getSerialTest() returns TestFunction { + lock { + return self.serialTestExecutionList.pop(); + } + } + + isolated function populateExecutionQueues() { + lock { + int i = 0; + TestCompletionStatus executionCompletionStatus = YET_TO_COMPLETE; + while i < self.testsInExecution.length() { + TestFunction testInProgress = self.testsInExecution[i]; + TestFunctionMetaData? inProgressTestMetaData = self.testMetaData[testInProgress.name]; + if inProgressTestMetaData == () { + continue; + } + executionCompletionStatus = inProgressTestMetaData.executionCompletionStatus; + if executionCompletionStatus == COMPLETED { + inProgressTestMetaData.dependents.reverse().forEach(dependent => self.checkExecutionReadiness(dependent)); + _ = self.testsInExecution.remove(i); + } else if executionCompletionStatus == SUSPENDED { + _ = self.testsInExecution.remove(i); + } else { + i += 1; + } + } + } + } + + private isolated function checkExecutionReadiness(TestFunction testFunction) { + lock { + TestFunctionMetaData? testFunctionMetaData = self.testMetaData[testFunction.name]; + if testFunctionMetaData == () { + return; + } + testFunctionMetaData.dependsOnCount -= 1; + if testFunctionMetaData.dependsOnCount != 0 || testFunctionMetaData.isReadyToExecute { + return; + } + testFunctionMetaData.isReadyToExecute = true; + if !testFunction.serialExecution { + self.parallelTestExecutionList.push(testFunction); + } else { + self.serialTestExecutionList.push(testFunction); + } + } + } +} + +isolated class TestOptions { + private string moduleName = ""; + private string packageName = ""; + private string targetPath = ""; + private map filterTestModules = {}; + private boolean hasFilteredTests = false; + private string[] filterTests = []; + private map filterSubTests = {}; + + isolated function isFilterSubTestsContains(string key) returns boolean { + lock { + return self.filterSubTests.hasKey(key); + } + } + + isolated function getFilterSubTest(string key) returns string[] { + lock { + string[]? nullOrSubTests = self.filterSubTests[key]; + if nullOrSubTests is string[] { // TODO: use ternary + return nullOrSubTests.clone(); + } + return []; + } + } + + isolated function addFilterSubTest(string key, string[] subTests) { + lock { + self.filterSubTests[key] = subTests.clone(); + } + } + + isolated function setFilterSubTests(map filterSubTests) { + lock { + self.filterSubTests = filterSubTests.clone(); + } + } + + isolated function setFilterTests(string[] filterTests) { + lock { + self.filterTests = filterTests.clone(); + } + } + + isolated function addFilterTest(string filterTest) { + lock { + self.filterTests.push(filterTest); + } + } + + isolated function getFilterTestSize() returns int { + lock { + return self.filterTests.length(); + } + } + + isolated function getFilterTestIndex(string testName) returns int? { + lock { + return self.filterTests.indexOf(testName); + } + } + + isolated function getFilterTests() returns string[] { + lock { + return self.filterTests.clone(); + } + } + + isolated function setModuleName(string moduleName) { + lock { + self.moduleName = moduleName; + } + } + + isolated function setPackageName(string packageName) { + lock { + self.packageName = packageName; + } + } + + isolated function getModuleName() returns string { + lock { + return self.moduleName; + } + } + + isolated function getPackageName() returns string { + lock { + return self.packageName; + } + } + + isolated function setTargetPath(string targetPath) { + lock { + self.targetPath = targetPath; + } + } + + isolated function getTargetPath() returns string { + lock { + return self.targetPath; + } + } + + isolated function setFilterTestModules(map filterTestModulesMap) { + lock { + self.filterTestModules = filterTestModulesMap.clone(); + } + } + + isolated function getFilterTestModule(string name) returns string? { + lock { + return self.filterTestModules[name]; + } + } + + isolated function setFilterTestModule(string key, string? value) { + lock { + self.filterTestModules[key] = value; + } + } + + isolated function setHasFilteredTests(boolean hasFilteredTests) { + lock { + self.hasFilteredTests = hasFilteredTests; + } + } + + isolated function getHasFilteredTests() returns boolean { + lock { + return self.hasFilteredTests; + } + } + +} + +isolated class TestRegistry { private final TestFunction[] rootRegistry = []; private final TestFunction[] dependentRegistry = []; - function addFunction(*TestFunction functionDetails) { + isolated function addFunction(*TestFunction functionDetails) { if functionDetails.dependsOn == [] { - self.rootRegistry.push(functionDetails); + lock { + self.rootRegistry.push(functionDetails); + } } else { - self.dependentRegistry.push(functionDetails); + lock { + self.dependentRegistry.push(functionDetails); + } } } - function getTestFunction(function f) returns TestFunction|error { + isolated function getTestFunction(function f) returns TestFunction|error { TestFunction[] filter; - filter = self.rootRegistry.filter(testFunction => f === testFunction.executableFunction); + lock { + filter = self.rootRegistry.filter(testFunction => f === testFunction.executableFunction).clone(); + } if filter.length() == 0 { - filter = self.dependentRegistry.filter(testFunction => f === testFunction.executableFunction); + lock { + filter = self.dependentRegistry.filter(testFunction => f === testFunction.executableFunction).clone(); + } if filter.length() == 0 { //TODO: need to obtain the function name form the variable return error(string `The dependent test function is either disabled or not included.`); @@ -67,76 +417,103 @@ class TestRegistry { return filter.pop(); } - function getFunctions() returns TestFunction[] => self.rootRegistry.sort(key = testFunctionsSort); - - function getDependentFunctions() returns TestFunction[] => self.dependentRegistry; + isolated function getFunctions() returns TestFunction[] { + lock { + return self.rootRegistry.sort(array:ASCENDING, (item) => item.name).clone(); + } + } + isolated function getDependentFunctions() returns TestFunction[] { + lock { + return self.dependentRegistry.clone(); + } + } } -class GroupRegistry { +isolated class GroupRegistry { private final map registry = {}; function addFunction(string 'group, *TestFunction testFunction) { - if self.registry.hasKey('group) { - self.registry.get('group).push(testFunction); - } else { - self.registry['group] = [testFunction]; + lock { + if self.registry.hasKey('group) { + self.registry.get('group).push(testFunction); + } else { + self.registry['group] = [testFunction]; + } } } - function getFunctions(string 'group) returns TestFunction[]? { - if self.registry.hasKey('group) { - return self.registry.get('group); + isolated function getFunctions(string 'group) returns TestFunction[]? { + lock { + if self.registry.hasKey('group) { + return self.registry.get('group).clone(); + } + return; } - return; } } -class GroupStatusRegistry { +isolated class GroupStatusRegistry { private final map enabledTests = {}; private final map totalTests = {}; private final map executedTests = {}; private final map skip = {}; - function firstExecuted(string 'group) returns boolean => self.executedTests.get('group) > 0; - - function lastExecuted(string 'group) returns boolean => self.executedTests.get('group) == self.enabledTests.get('group); - - function incrementTotalTest(string 'group, boolean enabled) { - if self.totalTests.hasKey('group) { - self.totalTests['group] = self.totalTests.get('group) + 1; - } else { - self.totalTests['group] = 1; + isolated function firstExecuted(string 'group) returns boolean { + lock { + return self.executedTests.get('group) > 0; + } + } + isolated function lastExecuted(string 'group) returns boolean { + lock { + return self.executedTests.get('group) == self.enabledTests.get('group); } - if enabled { - self.skip['group] = false; - if self.enabledTests.hasKey('group) { - self.enabledTests['group] = self.enabledTests.get('group) + 1; + } + + isolated function incrementTotalTest(string 'group, boolean enabled) { + lock { + if self.totalTests.hasKey('group) { + self.totalTests['group] = self.totalTests.get('group) + 1; } else { - self.enabledTests['group] = 1; - self.executedTests['group] = 0; + self.totalTests['group] = 1; + } + if enabled { + self.skip['group] = false; + if self.enabledTests.hasKey('group) { + self.enabledTests['group] = self.enabledTests.get('group) + 1; + } else { + self.enabledTests['group] = 1; + self.executedTests['group] = 0; + } } } } - function incrementExecutedTest(string 'group) { - if self.executedTests.hasKey('group) { - self.executedTests['group] = self.executedTests.get('group) + 1; - } else { - self.executedTests['group] = 1; + isolated function incrementExecutedTest(string 'group) { + lock { + if self.executedTests.hasKey('group) { + self.executedTests['group] = self.executedTests.get('group) + 1; + } else { + self.executedTests['group] = 1; + } } } - function setSkipAfterGroup(string 'group) { - self.skip['group] = true; + isolated function setSkipAfterGroup(string 'group) { + lock { + self.skip['group] = true; + } } - function getSkipAfterGroup(string 'group) returns boolean => self.skip.get('group); + isolated function getSkipAfterGroup(string 'group) returns boolean { + lock { + return self.skip.get('group); + } + } - function getGroupsList() returns string[] => self.totalTests.keys(); + isolated function getGroupsList() returns string[] { + lock { + return self.totalTests.keys().clone(); + } + } } - -isolated function testFunctionsSort(TestFunction testFunction) returns string => testFunction.name; - -function isDataDrivenTest(TestFunction testFunction) returns boolean => - testFunction.params is map || testFunction.params is AnyOrError[][]; diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/report.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/report.bal index b3f35f595a84..8bd263c14a78 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/report.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/report.bal @@ -21,7 +21,7 @@ const string TESTS_CACHE_DIRECTORY = "tests_cache"; type ReportGenerate function (ReportData data); -ReportData reportData = new (); +final ReportData reportData = new (); ReportGenerate[] reportGenerators = [consoleReport, failedTestsReport]; @@ -30,59 +30,132 @@ type ResultData record {| string suffix = ""; string message = ""; TestType testType; -|}; +|} & readonly; -class Result { +isolated class Result { private ResultData data; - function init(ResultData data) { - self.data = data; + isolated function init(ResultData data) { + lock { + self.data = data.clone(); + } } - function fullName() returns string => - self.data.suffix == "" ? self.data.name : self.data.name + DATA_KEY_SEPARATOR + self.data.suffix; + isolated function fullName() returns string { + lock { + return self.data.suffix == "" ? self.data.name : self.data.name + DATA_KEY_SEPARATOR + self.data.suffix; + } + } - function isDataProvider() returns boolean => self.data.suffix != ""; + isolated function isDataProvider() returns boolean { + lock { + return self.data.suffix != ""; + } + } - function testPrefix() returns string => self.data.name; + isolated function testPrefix() returns string { + lock { + return self.data.name; + } + } - function testSuffix() returns string => self.data.suffix; + isolated function testSuffix() returns string { + lock { + return self.data.suffix; + } + } - function message() returns string => self.data.message; + isolated function message() returns string { + lock { + return self.data.message; + } + } - function testType() returns TestType => self.data.testType; + isolated function testType() returns TestType { + lock { + return self.data.testType; + } + } } -class ReportData { - private Result[] passed = []; - private Result[] failed = []; - private Result[] skipped = []; +isolated class ReportData { + private final ResultData[] passed = []; + private final ResultData[] failed = []; + private final ResultData[] skipped = []; + + isolated function onPassed(*ResultData result) { + lock { + self.passed.push(result); + } + } - function onPassed(*ResultData result) => self.passed.push(new Result(result)); - function onFailed(*ResultData result) => self.failed.push(new Result(result)); - function onSkipped(*ResultData result) => self.skipped.push(new Result(result)); + isolated function onFailed(*ResultData result) { + lock { + self.failed.push(result); + } + } - function passedCases() returns Result[] => self.passed; - function failedCases() returns Result[] => self.failed; - function skippedCases() returns Result[] => self.skipped; + isolated function onSkipped(*ResultData result) { + lock { + self.skipped.push(result); + } + } - function passedCount() returns int => self.passed.length(); - function failedCount() returns int => self.failed.length(); - function skippedCount() returns int => self.skipped.length(); + isolated function passedCases() returns ResultData[] { + lock { + return self.passed.clone(); + } + } + + isolated function failedCases() returns ResultData[] { + lock { + return self.failed.clone(); + } + } + + function skippedCases() returns ResultData[] { + lock { + return self.skipped.clone(); + } + } + + isolated function passedCount() returns int { + lock { + return self.passed.length(); + } + } + + isolated function failedCount() returns int { + lock { + return self.failed.length(); + } + } + + isolated function skippedCount() returns int { + lock { + return self.skipped.length(); + } + } } -function consoleReport(ReportData data) { - if (!isSystemConsole()) { - data.passedCases().forEach(entry => println("\t\t[pass] " + entry.fullName())); +isolated function consoleReport(ReportData data) { + if !isSystemConsole() { + data.passedCases().forEach(isolated function(ResultData entrydata) { + Result entry = new (entrydata); + println("\t\t[pass] " + entry.fullName()); + }); } - data.failedCases().forEach(function(Result entry) { + + data.failedCases().forEach(isolated function(ResultData entrydata) { + Result entry = new (entrydata); println("\n\t\t[fail] " + entry.fullName() + ":"); println("\n\t\t " + formatFailedError(entry.message(), 3)); }); int totalTestCount = data.passedCount() + data.failedCount() + data.skippedCount(); + println("\n"); - if (totalTestCount == 0) { + if totalTestCount == 0 { println("\t\tNo tests found"); } else { println("\t\t" + data.passedCount().toString() + " passing"); @@ -91,7 +164,7 @@ function consoleReport(ReportData data) { } } -function formatFailedError(string message, int tabCount) returns string { +isolated function formatFailedError(string message, int tabCount) returns string { string[] lines = split(message, "\n"); lines.push(""); string tabs = ""; @@ -103,18 +176,19 @@ function formatFailedError(string message, int tabCount) returns string { return string:'join("\n" + tabs, ...lines); } -function failedTestsReport(ReportData data) { +isolated function failedTestsReport(ReportData data) { string[] testNames = []; map testModuleNames = {}; map subTestNames = {}; - foreach Result result in data.failedCases() { + foreach ResultData resultdata in data.failedCases() { + Result result = new (resultdata); string testPrefix = result.testPrefix(); string testSuffix = result.testType() == DATA_DRIVEN_MAP_OF_TUPLE ? SINGLE_QUOTE + result.testSuffix() + SINGLE_QUOTE : result.testSuffix(); testNames.push(testPrefix); - testModuleNames[testPrefix] = moduleName; - if (result.isDataProvider()) { - if (subTestNames.hasKey(testPrefix) && subTestNames[testPrefix] is string[]) { + testModuleNames[testPrefix] = testOptions.getModuleName(); + if result.isDataProvider() { + if subTestNames.hasKey(testPrefix) && subTestNames[testPrefix] is string[] { string[] subTestList = subTestNames[testPrefix]; subTestList.push(testSuffix); } else { @@ -123,7 +197,7 @@ function failedTestsReport(ReportData data) { } } ModuleRerunJson moduleReport = {testNames, testModuleNames, subTestNames}; - string filePath = targetPath + "/" + RERUN_JSON_FILE; + string filePath = testOptions.getTargetPath() + "/" + RERUN_JSON_FILE; map rerunJson; if fileExists(filePath) { @@ -136,7 +210,7 @@ function failedTestsReport(ReportData data) { } else { rerunJson = {}; } - rerunJson[moduleName] = moduleReport; + rerunJson[testOptions.getModuleName()] = moduleReport; error? err = writeContent(filePath, rerunJson.toString()); if err is error { @@ -147,16 +221,16 @@ function failedTestsReport(ReportData data) { function moduleStatusReport(ReportData data) { map[] tests = []; data.passedCases().forEach(result => tests.push({ - "name": escapeSpecialCharactersJson(result.fullName()), + "name": escapeSpecialCharactersJson(new Result(result).fullName()), "status": "PASSED" })); data.failedCases().forEach(result => tests.push({ - "name": escapeSpecialCharactersJson(result.fullName()), + "name": escapeSpecialCharactersJson(new Result(result).fullName()), "status": "FAILURE", - "failureMessage": replaceDoubleQuotes(result.message()) + "failureMessage": replaceDoubleQuotes(new Result(result).message()) })); data.skippedCases().forEach(result => tests.push({ - "name": escapeSpecialCharactersJson(result.fullName()), + "name": escapeSpecialCharactersJson((new Result(result).fullName())), "status": "SKIPPED" })); @@ -168,8 +242,8 @@ function moduleStatusReport(ReportData data) { "tests": tests }; - error? err = writeContent(targetPath + "/" + CACHE_DIRECTORY + "/" + TESTS_CACHE_DIRECTORY - + "/" + moduleName + "/" + MODULE_STATUS_JSON_FILE, output.toString()); + error? err = writeContent(testOptions.getTargetPath() + "/" + CACHE_DIRECTORY + "/" + TESTS_CACHE_DIRECTORY + + "/" + testOptions.getModuleName() + "/" + MODULE_STATUS_JSON_FILE, output.toString()); if err is error { println(err.message()); } diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/serialExecuter.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/serialExecuter.bal new file mode 100644 index 000000000000..2a445209a4e0 --- /dev/null +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/serialExecuter.bal @@ -0,0 +1,147 @@ +// Copyright (c) 2024 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +function executeTest(TestFunction testFunction) { + if !isTestReadyToExecute(testFunction, dataDrivenTestParams[testFunction.name]) { + return; + } + + executeBeforeGroupFunctions(testFunction); + executeBeforeEachFunctions(); + + boolean shouldSkipDependents = false; + if !isSkipFunction(testFunction) { + if isDataDrivenTest(dataDrivenTestParams[testFunction.name]) { + executeDataDrivenTestSet(testFunction); + } else { + shouldSkipDependents = executeNonDataDrivenTest(testFunction); + } + } else { + reportData.onSkipped(name = testFunction.name, testType = getTestType(dataDrivenTestParams[testFunction.name])); + shouldSkipDependents = true; + } + testFunction.groups.forEach('group => groupStatusRegistry.incrementExecutedTest('group)); + executeAfterEachFunctions(); + executeAfterGroupFunctions(testFunction); + finishTestExecution(testFunction, shouldSkipDependents); +} + +function executeBeforeGroupFunctions(TestFunction testFunction) { + foreach string 'group in testFunction.groups { + TestFunction[]? beforeGroupFunctions = beforeGroupsRegistry.getFunctions('group); + if beforeGroupFunctions != () && !groupStatusRegistry.firstExecuted('group) { + handleBeforeGroupOutput(testFunction, 'group, executeFunctions(beforeGroupFunctions, getShouldSkip())); + } + } +} + +function executeBeforeEachFunctions() => + handleBeforeEachOutput(executeFunctions(beforeEachRegistry.getFunctions(), getShouldSkip())); + +function executeDataDrivenTestSet(TestFunction testFunction) { + DataProviderReturnType? params = dataDrivenTestParams[testFunction.name]; + string[] keys = []; + AnyOrError[][] values = []; + TestType testType = prepareDataSet(params, keys, values); + + while keys.length() != 0 { + string key = keys.remove(0); + AnyOrError[] value = values.remove(0); + prepareDataDrivenTest(testFunction, key, value, testType); + } +} + +function executeNonDataDrivenTest(TestFunction testFunction) returns boolean { + if executeBeforeFunction(testFunction) { + conMgr.setSkip(testFunction.name); + reportData.onSkipped(name = testFunction.name, testType = getTestType(dataDrivenTestParams[testFunction.name])); + return true; + } + boolean failed = handleNonDataDrivenTestOutput(testFunction, executeTestFunction(testFunction, "", GENERAL_TEST)); + if executeAfterFunction(testFunction) { + return true; + } + return failed; +} + +function executeAfterEachFunctions() => + handleAfterEachOutput(executeFunctions(afterEachRegistry.getFunctions(), getShouldSkip())); + +function executeAfterGroupFunctions(TestFunction testFunction) { + foreach string 'group in testFunction.groups { + TestFunction[]? afterGroupFunctions = afterGroupsRegistry.getFunctions('group); + if afterGroupFunctions != () && groupStatusRegistry.lastExecuted('group) { + ExecutionError? err = executeFunctions(afterGroupFunctions, + getShouldSkip() || groupStatusRegistry.getSkipAfterGroup('group)); + handleAfterGroupOutput(err); + } + } +} + +function executeFunctions(TestFunction[] testFunctions, boolean skip = false) returns ExecutionError? { + foreach TestFunction testFunction in testFunctions { + if !skip || testFunction.alwaysRun { + check executeFunction(testFunction); + } + } +} + +function prepareDataDrivenTest(TestFunction testFunction, string key, AnyOrError[] value, TestType testType) { + if executeBeforeFunction(testFunction) { + reportData.onSkipped(name = testFunction.name, testType = getTestType(dataDrivenTestParams[testFunction.name])); + } else { + executeDataDrivenTest(testFunction, key, testType, value); + _ = executeAfterFunction(testFunction); + } +} + +function executeDataDrivenTest(TestFunction testFunction, string suffix, TestType testType, AnyOrError[] params) { + if skipDataDrivenTest(testFunction, suffix, testType) { + return; + } + ExecutionError|boolean err = executeTestFunction(testFunction, suffix, testType, params); + handleDataDrivenTestOutput(err, testFunction, suffix, testType); +} + +function executeBeforeFunction(TestFunction testFunction) returns boolean { + boolean failed = false; + if isBeforeFuncConditionMet(testFunction) { + failed = handleBeforeFunctionOutput(executeFunction(testFunction.before)); + } + return failed; +} + +function executeTestFunction(TestFunction testFunction, string suffix, TestType testType, AnyOrError[]? params = ()) returns ExecutionError|boolean { + any|error output = params == () ? trap function:call(testFunction.executableFunction) + : trap function:call(testFunction.executableFunction, ...params); + return handleTestFuncOutput(output, testFunction, suffix, testType); +} + +function executeAfterFunction(TestFunction testFunction) returns boolean { + boolean failed = false; + if isAfterFuncConditionMet(testFunction) { + failed = handleAfterFunctionOutput(executeFunction(testFunction.after)); + } + return failed; +} + +function executeFunction(TestFunction|function testFunction) returns ExecutionError? { + any|error output = trap function:call(testFunction is function ? testFunction : testFunction.executableFunction); + if output is error { + enableExit(); + return error(getErrorMessage(output), functionName = testFunction is function ? "" : testFunction.name); + } +} diff --git a/misc/testerina/modules/testerina-core/src/main/ballerina/types.bal b/misc/testerina/modules/testerina-core/src/main/ballerina/types.bal index 3e1258f8182b..8866d681eb94 100644 --- a/misc/testerina/modules/testerina-core/src/main/ballerina/types.bal +++ b/misc/testerina/modules/testerina-core/src/main/ballerina/types.bal @@ -17,7 +17,7 @@ # Possible return types of the data provider function. public type DataProviderReturnType error|map|AnyOrError[][]; -public type AnyOrError any|error; +type AnyOrError any|error; # Represents errors generated by the Testerina module. public type TestError distinct error; @@ -35,3 +35,9 @@ enum TestType { DATA_DRIVEN_TUPLE_OF_TUPLE, DATA_DRIVEN_MAP_OF_TUPLE } + +enum TestCompletionStatus { + YET_TO_COMPLETE, + SUSPENDED, + COMPLETED +} diff --git a/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/natives/CommonUtils.java b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/natives/CommonUtils.java new file mode 100644 index 000000000000..3022f1edc316 --- /dev/null +++ b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/natives/CommonUtils.java @@ -0,0 +1,66 @@ +// Copyright (c) 2023 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + +package org.ballerinalang.testerina.natives; + +import io.ballerina.runtime.api.types.FunctionType; +import io.ballerina.runtime.api.types.Parameter; +import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.UnionType; +import io.ballerina.runtime.api.values.BDecimal; +import io.ballerina.runtime.api.values.BFunctionPointer; + + +/** + * Common utility functions for the Testerina module. + * + * @since 2201.9.0 + */ +public class CommonUtils { + public static BDecimal currentTimeInMillis() { + return BDecimal.valueOf(System.currentTimeMillis()); + } + + public static Object isFunctionParamConcurrencySafe(BFunctionPointer func) { + FunctionType functionType = (FunctionType) func.getType(); + Parameter[] functionParameters = functionType.getParameters(); + for (Parameter functionParameter : functionParameters) { + Type parameterType = functionParameter.type; + if (!isSubTypeOfReadOnly(parameterType)) { + return false; + } + } + return true; + } + + private static boolean isSubTypeOfReadOnly(Type type) { + if (type.isReadOnly()) { + return true; + } + + if (!(type instanceof UnionType)) { + return false; + } + + for (Type memberType : ((UnionType) type).getMemberTypes()) { + if (!isSubTypeOfReadOnly(memberType)) { + return false; + } + } + return true; + } +} diff --git a/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/BTestMain.java b/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/BTestMain.java index f67718635500..f0944fa106fd 100644 --- a/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/BTestMain.java +++ b/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/BTestMain.java @@ -79,7 +79,7 @@ public static void main(String[] args) throws IOException { if (args.length >= 4) { Path targetPath = Paths.get(args[0]); Path testCache = targetPath.resolve(ProjectConstants.CACHES_DIR_NAME) - .resolve(ProjectConstants.TESTS_CACHE_DIR_NAME); + .resolve(ProjectConstants.TESTS_CACHE_DIR_NAME); String jacocoAgentJarPath = args[1]; boolean report = Boolean.parseBoolean(args[2]); boolean coverage = Boolean.parseBoolean(args[3]); diff --git a/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/util/TesterinaConstants.java b/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/util/TesterinaConstants.java index 5e6084bd5391..c390c918d616 100644 --- a/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/util/TesterinaConstants.java +++ b/misc/testerina/modules/testerina-runtime/src/main/java/org/ballerinalang/test/runtime/util/TesterinaConstants.java @@ -100,5 +100,5 @@ public class TesterinaConstants { public static final int IDENTIFIER_START_INDEX = 1; public static final int IDENTIFIER_END_INDEX = 5; - + public static final int DEFAULT_TEST_WORKERS = 1; } diff --git a/tests/jballerina-integration-test/src/test/resources/troubleshoot/strandDump/testOutputs/balTestStrandDumpRegEx.txt b/tests/jballerina-integration-test/src/test/resources/troubleshoot/strandDump/testOutputs/balTestStrandDumpRegEx.txt index e60dca503a85..98f6ee85c227 100644 --- a/tests/jballerina-integration-test/src/test/resources/troubleshoot/strandDump/testOutputs/balTestStrandDumpRegEx.txt +++ b/tests/jballerina-integration-test/src/test/resources/troubleshoot/strandDump/testOutputs/balTestStrandDumpRegEx.txt @@ -2,16 +2,16 @@ Ballerina Strand Dump \[\d*/\d*/\d* \d*:\d*:\d*\] =========================================== Total strand group count \t:\t3 -Total strand count \t:\t8 +Total strand count \t:\t9 Active strand group count\t:\t1 Active strand count \t:\t8 group \d* \[QUEUED\]: \[8\] \tstrand \d* "main" \[testOrg.testPackageWithModules.0:main\] \[BLOCKED\]: \t\tat\tballerina.lang.function.\d*.\d*.\d*:call\(function.bal:\d*\) -\t\t \tballerina.test.\d*.\d*.\d*:executeTestFunction\(execute.bal:\d*\) -\t\t \tballerina.test.\d*.\d*.\d*:executeNonDataDrivenTest\(execute.bal:\d*\) -\t\t \tballerina.test.\d*.\d*.\d*:executeTest\(execute.bal:\d*\) +\t\t \tballerina.test.\d*.\d*.\d*:executeTestFunction\(serialExecuter.bal:\d*\) +\t\t \tballerina.test.\d*.\d*.\d*:executeNonDataDrivenTest\(serialExecuter.bal:\d*\) +\t\t \tballerina.test.\d*.\d*.\d*:executeTest\(serialExecuter.bal:\d*\) \t\t \tballerina.test.\d*.\d*.\d*:executeTests\(execute.bal:\d*\) \t\t \tballerina.test.\d*.\d*.\d*:startSuite\(execute.bal:\d*\) \t\t \ttestOrg.testPackageWithModules.0.1.0:__execute__\(tests/test_execute-generated_1.bal:\d*\) @@ -50,6 +50,4 @@ group \d* \[QUEUED\]: \[8\] \t\t \ttestOrg.testPackageWithModules.anotherutils.0.1.0:\$lambda\$_0\(anotherutils.bal:34\) \tstrand \d* "w2" \[testOrg.testPackageWithModules.anotherutils.0:func3\]\[\d*\] \[BLOCKED ON WORKER MESSAGE RECEIVE\]: -\t\tat\ttestOrg.testPackageWithModules.anotherutils.0.1.0:\$lambda\$_1\(anotherutils.bal:42\) - -=========================================== +\t\tat\ttestOrg.testPackageWithModules.anotherutils.0.1.0:\$lambda\$_1\(anotherutils.bal:42\) \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/TestparallelizationTest.java b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/TestparallelizationTest.java new file mode 100644 index 000000000000..1b9e6b512940 --- /dev/null +++ b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/TestparallelizationTest.java @@ -0,0 +1,334 @@ +// Copyright (c) 2023 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + +package org.ballerinalang.testerina.test; + +import org.ballerinalang.test.context.BMainInstance; +import org.ballerinalang.test.context.BallerinaTestException; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.util.HashMap; + +/** + * Test class to test the parallel execution of Ballerina tests. + */ + +public class TestparallelizationTest extends BaseTestCase { + + public static final String PARALLEL_FLAG = "--parallel"; + private BMainInstance balClient; + private String projectPath; + + @BeforeClass + public void setup() throws BallerinaTestException { + balClient = new BMainInstance(balServer); + projectPath = projectBasedTestsPath.resolve("parallelisation-test").toString(); + } + + @Test + public void testParallelization() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "parallelisation-simple-test"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("61 passing") && output.contains("0 failing")); + args = mergeCoverageArgs(new String[]{"parallelisation-simple-test"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("61 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 / 3 > executionTimeW30); + } + + @Test + public void testNonParallelizable() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "parallelisation-serialExecution"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("61 passing") && output.contains("0 failing")); + + args = mergeCoverageArgs(new String[]{"parallelisation-serialExecution"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("61 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + + @Test + public void testParalallelizableTupleDataProvider() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "parallelisation-tuple-data-provider"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("30 passing") && output.contains("0 failing")); + args = mergeCoverageArgs(new String[]{"parallelisation-tuple-data-provider"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("30 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 / 3 > executionTimeW30); + } + + @Test + public void testParalallelizableMapDataProvider() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "parallelisation-map-data-provider"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + + args = mergeCoverageArgs(new String[]{"parallelisation-map-data-provider"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + Assert.assertTrue(executionTimeW1 / 3 > executionTimeW30); + } + + @Test + public void testNonParalallelizableTupleDataProvider() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-parallelisation-tuple-data-provider"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("30 passing") && output.contains("0 failing")); + + args = mergeCoverageArgs(new String[]{"non-parallelisation-tuple-data-provider"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("30 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedTestFunction() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'testAssertEquals*' cannot be parallelized, reason: " + + "non-isolated test function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-tests"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("60 passing") && output.contains("0 failing")); + for (int testNo = 1; testNo < 61; testNo++) { + Assert.assertTrue(output.contains(warningDiagnostics.replace("*", Integer.toString(testNo)))); + } + args = mergeCoverageArgs(new String[]{"non-isolated-tests"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("60 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedTestParameter() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "unsafe test parameters"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-test-params"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-test-params"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedDataProvider() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated data-provider function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-data-provider"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-data-provider"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedAfterEach() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated after-each function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-after-each"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-after-each"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedBeforeEach() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated before-each function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-before-each"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-before-each"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedAfterFunc() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated after function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-after-func"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-after-func"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedBeforeFunc() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated before function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-before-func"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-before-func"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedAfterGroup() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated after-group function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-after-grp"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-after-grp"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testNonIsolatedBeforeGroup() throws BallerinaTestException, IOException { + String warningDiagnostics = "WARNING: Test function 'mapDataProviderTest' cannot be parallelized, reason: " + + "non-isolated before-group function"; + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-isolated-before-grp"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(output.contains(warningDiagnostics)); + + args = mergeCoverageArgs(new String[]{"non-isolated-before-grp"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + @Test + public void testIsolatedSetUpTearDown() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "isolated-set-up-tear-down"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + + args = mergeCoverageArgs(new String[]{"isolated-set-up-tear-down"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("40 passing") && output.contains("0 failing")); + Assert.assertTrue(executionTimeW1 > 2 * executionTimeW30); + } + + @Test + public void testNonParalallelizableMapDataProvider() throws BallerinaTestException, IOException { + String[] args = mergeCoverageArgs(new String[]{PARALLEL_FLAG, "non-parallelisation-map-data-provider"}); + String output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW30 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + + args = mergeCoverageArgs(new String[]{"parallelisation-map-data-provider"}); + output = balClient.runMainAndReadStdOut("test", args, + new HashMap<>(), projectPath, false); + Float executionTimeW1 = getTimeForTestExecution(output); + Assert.assertTrue(output.contains("12 passing") && output.contains("28 failing")); + Assert.assertTrue(executionTimeW1 - executionTimeW30 < 1000); + } + + private float getTimeForTestExecution(String output) { + int firstPos = output.indexOf("Test execution time :") + ("Test execution time :").length(); + int lastPos = output.indexOf("ms", firstPos); + String executionTime = output.substring(firstPos, lastPos); + return Float.parseFloat(executionTime); + } +} diff --git a/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/AssertionUtils.java b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/AssertionUtils.java index c7fe87e4b36c..484856c16ac3 100644 --- a/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/AssertionUtils.java +++ b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/AssertionUtils.java @@ -48,9 +48,11 @@ public static void assertForTestFailures(String programOutput, String errMessage public static void assertOutput(String outputFileName, String output) throws IOException { if (isWindows) { + output = CommonUtils.replaceExecutionTime(output); String fileContent = Files.readString(commandOutputsDir.resolve("windows").resolve(outputFileName)); Assert.assertEquals(output.replaceAll("\r\n|\r", "\n"), fileContent.replaceAll("\r\n|\r", "\n")); } else { + output = CommonUtils.replaceExecutionTime(output); String fileContent = Files.readString(commandOutputsDir.resolve("unix").resolve(outputFileName)); Assert.assertEquals(output.stripTrailing(), fileContent.stripTrailing()); } diff --git a/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/CommonUtils.java b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/CommonUtils.java index d2a921f468d4..3ec2b442c7f3 100644 --- a/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/CommonUtils.java +++ b/tests/testerina-integration-test/src/test/java/org/ballerinalang/testerina/test/utils/CommonUtils.java @@ -28,6 +28,10 @@ public class CommonUtils { private CommonUtils() { } + public static String replaceExecutionTime(String content) { + return replaceVaryingString("Test execution time :", "ms", content); + } + public static String replaceVaryingString(String firstString, String endString, String content) { String modifiedContent = content; int firstPos = modifiedContent.indexOf(firstString); diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnnotations.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnnotations.txt index 84c0b28e1627..196f776e269f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnnotations.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnnotations.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage annotations + + Test execution time :*****ms + [pass] jsonDataProviderTest#0 [pass] stringDataProviderTest#0 [pass] stringDataProviderTest#1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnydataType.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnydataType.txt index e80746da0c4b..251a100f91a7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnydataType.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnydataType.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage anydata_type + + Test execution time :*****ms + [pass] testFn [pass] testFoo diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertBehavioralTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertBehavioralTypes.txt index 8094ac7014c8..e73dcf8230f0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertBehavioralTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertBehavioralTypes.txt @@ -7,6 +7,9 @@ WARNING [tests/assert-test-behavioral-types.bal:(24:5,24:32)] undocumented field Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertObjectArrayEquals [pass] testAssertObjectArrayEqualsNegative [pass] testAssertObjectArrayNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertDiffError.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertDiffError.txt index 4b559fabe080..cf58c29748bb 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertDiffError.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertDiffError.txt @@ -7,6 +7,9 @@ WARNING [tests/assertions-diff-error-messages.bal:(24:5,24:32)] undocumented fie Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertDecimalValues [pass] testAssertIntValues [pass] testAssertJsonArray diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertSequenceTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertSequenceTypes.txt index 5039e3ad3b74..dca971041dc8 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertSequenceTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertSequenceTypes.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertStringEquals [pass] testAssertStringEqualsNegative [pass] testAssertStringNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertStructuralTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertStructuralTypes.txt index c505d701066d..d9eba46174f4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertStructuralTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertStructuralTypes.txt @@ -7,6 +7,9 @@ WARNING [tests/assert-test-structural-types.bal:(24:5,24:18)] undocumented field Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertByteArrayEquals [pass] testAssertByteArrayEqualsNegative [pass] testAssertByteArrayNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertionErrorMessage.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertionErrorMessage.txt index 2a1f6069b005..88f3c4f861b4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertionErrorMessage.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertionErrorMessage.txt @@ -7,6 +7,9 @@ WARNING [tests/assertions-error-messages.bal:(24:5,24:32)] undocumented field 'p Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertAnnonymousRecords [pass] testAssertDecimalAndFloat [pass] testAssertDifferentObjects diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertions.txt index 174d59f90c93..a38252892ddf 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAssertions.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertBooleanEquals [pass] testAssertBooleanEqualsNegative [pass] testAssertBooleanNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAsyncInvocation.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAsyncInvocation.txt index 324b12bb6388..b838fd755867 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAsyncInvocation.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAsyncInvocation.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage async + + Test execution time :*****ms + [pass] testAsyncRemoteFunctionMain [pass] testAsyncRemoteFunctionTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeAfter.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeAfter.txt index fcadd56160e8..9801f014f366 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeAfter.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeAfter.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage before_after + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeEachAfterEach.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeEachAfterEach.txt index 604adaa14094..6f0ff836e2e6 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeEachAfterEach.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testBeforeEachAfterEach.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage before_each_after_each + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testDependsOn.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testDependsOn.txt index ba3d2354ba79..157431325eb7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testDependsOn.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testDependsOn.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage depends_on + + Test execution time :*****ms + [pass] test1 [pass] test2 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIntersectionTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIntersectionTypes.txt index c72c7d85dea8..4c8da78dd02f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIntersectionTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIntersectionTypes.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage intersection_type + + Test execution time :*****ms + [pass] testIntersectionTypes diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIsolatedFunctions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIsolatedFunctions.txt index 02a776acccfd..6dcd59fdbfc8 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIsolatedFunctions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testIsolatedFunctions.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage isolated_functions + + Test execution time :*****ms + [pass] testCallingIsolatedFunction [pass] testFunc [pass] testIsolatedTestFunction diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testJavaInterops.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testJavaInterops.txt index acdf428a0ccb..d34f50bafa2a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testJavaInterops.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testJavaInterops.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage interops + + Test execution time :*****ms + [pass] testInteropWithRestArgs diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testRuntimeApi.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testRuntimeApi.txt index 3e4b90f908ae..2fefbc59503f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testRuntimeApi.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/BasicCasesTest-testRuntimeApi.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage runtime_api + + Test execution time :*****ms + [pass] testRuntimeApi diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataProviderWithFail.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataProviderWithFail.txt index f98eb9b109db..dce31585e22f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataProviderWithFail.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataProviderWithFail.txt @@ -6,6 +6,15 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +intArrayDataProviderTest:0 has failed. + + +intArrayDataProviderTest:1 has failed. + + + Test execution time :*****ms + [pass] intArrayDataProviderTest#2 [fail] intArrayDataProviderTest#0: @@ -39,6 +48,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataRerunFailedTest.txt index 39ce53a17638..c75c9294fb03 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testArrayDataRerunFailedTest.txt @@ -7,6 +7,15 @@ Running Tests with Coverage dataproviders +intArrayDataProviderTest:0 has failed. + + +intArrayDataProviderTest:1 has failed. + + + Test execution time :*****ms + + [fail] intArrayDataProviderTest#0: error {ballerina/test:0}TestError ("The sum is not correct @@ -38,6 +47,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys0.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys0.txt index cdcfc3bafd4a..1a13e31ed4de 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys0.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys0.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#`'"\a"" @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys1.txt index 4c60ebe25dba..9cd385a52bde 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys1.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#"\u{D7FF}"" " @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys2.txt index e2fc31ea782c..18e4e31d9fab 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys2.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a + b @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys3.txt index 6f37022e5334..df714964b2f7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys3.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(x * 1) != (y / 3) || (a ^ b) == (b & c) >> (1 % 2) @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys4.txt index 8a335dc5b4b6..361c0e4c93f3 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys4.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys5.txt index 5b776d3557eb..7440c74f32d5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys5.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a:x(c,d)[]; ^(x|y).ok(); @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys6.txt index be52ca3dbfa0..3e1e46873468 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeys6.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#map v = { "x": 1 }; @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt index cdcfc3bafd4a..1a13e31ed4de 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#`'"\a"" @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt index 4c60ebe25dba..9cd385a52bde 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#"\u{D7FF}"" " @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt index e2fc31ea782c..18e4e31d9fab 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a + b @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt index 6f37022e5334..df714964b2f7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(x * 1) != (y / 3) || (a ^ b) == (b & c) >> (1 % 2) @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt index 8a335dc5b4b6..361c0e4c93f3 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt index 5b776d3557eb..7440c74f32d5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a:x(c,d)[]; ^(x|y).ok(); @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt index be52ca3dbfa0..3e1e46873468 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#map v = { "x": 1 }; @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderSingleFailure.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderSingleFailure.txt index 67999415aec0..463fafcb6bee 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderSingleFailure.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderSingleFailure.txt @@ -6,6 +6,12 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +testDividingValuesNegative:2 has failed. + + + Test execution time :*****ms + [pass] testDividingValuesNegative#0 [pass] testDividingValuesNegative#1 [pass] testDividingValuesNegative#3 @@ -15,16 +21,18 @@ Running Tests with Coverage [fail] testDividingValuesNegative#2: [fail data provider for the function testDividingValuesNegative] - error {ballerina/test:0}ExecutionError ("error("{ballerina}DivisionByZero",message=" / by zero") + error {ballerina/test:0}ExecutionError ("error("{ballerina}DivisionByZero",message=" / by zero") callableName: testDividingValuesNegative moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 191 callableName: testDividingValuesNegative$lambda14$ moduleName: intg_tests.dataproviders$test.0.tests.test_execute-generated_*****lineNumber: 18 ",functionName="testDividingValuesNegative") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ moduleName: intg_tests.dataproviders$test.0.tests.test_execute-generated_*****lineNumber: 27 @@ -35,6 +43,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderWithMixedType.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderWithMixedType.txt index 7ed941639e7f..d5ecda443430 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderWithMixedType.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testDataProviderWithMixedType.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction1#CaseNew1 [pass] testFunction1#CaseNew2 @@ -16,6 +19,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMapValueDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMapValueDataProvider.txt index 9edaed093d9a..b97306f40b2a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMapValueDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMapValueDataProvider.txt @@ -6,6 +6,12 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +testGetState:1 has failed. + + + Test execution time :*****ms + [pass] testGetState#0 [fail] testGetState#1: @@ -27,6 +33,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMultiModuleSingleTestExec.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMultiModuleSingleTestExec.txt index 83d80ca79a27..8a406dd6afc1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMultiModuleSingleTestExec.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testMultiModuleSingleTestExec.txt @@ -7,10 +7,16 @@ Running Tests with Coverage dataproviders + Test execution time :*****ms + + No tests found dataproviders.module1 + + Test execution time :*****ms + [pass] stringDataProviderMod1Test#1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testRerunFailedTest.txt index 3efb3cee68a6..9aeafa7c6abd 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testRerunFailedTest.txt @@ -7,6 +7,15 @@ Running Tests with Coverage dataproviders +intDataProviderTest:Case1 has failed. + + +intDataProviderTest:Case2 has failed. + + + Test execution time :*****ms + + [fail] intDataProviderTest#Case1: error {ballerina/test:0}TestError ("The sum is not correct @@ -38,6 +47,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProvider.txt index 71d15324a483..1b52641d6a2d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProvider.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] jsonDataProviderTest#json1 [pass] jsonDataProviderTest#json2 @@ -16,6 +19,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderCase.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderCase.txt index 60384e0ed00e..f4df9532f26d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderCase.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderCase.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] jsonDataProviderTest#json1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithAfterFailing.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithAfterFailing.txt index 77876783e10c..ad1050cea3ea 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithAfterFailing.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithAfterFailing.txt @@ -11,6 +11,9 @@ Running Tests with Coverage callableName: afterFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 153 callableName: afterFailsFunction$lambda72$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 160 + + Test execution time :*****ms + [pass] testDividingValuesWithAfterFailing#0 [pass] testDividingValuesWithAfterFailing#1 [pass] testDividingValuesWithAfterFailing#2 @@ -25,6 +28,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt index f14baa102f1b..77c327f83721 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testDividingValues#0 [pass] testDividingValues#1 [pass] testDividingValues#2 @@ -20,6 +23,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeFailing.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeFailing.txt index e5bbf0e7c5a3..b45267d98a5d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeFailing.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithBeforeFailing.txt @@ -11,6 +11,9 @@ Running Tests with Coverage callableName: beforeFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 121 callableName: beforeFailsFunction$lambda62$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 127 + + Test execution time :*****ms + [pass] testDividingValuesWithBeforeFailing#0 [pass] testDividingValuesWithBeforeFailing#1 [pass] testDividingValuesWithBeforeFailing#3 @@ -24,6 +27,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithFail.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithFail.txt index c42d59c21016..cf3fb86269d0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithFail.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testValidDataProviderWithFail.txt @@ -6,6 +6,15 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +intDataProviderTest:Case1 has failed. + + +intDataProviderTest:Case2 has failed. + + + Test execution time :*****ms + [pass] intDataProviderTest#Case3 [fail] intDataProviderTest#Case1: @@ -39,6 +48,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testWithSpecialKeys.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testWithSpecialKeys.txt index 703235c928c8..d5f8fefd43b0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testWithSpecialKeys.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DataProviderTest-testWithSpecialKeys.txt @@ -6,6 +6,9 @@ WARNING [tests/new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction2#Case#1 [pass] testFunction2#Case#2 [pass] testFunction2#Case#3 @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DisableTestsTestCase-testDisablingTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DisableTestsTestCase-testDisablingTests.txt index 00f88dc26288..5fcf5df6b14e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DisableTestsTestCase-testDisablingTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/DisableTestsTestCase-testDisablingTests.txt @@ -6,6 +6,9 @@ Compiling source Running Tests disable-test.bal + + Test execution time :*****ms + [pass] testDisableFunc2 [pass] testDisableFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/FunctionNameValidationTest-validateFunctionNamesTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/FunctionNameValidationTest-validateFunctionNamesTest.txt index 19d69c3fc610..837ef4d7aa80 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/FunctionNameValidationTest-validateFunctionNamesTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/FunctionNameValidationTest-validateFunctionNamesTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage validate_function_names + + Test execution time :*****ms + [pass] validateFunctionName diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-afterGroupsWithDisabledTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-afterGroupsWithDisabledTest.txt index 329c8df44d91..6c61704d237c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-afterGroupsWithDisabledTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-afterGroupsWithDisabledTest.txt @@ -6,6 +6,9 @@ Compiling source Running Tests after-groups-with-disabled-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups1.txt index 86daf222f532..8b9c3327459b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups1.txt @@ -6,6 +6,9 @@ Compiling source Running Tests before-groups-after-groups-test.bal + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups2.txt index 595bf7fa68d1..b2fed38010f5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-beforeGroupsAfterGroups2.txt @@ -6,6 +6,9 @@ Compiling source Running Tests before-groups-after-groups-test2.bal + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 [pass] testFunction3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeEachTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeEachTest.txt index ba84534c7372..8465c59ce0ab 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeEachTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeEachTest.txt @@ -14,6 +14,9 @@ Running Tests callableName: beforeEachFunction$lambda4$ fileName: failed-before-each-with-groups.bal lineNumber: 86 + Test execution time :*****ms + + 0 passing 0 failing diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeGroupTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeGroupTest.txt index 4377c66fa2c2..d42579a06c2a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeGroupTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-failedBeforeGroupTest.txt @@ -11,6 +11,9 @@ Running Tests callableName: beforeGroupsFunc1 fileName: failed-before-groups-test.bal lineNumber: 28 callableName: beforeGroupsFunc1$lambda1$ fileName: failed-before-groups-test.bal lineNumber: 96 + + Test execution time :*****ms + [pass] testFunction [pass] testFunction4 [pass] testFunction5 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExclusion.txt index ce698ac1b0b0..75ab1cf48466 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExclusion.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc6 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExecution.txt index b30a265a09cf..38c77b98e245 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testMultipleGroupExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupExclusion.txt index 50bb9e230903..af7bfbb7990e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupExclusion.txt @@ -6,6 +6,15 @@ Compiling source Running Tests groups-test.bal + +testFunc4: has failed. + + +testFunc5: has failed. + + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupInclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupInclusion.txt index 90f822f17937..f1de4bdf0378 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupInclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testNonExistingGroupInclusion.txt @@ -7,5 +7,8 @@ Running Tests groups-test.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExclusion.txt index 25a2ba8ebe30..50754fd18232 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExclusion.txt @@ -6,6 +6,12 @@ Compiling source Running Tests groups-test.bal + +testFunc5: has failed. + + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExecution.txt index b30a265a09cf..38c77b98e245 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testSingleGroupExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testWhenAfterGroupsFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testWhenAfterGroupsFails.txt index f323d88b33a3..db9d435851c0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testWhenAfterGroupsFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/GroupingTest-testWhenAfterGroupsFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: afterGroupsFunc1 fileName: failed-after-groups-test.bal lineNumber: 37 callableName: afterGroupsFunc1$lambda3$ fileName: failed-after-groups-test.bal lineNumber: 80 + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 [pass] testFunction3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ImportTest-testImportTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ImportTest-testImportTest.txt index 62933d7933f2..7e070263545a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ImportTest-testImportTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ImportTest-testImportTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage pre_declared_imports + + Test execution time :*****ms + [pass] testImportTest1 [pass] testImportTest2 [pass] testImportTest3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider.txt index 8714477b5792..c6d54b15e1de 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider.txt @@ -8,25 +8,34 @@ Running Tests invalid-data-provider-test.bal +testInvalidDataProvider:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidDataProvider#0: [fail data provider for the function testInvalidDataProvider] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int)' cannot be passed to function expecting parameter list '(string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int)' cannot be passed to function expecting parameter list '(string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test.bal lineNumber: 37 ",functionName="testInvalidDataProvider") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test.bal lineNumber: 37 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider2.txt index 4138232d0ce0..32d49ce76d56 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidDataProvider2.txt @@ -10,25 +10,34 @@ Running Tests invalid-data-provider-test2.bal +testInvalidDataProvider2:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidDataProvider2#0: [fail data provider for the function testInvalidDataProvider2] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int,int,int)' cannot be passed to function expecting parameter list '(string,string,string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int,int,int)' cannot be passed to function expecting parameter list '(string,string,string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test2.bal lineNumber: 39 ",functionName="testInvalidDataProvider2") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test2.bal lineNumber: 39 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt index 5811136fd5b6..8f798ca85e6f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt @@ -7,25 +7,34 @@ Running Tests invalid-data-provider-test3.bal +testInvalidTupleDataProvider:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidTupleDataProvider#0: [fail data provider for the function testInvalidTupleDataProvider] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(string,int)' cannot be passed to function expecting parameter list '(string,string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(string,int)' cannot be passed to function expecting parameter list '(string,string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test3.bal lineNumber: 36 ",functionName="testInvalidTupleDataProvider") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test3.bal lineNumber: 36 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt index 5d81c914e478..228f7b863ac2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt @@ -5,6 +5,12 @@ Running Tests incompatible_type_mock +functionMockingTest has failed. + + + Test execution time :*****ms + + [fail] functionMockingTest: error {ballerina/test:0}FunctionSignatureMismatchError ("Return type of function stringHello does not match function intAdd") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testCoverageWithMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testCoverageWithMocking.txt index 78cfc93406a5..1d8cf42fa8b7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testCoverageWithMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testCoverageWithMocking.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage mocking_coverage.mod2 + + Test execution time :*****ms + [pass] testFloatAdd [pass] testStringAdd @@ -13,6 +16,9 @@ Running Tests with Coverage 0 skipped mocking_coverage + + Test execution time :*****ms + [pass] testFloatAdd [pass] testStringAdd diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFuncMockInMultiModulesWDepen.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFuncMockInMultiModulesWDepen.txt index 63505dbaf9ed..74682d9f167f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFuncMockInMultiModulesWDepen.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFuncMockInMultiModulesWDepen.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage function_mocking_with_dependencies.a_dependency + + Test execution time :*****ms + [pass] test1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped function_mocking_with_dependencies.b_dependent + + Test execution time :*****ms + [pass] test1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMocking.txt index 8436cdfc4ce8..e6147ee1b24e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMocking.txt @@ -4,6 +4,18 @@ Compiling source Running Tests with Coverage function_mocking + +call_Test3 has failed. + + +call_Test4 has failed. + + +call_Test5 has failed. + + + Test execution time :*****ms + [pass] callOriginal_Test1 [pass] callOriginal_Test2 [pass] callOriginal_Test3 @@ -49,6 +61,9 @@ Running Tests with Coverage 0 skipped function_mocking.mock2 + + Test execution time :*****ms + [pass] test1 [pass] test2 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingLegacy.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingLegacy.txt index 0a844a841be6..89977a80c205 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingLegacy.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingLegacy.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage function_mocking_legacy + + Test execution time :*****ms + [pass] testIntAdd [pass] testIntMul diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingModuleLevel.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingModuleLevel.txt index 8436cdfc4ce8..e6147ee1b24e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingModuleLevel.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingModuleLevel.txt @@ -4,6 +4,18 @@ Compiling source Running Tests with Coverage function_mocking + +call_Test3 has failed. + + +call_Test4 has failed. + + +call_Test5 has failed. + + + Test execution time :*****ms + [pass] callOriginal_Test1 [pass] callOriginal_Test2 [pass] callOriginal_Test3 @@ -49,6 +61,9 @@ Running Tests with Coverage 0 skipped function_mocking.mock2 + + Test execution time :*****ms + [pass] test1 [pass] test2 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt index 599bdedcc3fa..d9d217f86d8e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt @@ -4,6 +4,12 @@ Compiling source Running Tests with Coverage function_mocking + +testFunctionMock3 has failed. + + + Test execution time :*****ms + [pass] testFunctionMock [pass] testFunctionMock2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMockDouble.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMockDouble.txt index a5f3db67f776..9ccb255ebca5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMockDouble.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMockDouble.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage object_mocking2 + + Test execution time :*****ms + [pass] testFn diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking.txt index 787b738aafb2..a12aa0625b95 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking.txt @@ -6,6 +6,30 @@ WARNING [main.bal:(47:5,47:47)] unused variable 'closeErr' Running Tests with Coverage object_mocking + +testDefaultIncompatibleArgs has failed. + + +testDefaultInvalidMemberReturnValue has failed. + + +testDefaultMockInvalidFieldName has failed. + + +testDefaultMockInvalidReturnValue has failed. + + +testDefaultMockWrongAction has failed. + + +testDefaultTooManyArgs has failed. + + +testMockInvalidStream has failed. + + + Test execution time :*****ms + [pass] testDependentlyTypedFunctions_testDouble [pass] testDependentlyTypedFunctions_thenReturn [pass] testMockMemberVariable diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases1.txt index e4c6ce21289d..a52a84bec84d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases1.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultIncompatibleArgs has failed. + + + Test execution time :*****ms + + [fail] testDefaultIncompatibleArgs: error {ballerina/test:0}FunctionSignatureMismatchError ("incorrect type of argument provided at position '1' to mock the function 'get()'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases2.txt index 323abc18672a..353b191dbd44 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases2.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultInvalidMemberReturnValue has failed. + + + Test execution time :*****ms + + [fail] testDefaultInvalidMemberReturnValue: error {ballerina/test:0}InvalidMemberFieldError ("return value provided does not match the type of 'url'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases3.txt index 821187636c39..bebd37d27c0c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases3.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockInvalidFieldName has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockInvalidFieldName: error {ballerina/test:0}InvalidMemberFieldError ("invalid field name 'invalidField' provided") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases4.txt index b5a34bd5c9d0..5e9f49f614c5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases4.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockInvalidReturnValue has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockInvalidReturnValue: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases5.txt index 4704c603fd6a..233770726cdd 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases5.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockWrongAction has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockWrongAction: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases6.txt index f6d8c7c87e78..ca891932d4ea 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases6.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultTooManyArgs has failed. + + + Test execution time :*****ms + + [fail] testDefaultTooManyArgs: error {ballerina/test:0}FunctionSignatureMismatchError ("too many argument provided to mock the function 'get()'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases7.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases7.txt index 1d81d1daa5bd..8020f4903cfe 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases7.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NegativeCases7.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testMockInvalidStream has failed. + + + Test execution time :*****ms + + [fail] testMockInvalidStream: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get_stream()'") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NonPublicField.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NonPublicField.txt index 3e7372f1e3b3..c5d6cf910e70 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NonPublicField.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/MockTest-testObjectMocking_NonPublicField.txt @@ -5,6 +5,12 @@ Running Tests with Coverage non_public_field_mock +testNonPublicMemberFieldMock has failed. + + + Test execution time :*****ms + + [fail] testNonPublicMemberFieldMock: error("NonPublicMemberFieldError",message="member field should be public to be mocked. The provided field 'url' is not public") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionFlowTest-test-listener-shutdown.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionFlowTest-test-listener-shutdown.txt index 43796ff5625e..f1476a2823e8 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionFlowTest-test-listener-shutdown.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionFlowTest-test-listener-shutdown.txt @@ -8,6 +8,9 @@ Calling init for 'moduleA listener' Calling init for 'current module listener' Calling start for 'moduleA listener' Calling start for 'current module listener' + + Test execution time :*****ms + [pass] main_test1 @@ -20,10 +23,13 @@ Calling stop for 'moduleA listener' moduleExecutionFlow.moduleA Calling init for 'moduleA listener' Calling start for 'moduleA listener' + + Test execution time :*****ms + [pass] test1 1 passing 0 failing 0 skipped -Calling stop for 'moduleA listener' +Calling stop for 'moduleA listener' \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_AllTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_AllTests.txt index fcfe501471ca..d3f5a3311430 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_AllTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_AllTests.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] commonTest [pass] main_test1 [pass] main_test2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt index 38d038876ae6..07753dc5ef30 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 [pass] main_test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt index 38d038876ae6..07753dc5ef30 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 [pass] main_test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_SingleTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_SingleTest.txt index 19e73d7656db..33a43bcc96ec 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_SingleTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_SingleTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt index 795c661a824c..f40b38f1fdc3 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] commonTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_AllTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_AllTests.txt index a75060a81c51..6b082fed9fb0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_AllTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_AllTests.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] commonTest_Module1 [pass] module1_test1 [pass] module1_test2 @@ -15,6 +18,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_SingleTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_SingleTest.txt index a817aaf192df..a10ba65191e7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_SingleTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_SingleTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test1 @@ -13,6 +16,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WildCardTest.txt index 1fb3cc592951..4f0f06a6fbfa 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WildCardTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test1 [pass] module1_test2 @@ -14,6 +17,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WithGroups.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WithGroups.txt index ccc33806b6cf..ef0706fcff75 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WithGroups.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_Module1_WithGroups.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test2 @@ -13,6 +16,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_WildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_WildCardTest.txt index 9922e268ca95..e22fb6c1e8d2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_WildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionTest-test_WildCardTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] commonTest_Module1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped moduleExecution + + Test execution time :*****ms + [pass] commonTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionWithInitStartFailures.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionWithInitStartFailures.txt index b135d95d38d8..56878002b26e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionWithInitStartFailures.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleExecutionWithInitStartFailures.txt @@ -16,6 +16,12 @@ error: Error from start of moduleC at wso2.moduleExecutionInitStartFailure.moduleC.0.Listener:start(main.bal:32) moduleExecutionInitStartFailure.moduleB + +test2: has failed. + + + Test execution time :*****ms + [pass] test1 [pass] test3 @@ -35,4 +41,4 @@ error: Error from start of moduleC 2 passing 1 failing 0 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleGracefulStopTest-test-listener-shutdown.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleGracefulStopTest-test-listener-shutdown.txt index 5b2bf742b2b1..4f39103c28cc 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleGracefulStopTest-test-listener-shutdown.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/ModuleGracefulStopTest-test-listener-shutdown.txt @@ -8,6 +8,15 @@ Calling init for moduleA listener Calling init for default module listener Calling start for moduleA listener Calling start for default module listener + +main_negative_test1: has failed. + + +main_negative_test2: has failed. + + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 @@ -45,6 +54,12 @@ Calling stop for moduleA listener moduleGracefulStopTest.moduleA Calling init for moduleA listener Calling start for moduleA listener + +negative_test1: has failed. + + + Test execution time :*****ms + [pass] test1 [fail] negative_test1: @@ -64,4 +79,4 @@ Calling start for moduleA listener 1 failing 0 skipped Calling stop for moduleA listener -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/PathVerificationTest-verifyTestsOutsidePath.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/PathVerificationTest-verifyTestsOutsidePath.txt index b7c7e573e776..a63626ad9de2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/PathVerificationTest-verifyTestsOutsidePath.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/PathVerificationTest-verifyTestsOutsidePath.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage path_verification + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testFullTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testFullTest.txt index a514eab452e2..d59b33f56051 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testFullTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testFullTest.txt @@ -4,6 +4,15 @@ Compiling source Running Tests with Coverage rerun_failed + +testFunctionFail1: has failed. + + +testFunctionFail2: has failed. + + + Test execution time :*****ms + [pass] testFunctionPass1 [pass] testFunctionPass2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testRerunFailedTest.txt index 8d4d43394ee5..1d0030444837 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/RerunFailedTest-testRerunFailedTest.txt @@ -5,6 +5,15 @@ Running Tests with Coverage rerun_failed +testFunctionFail1: has failed. + + +testFunctionFail2: has failed. + + + Test execution time :*****ms + + [fail] testFunctionFail1: error {ballerina/test:0}TestError ("Failed!") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDependentFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDependentFunctionExecution.txt index 747430d2d09d..603ae8d110a1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDependentFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDependentFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDisabledFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDisabledFunctionExecution.txt index 004643d4ee8e..0ddb09b90383 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDisabledFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testDisabledFunctionExecution.txt @@ -7,5 +7,8 @@ Running Tests single-test-execution.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testMultipleFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testMultipleFunctionExecution.txt index 747430d2d09d..603ae8d110a1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testMultipleFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testMultipleFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testNonExistingFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testNonExistingFunctionExecution.txt index 004643d4ee8e..0ddb09b90383 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testNonExistingFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testNonExistingFunctionExecution.txt @@ -7,5 +7,8 @@ Running Tests single-test-execution.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testSingleFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testSingleFunctionExecution.txt index 6326a4e521ce..e958ae022ad2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testSingleFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SelectedFunctionTest-testSingleFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SingleFileTestExecutionWithInitFailure.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SingleFileTestExecutionWithInitFailure.txt index f7fda808fadd..bb342b37f8ea 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SingleFileTestExecutionWithInitFailure.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SingleFileTestExecutionWithInitFailure.txt @@ -7,4 +7,4 @@ Running Tests bal-test-with-init-failure.bal error: {ballerina}DivisionByZero {"message":" / by zero"} -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterEachFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterEachFails.txt index 94115461c466..aca909e90334 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterEachFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterEachFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: afterEach fileName: skip-when-afterEach-fails.bal lineNumber: 30 callableName: afterEach$lambda2$ fileName: skip-when-afterEach-fails.bal lineNumber: 55 + + Test execution time :*****ms + [pass] test1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterFails.txt index 1c9c2a90942b..cb173cadb38d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenAfterFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: afterFunc fileName: skip-when-after-fails.bal lineNumber: 30 callableName: afterFunc$lambda6$ fileName: skip-when-after-fails.bal lineNumber: 35 + + Test execution time :*****ms + [fail] afterSuite[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuite fileName: skip-when-after-fails.bal lineNumber: 57 - callableName: afterSuite$lambda5$ fileName: skip-when-after-fails.bal lineNumber: 65 + callableName: afterSuite$lambda2$ fileName: skip-when-after-fails.bal lineNumber: 62 [pass] test1 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt index a3c0b7a9011e..7dd06cde5e81 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt @@ -13,6 +13,9 @@ Running Tests callableName: beforeEach$lambda1$ fileName: skip-when-beforeEach-fails.bal lineNumber: 54 + Test execution time :*****ms + + 0 passing 0 failing diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeFails.txt index 8aea3e1b03e5..1f36fc38fc65 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: before fileName: skip-when-before-fails.bal lineNumber: 28 callableName: before$lambda6$ fileName: skip-when-before-fails.bal lineNumber: 32 + + Test execution time :*****ms + [fail] afterSuite[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuite fileName: skip-when-before-fails.bal lineNumber: 54 - callableName: afterSuite$lambda5$ fileName: skip-when-before-fails.bal lineNumber: 62 + callableName: afterSuite$lambda2$ fileName: skip-when-before-fails.bal lineNumber: 59 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt index 4f57f009333a..b84349129fad 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: beforeGroupsFunc2 fileName: skip-when-beforeGroups-fails.bal lineNumber: 32 callableName: beforeGroupsFunc2$lambda2$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 86 + + Test execution time :*****ms + [fail] afterSuiteFunc[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuiteFunc fileName: skip-when-beforeGroups-fails.bal lineNumber: 81 - callableName: afterSuiteFunc$lambda9$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 93 + callableName: afterSuiteFunc$lambda4$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 88 [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt index a967c9d4fe78..81cc1e5b714f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt @@ -13,6 +13,9 @@ Running Tests callableName: beforeSuite$lambda1$ fileName: skip-when-beforeSuite-fails.bal lineNumber: 76 + Test execution time :*****ms + + 0 passing 0 failing diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt index 2c448f472c1c..21009a89fed6 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt @@ -7,6 +7,12 @@ WARNING [dependson-skip-test.bal:(34:5,34:18)] unused variable 'i' Running Tests dependson-skip-test.bal + +test2 has failed. + + + Test execution time :*****ms + [pass] test1 [pass] test5 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt index ebefe7d4fb43..80f265611ccb 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage defaultModuleSource.module1 + + Test execution time :*****ms + [pass] test3 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped defaultModuleSource.module2 + + Test execution time :*****ms + [pass] test4 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt index d02639b8137f..55748121857d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage sourcelessModulesTest.module1 + + Test execution time :*****ms + [pass] test1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped sourcelessModulesTest.module2 + + Test execution time :*****ms + [pass] test2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt index 00ceb60d3e50..e888c893e652 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage sourcelessProjectTest + + Test execution time :*****ms + [pass] test7 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped sourcelessProjectTest.module1 + + Test execution time :*****ms + [pass] test5 @@ -20,6 +26,9 @@ Running Tests with Coverage 0 skipped sourcelessProjectTest.module2 + + Test execution time :*****ms + [pass] test6 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestExecutionWithInitFailures.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestExecutionWithInitFailures.txt index d17dbb2fdf17..2b2e90a311bd 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestExecutionWithInitFailures.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestExecutionWithInitFailures.txt @@ -4,6 +4,9 @@ Compiling source Running Tests testExecutionWithModuleInitFailure.moduleD + + Test execution time :*****ms + [pass] testFunc @@ -18,6 +21,9 @@ error: {ballerina}DivisionByZero {"message":" / by zero"} error: {ballerina}DivisionByZero {"message":" / by zero"} testExecutionWithModuleInitFailure.moduleC + + Test execution time :*****ms + [pass] testFunc @@ -27,4 +33,4 @@ error: {ballerina}DivisionByZero {"message":" / by zero"} testExecutionWithModuleInitFailure.moduleB error: {ballerina}DivisionByZero {"message":" / by zero"} -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForCoverageFormatFlag.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForCoverageFormatFlag.txt index 5944a5c9081b..2e5eeb8b2de5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForCoverageFormatFlag.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForCoverageFormatFlag.txt @@ -6,6 +6,12 @@ WARNING [main.bal:(36:5,36:19)] unused variable 'b' Running Tests foo + +testMain: has failed. + + + Test execution time :*****ms + [pass] testFunc [fail] testMain: @@ -23,6 +29,9 @@ Running Tests 1 skipped foo.bar.tests + + Test execution time :*****ms + [pass] testBarAdd @@ -31,6 +40,9 @@ Running Tests 0 skipped foo.math + + Test execution time :*****ms + [pass] testFunction1 [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForReportTools.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForReportTools.txt index 16cc12768862..4db780f73348 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForReportTools.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/unix/TestReportTest-testWarningForReportTools.txt @@ -5,6 +5,12 @@ WARNING [main.bal:(36:5,36:19)] unused variable 'b' Running Tests with Coverage foo + +testMain: has failed. + + + Test execution time :*****ms + [pass] testFunc [fail] testMain: @@ -22,6 +28,9 @@ Running Tests with Coverage 1 skipped foo.bar.tests + + Test execution time :*****ms + [pass] testBarAdd @@ -30,6 +39,9 @@ Running Tests with Coverage 0 skipped foo.math + + Test execution time :*****ms + [pass] testFunction1 [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnnotations.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnnotations.txt index 12be891a773c..65052b8028ec 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnnotations.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnnotations.txt @@ -1,29 +1,32 @@ -Compiling source - intg_tests/annotations:0.0.0 - -Running Tests with Coverage - - annotations - [pass] jsonDataProviderTest#0 - [pass] stringDataProviderTest#0 - [pass] stringDataProviderTest#1 - [pass] stringDataProviderTest#2 - [pass] stringDataProviderTest2#0 - [pass] test1 - [pass] testAfter - [pass] test2 - [pass] testAfterAlone - [pass] test3 - [pass] test4 - [pass] test5 - [pass] testDependsOn1 - [pass] testBefore - - - 14 passing - 0 failing - 0 skipped - -Generating Test Report - annotations\target\report\test_results.json - \ No newline at end of file +Compiling source + intg_tests/annotations:0.0.0 + +Running Tests with Coverage + + annotations + + Test execution time :*****ms + + [pass] jsonDataProviderTest#0 + [pass] stringDataProviderTest#0 + [pass] stringDataProviderTest#1 + [pass] stringDataProviderTest#2 + [pass] stringDataProviderTest2#0 + [pass] test1 + [pass] testAfter + [pass] test2 + [pass] testAfterAlone + [pass] test3 + [pass] test4 + [pass] test5 + [pass] testDependsOn1 + [pass] testBefore + + + 14 passing + 0 failing + 0 skipped + +Generating Test Report + annotations\target\report\test_results.json + diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnydataType.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnydataType.txt index d5e070afa935..2cdceed3a130 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnydataType.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnydataType.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage anydata_type + + Test execution time :*****ms + [pass] testFn [pass] testFoo diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertBehavioralTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertBehavioralTypes.txt index b4f338ece393..94b26bc33ac2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertBehavioralTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertBehavioralTypes.txt @@ -7,6 +7,9 @@ WARNING [tests\assert-test-behavioral-types.bal:(24:5,24:32)] undocumented field Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertObjectArrayEquals [pass] testAssertObjectArrayEqualsNegative [pass] testAssertObjectArrayNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertDiffError.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertDiffError.txt index f12629270eea..fcdb605c5a5f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertDiffError.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertDiffError.txt @@ -7,6 +7,9 @@ WARNING [tests\assertions-diff-error-messages.bal:(24:5,24:32)] undocumented fie Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertDecimalValues [pass] testAssertIntValues [pass] testAssertJsonArray diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertSequenceTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertSequenceTypes.txt index 520d039ce333..e6de54be39cf 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertSequenceTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertSequenceTypes.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertStringEquals [pass] testAssertStringEqualsNegative [pass] testAssertStringNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertStructuralTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertStructuralTypes.txt index c9a78dddde64..126797d7cdff 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertStructuralTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertStructuralTypes.txt @@ -7,6 +7,9 @@ WARNING [tests\assert-test-structural-types.bal:(24:5,24:18)] undocumented field Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertByteArrayEquals [pass] testAssertByteArrayEqualsNegative [pass] testAssertByteArrayNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertionErrorMessage.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertionErrorMessage.txt index 022809ee2858..30c837278d7b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertionErrorMessage.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertionErrorMessage.txt @@ -7,6 +7,9 @@ WARNING [tests\assertions-error-messages.bal:(24:5,24:32)] undocumented field 'p Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertAnnonymousRecords [pass] testAssertDecimalAndFloat [pass] testAssertDifferentObjects diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertions.txt index a7fd833158c5..e35de1b9c400 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAssertions.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage assertions + + Test execution time :*****ms + [pass] testAssertBooleanEquals [pass] testAssertBooleanEqualsNegative [pass] testAssertBooleanNotEquals diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAsyncInvocation.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAsyncInvocation.txt index 600acd0b5097..3b8b30a804d4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAsyncInvocation.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAsyncInvocation.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage async + + Test execution time :*****ms + [pass] testAsyncRemoteFunctionMain [pass] testAsyncRemoteFunctionTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeAfter.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeAfter.txt index d3b9aeb92727..4b7a8ccf30d7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeAfter.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeAfter.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage before_after + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeEachAfterEach.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeEachAfterEach.txt index 6b9060d0040b..af0ac193b699 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeEachAfterEach.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testBeforeEachAfterEach.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage before_each_after_each + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testDependsOn.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testDependsOn.txt index 0be84f1e6a28..8c8d6838de4b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testDependsOn.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testDependsOn.txt @@ -1,27 +1,30 @@ -Compiling source - intg_tests/depends_on:0.0.0 - -Running Tests with Coverage - - depends_on - [pass] test1 - [pass] test2 - [pass] test3 - [pass] test4 - [pass] testWithBefore1 - [pass] testWithBefore2 - [pass] testWithBefore3 - [pass] testWithBefore4 - [pass] testAddingValues#0 - [pass] testAddingValues#1 - [pass] testAddingValues#2 - [pass] testAddingValuesDependant - - - 12 passing - 0 failing - 0 skipped - -Generating Test Report - depends-on\target\report\test_results.json - \ No newline at end of file +Compiling source + intg_tests/depends_on:0.0.0 + +Running Tests with Coverage + + depends_on + + Test execution time :*****ms + + [pass] test1 + [pass] test2 + [pass] test3 + [pass] test4 + [pass] testWithBefore1 + [pass] testWithBefore2 + [pass] testWithBefore3 + [pass] testWithBefore4 + [pass] testAddingValues#0 + [pass] testAddingValues#1 + [pass] testAddingValues#2 + [pass] testAddingValuesDependant + + + 12 passing + 0 failing + 0 skipped + +Generating Test Report + depends-on\target\report\test_results.json + diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIntersectionTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIntersectionTypes.txt index 524f8be388dc..3e8427acf943 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIntersectionTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIntersectionTypes.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage intersection_type + + Test execution time :*****ms + [pass] testIntersectionTypes diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIsolatedFunctions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIsolatedFunctions.txt index 57e855e9ae18..575ddaf13b7b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIsolatedFunctions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testIsolatedFunctions.txt @@ -1,18 +1,21 @@ -Compiling source - intg_tests/isolated_functions:0.0.0 - -Running Tests with Coverage - - isolated_functions - [pass] testCallingIsolatedFunction - [pass] testFunc - [pass] testIsolatedTestFunction - - - 3 passing - 0 failing - 0 skipped - -Generating Test Report - isolated-functions\target\report\test_results.json - \ No newline at end of file +Compiling source + intg_tests/isolated_functions:0.0.0 + +Running Tests with Coverage + + isolated_functions + + Test execution time :*****ms + + [pass] testCallingIsolatedFunction + [pass] testFunc + [pass] testIsolatedTestFunction + + + 3 passing + 0 failing + 0 skipped + +Generating Test Report + isolated-functions\target\report\test_results.json + diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testJavaInterops.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testJavaInterops.txt index cebb482b0dc0..cd7f269e0818 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testJavaInterops.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testJavaInterops.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage interops + + Test execution time :*****ms + [pass] testInteropWithRestArgs diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testRuntimeApi.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testRuntimeApi.txt index 68b8e99d2390..fe8c72deaf13 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testRuntimeApi.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/BasicCasesTest-testRuntimeApi.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage runtime_api + + Test execution time :*****ms + [pass] testRuntimeApi diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataProviderWithFail.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataProviderWithFail.txt index 16461d2791ea..c513557e1170 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataProviderWithFail.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataProviderWithFail.txt @@ -6,6 +6,15 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +intArrayDataProviderTest:0 has failed. + + +intArrayDataProviderTest:1 has failed. + + + Test execution time :*****ms + [pass] intArrayDataProviderTest#2 [fail] intArrayDataProviderTest#0: @@ -39,6 +48,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataRerunFailedTest.txt index d31596a9fbb4..775cf11480b3 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testArrayDataRerunFailedTest.txt @@ -7,6 +7,15 @@ Running Tests with Coverage dataproviders +intArrayDataProviderTest:0 has failed. + + +intArrayDataProviderTest:1 has failed. + + + Test execution time :*****ms + + [fail] intArrayDataProviderTest#0: error {ballerina/test:0}TestError ("The sum is not correct @@ -38,6 +47,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys0.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys0.txt index 5ab924174ab8..6f8651238e31 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys0.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys0.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#`'"\a"" @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys1.txt index 1f889fe58687..60e0d69cfaba 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys1.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#"\u{D7FF}"" " @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys2.txt index 0584dab6f042..54a5cd7903e8 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys2.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a + b @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys3.txt index 0d98ffbf5f98..ffb5a94c4084 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys3.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(x * 1) != (y / 3) || (a ^ b) == (b & c) >> (1 % 2) @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys4.txt index c50f70edad0a..6d463567502d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys4.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys5.txt index a7684ebe2093..0a3332f49d67 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys5.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a:x(c,d)[]; ^(x|y).ok(); @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys6.txt index cc1a37a1ad1e..120b17a81a66 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeys6.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#map v = { "x": 1 }; @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt index 5ab924174ab8..6f8651238e31 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard0.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#`'"\a"" @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt index 1f889fe58687..60e0d69cfaba 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard1.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#"\u{D7FF}"" " @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt index 0584dab6f042..54a5cd7903e8 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard2.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a + b @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt index 0d98ffbf5f98..ffb5a94c4084 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard3.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(x * 1) != (y / 3) || (a ^ b) == (b & c) >> (1 % 2) @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt index c50f70edad0a..6d463567502d 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard4.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#(1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt index a7684ebe2093..0a3332f49d67 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard5.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#a:x(c,d)[]; ^(x|y).ok(); @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt index cc1a37a1ad1e..120b17a81a66 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testCodeFragmentKeysWithWildCard6.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction3#map v = { "x": 1 }; @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderSingleFailure.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderSingleFailure.txt index 08db5f4bd30c..950cecbca3f0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderSingleFailure.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderSingleFailure.txt @@ -6,6 +6,12 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +testDividingValuesNegative:2 has failed. + + + Test execution time :*****ms + [pass] testDividingValuesNegative#0 [pass] testDividingValuesNegative#1 [pass] testDividingValuesNegative#3 @@ -15,16 +21,18 @@ Running Tests with Coverage [fail] testDividingValuesNegative#2: [fail data provider for the function testDividingValuesNegative] - error {ballerina/test:0}ExecutionError ("error("{ballerina}DivisionByZero",message=" / by zero") + error {ballerina/test:0}ExecutionError ("error("{ballerina}DivisionByZero",message=" / by zero") callableName: testDividingValuesNegative moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 191 callableName: testDividingValuesNegative$lambda14$ moduleName: intg_tests.dataproviders$test.0.tests.test_execute-generated_*****lineNumber: 18 ",functionName="testDividingValuesNegative") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ moduleName: intg_tests.dataproviders$test.0.tests.test_execute-generated_*****lineNumber: 27 @@ -35,6 +43,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderWithMixedType.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderWithMixedType.txt index 4cba42d8ebd5..11170c2436ff 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderWithMixedType.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testDataProviderWithMixedType.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction1#CaseNew1 [pass] testFunction1#CaseNew2 @@ -16,6 +19,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMapValueDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMapValueDataProvider.txt index 564fa542b9c5..509b141ac651 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMapValueDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMapValueDataProvider.txt @@ -6,6 +6,12 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +testGetState:1 has failed. + + + Test execution time :*****ms + [pass] testGetState#0 [fail] testGetState#1: @@ -27,6 +33,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMultiModuleSingleTestExec.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMultiModuleSingleTestExec.txt index d124d5f2ae43..8956b08c2f63 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMultiModuleSingleTestExec.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testMultiModuleSingleTestExec.txt @@ -7,10 +7,16 @@ Running Tests with Coverage dataproviders + Test execution time :*****ms + + No tests found dataproviders.module1 + + Test execution time :*****ms + [pass] stringDataProviderMod1Test#1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testRerunFailedTest.txt index 455904309750..09441fb7c431 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testRerunFailedTest.txt @@ -7,6 +7,15 @@ Running Tests with Coverage dataproviders +intDataProviderTest:Case1 has failed. + + +intDataProviderTest:Case2 has failed. + + + Test execution time :*****ms + + [fail] intDataProviderTest#Case1: error {ballerina/test:0}TestError ("The sum is not correct @@ -38,6 +47,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProvider.txt index 050d1546f95d..d5fe21c129c6 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProvider.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] jsonDataProviderTest#json1 [pass] jsonDataProviderTest#json2 @@ -16,6 +19,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderCase.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderCase.txt index 41cf260ec3db..24a5a066f383 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderCase.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderCase.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] jsonDataProviderTest#json1 @@ -15,6 +18,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithAfterFailing.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithAfterFailing.txt index fe59becf0e30..cedf1f5fc98c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithAfterFailing.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithAfterFailing.txt @@ -1,34 +1,40 @@ -Compiling source - intg_tests/dataproviders:0.0.0 -WARNING [tests\new-data-provider-tests.bal:(121:9,121:21)] unused variable 'a' -WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' - -Running Tests with Coverage - - dataproviders - [fail] [after test function for the test]: - error("{ballerina}DivisionByZero",message=" / by zero") - callableName: afterFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 153 - callableName: afterFailsFunction$lambda72$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 160 - - [pass] testDividingValuesWithAfterFailing#0 - [pass] testDividingValuesWithAfterFailing#1 - [pass] testDividingValuesWithAfterFailing#2 - [pass] testDividingValuesWithAfterFailing#3 - [pass] testDividingValuesWithAfterFailing#4 - [pass] testExecutionOfAfterFailing - - - 6 passing - 0 failing - 0 skipped - - dataproviders.module1 - - - No tests found - -Generating Test Report - data-providers\target\report\test_results.json - -error: there are test failures +Compiling source + intg_tests/dataproviders:0.0.0 +WARNING [tests\new-data-provider-tests.bal:(121:9,121:21)] unused variable 'a' +WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' + +Running Tests with Coverage + + dataproviders + [fail] [after test function for the test]: + error("{ballerina}DivisionByZero",message=" / by zero") + callableName: afterFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 153 + callableName: afterFailsFunction$lambda72$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 160 + + + Test execution time :*****ms + + [pass] testDividingValuesWithAfterFailing#0 + [pass] testDividingValuesWithAfterFailing#1 + [pass] testDividingValuesWithAfterFailing#2 + [pass] testDividingValuesWithAfterFailing#3 + [pass] testDividingValuesWithAfterFailing#4 + [pass] testExecutionOfAfterFailing + + + 6 passing + 0 failing + 0 skipped + + dataproviders.module1 + + Test execution time :*****ms + + + + No tests found + +Generating Test Report + data-providers\target\report\test_results.json + +error: there are test failures diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt index 98511368828a..90ed5e32ab0a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeAfterFunctions.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testDividingValues#0 [pass] testDividingValues#1 [pass] testDividingValues#2 @@ -20,6 +23,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeFailing.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeFailing.txt index 4a194c293db7..cbf847fa465c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeFailing.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithBeforeFailing.txt @@ -1,33 +1,39 @@ -Compiling source - intg_tests/dataproviders:0.0.0 -WARNING [tests\new-data-provider-tests.bal:(121:9,121:21)] unused variable 'a' -WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' - -Running Tests with Coverage - - dataproviders - [fail] [before test function for the test]: - error("{ballerina}DivisionByZero",message=" / by zero") - callableName: beforeFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 121 - callableName: beforeFailsFunction$lambda62$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 127 - - [pass] testDividingValuesWithBeforeFailing#0 - [pass] testDividingValuesWithBeforeFailing#1 - [pass] testDividingValuesWithBeforeFailing#3 - [pass] testDividingValuesWithBeforeFailing#4 - [pass] testExecutionOfBeforeFailing - - - 5 passing - 0 failing - 1 skipped - - dataproviders.module1 - - - No tests found - -Generating Test Report - data-providers\target\report\test_results.json - -error: there are test failures +Compiling source + intg_tests/dataproviders:0.0.0 +WARNING [tests\new-data-provider-tests.bal:(121:9,121:21)] unused variable 'a' +WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' + +Running Tests with Coverage + + dataproviders + [fail] [before test function for the test]: + error("{ballerina}DivisionByZero",message=" / by zero") + callableName: beforeFailsFunction moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 121 + callableName: beforeFailsFunction$lambda62$ moduleName: intg_tests.dataproviders$test.0.tests.new-data-provider-tests fileName: tests/new-data-provider-tests.bal lineNumber: 127 + + + Test execution time :*****ms + + [pass] testDividingValuesWithBeforeFailing#0 + [pass] testDividingValuesWithBeforeFailing#1 + [pass] testDividingValuesWithBeforeFailing#3 + [pass] testDividingValuesWithBeforeFailing#4 + [pass] testExecutionOfBeforeFailing + + + 5 passing + 0 failing + 1 skipped + + dataproviders.module1 + + Test execution time :*****ms + + + + No tests found + +Generating Test Report + data-providers\target\report\test_results.json + +error: there are test failures diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithFail.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithFail.txt index 0192f7c0a59a..1b157e8c41d4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithFail.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testValidDataProviderWithFail.txt @@ -6,6 +6,15 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + +intDataProviderTest:Case1 has failed. + + +intDataProviderTest:Case2 has failed. + + + Test execution time :*****ms + [pass] intDataProviderTest#Case3 [fail] intDataProviderTest#Case1: @@ -39,6 +48,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testWithSpecialKeys.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testWithSpecialKeys.txt index f641bd0e5eb3..02b6b8de7b95 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testWithSpecialKeys.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DataProviderTest-testWithSpecialKeys.txt @@ -6,6 +6,9 @@ WARNING [tests\new-data-provider-tests.bal:(153:9,153:21)] unused variable 'a' Running Tests with Coverage dataproviders + + Test execution time :*****ms + [pass] testFunction2#Case#1 [pass] testFunction2#Case#2 [pass] testFunction2#Case#3 @@ -17,6 +20,9 @@ Running Tests with Coverage dataproviders.module1 + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DisableTestsTestCase-testDisablingTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DisableTestsTestCase-testDisablingTests.txt index b73bbf74eb52..6a667ec2b2f4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DisableTestsTestCase-testDisablingTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/DisableTestsTestCase-testDisablingTests.txt @@ -6,6 +6,9 @@ Compiling source Running Tests disable-test.bal + + Test execution time :*****ms + [pass] testDisableFunc2 [pass] testDisableFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/FunctionNameValidationTest-validateFunctionNamesTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/FunctionNameValidationTest-validateFunctionNamesTest.txt index 20625dcbe7fe..f9868e402aad 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/FunctionNameValidationTest-validateFunctionNamesTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/FunctionNameValidationTest-validateFunctionNamesTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage validate_function_names + + Test execution time :*****ms + [pass] validateFunctionName diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-afterGroupsWithDisabledTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-afterGroupsWithDisabledTest.txt index ec00ccd0b89f..e0beb648ad75 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-afterGroupsWithDisabledTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-afterGroupsWithDisabledTest.txt @@ -6,6 +6,9 @@ Compiling source Running Tests after-groups-with-disabled-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups1.txt index fc7173295607..f799c87a3808 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups1.txt @@ -6,6 +6,9 @@ Compiling source Running Tests before-groups-after-groups-test.bal + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups2.txt index 913965967b11..bb5abf79a67f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-beforeGroupsAfterGroups2.txt @@ -1,18 +1,21 @@ -Code coverage is not yet supported with single bal files. Ignoring the flag and continuing the test run... -warning: ignoring --includes flag since code coverage is not enabled -Compiling source - before-groups-after-groups-test2.bal - -Running Tests - - before-groups-after-groups-test2.bal - [pass] testFunction - [pass] testFunction2 - [pass] testFunction3 - [pass] testFunction4 - [pass] testFunction5 - - - 5 passing - 0 failing - 0 skipped \ No newline at end of file +Code coverage is not yet supported with single bal files. Ignoring the flag and continuing the test run... +warning: ignoring --includes flag since code coverage is not enabled +Compiling source + before-groups-after-groups-test2.bal + +Running Tests + + before-groups-after-groups-test2.bal + + Test execution time :*****ms + + [pass] testFunction + [pass] testFunction2 + [pass] testFunction3 + [pass] testFunction4 + [pass] testFunction5 + + + 5 passing + 0 failing + 0 skipped diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeEachTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeEachTest.txt index 054f91026a8e..d0d2e9f86cbf 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeEachTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeEachTest.txt @@ -14,8 +14,11 @@ Running Tests callableName: beforeEachFunction$lambda4$ fileName: failed-before-each-with-groups.bal lineNumber: 86 + Test execution time :*****ms + + 0 passing 0 failing 4 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeGroupTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeGroupTest.txt index 1481f0b2d20b..99a38226f9af 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeGroupTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-failedBeforeGroupTest.txt @@ -11,6 +11,9 @@ Running Tests callableName: beforeGroupsFunc1 fileName: failed-before-groups-test.bal lineNumber: 28 callableName: beforeGroupsFunc1$lambda1$ fileName: failed-before-groups-test.bal lineNumber: 96 + + Test execution time :*****ms + [pass] testFunction [pass] testFunction4 [pass] testFunction5 @@ -19,4 +22,4 @@ Running Tests 3 passing 0 failing 2 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExclusion.txt index 8d2b8ce6757b..f5a8b44bc6d2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExclusion.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc6 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExecution.txt index f1099c274d84..064851e29288 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testMultipleGroupExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupExclusion.txt index 524480cc7aca..60b94a6f6ce0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupExclusion.txt @@ -6,6 +6,15 @@ Compiling source Running Tests groups-test.bal + +testFunc4: has failed. + + +testFunc5: has failed. + + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupInclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupInclusion.txt index 0802625a37c3..4dbe35dc12d1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupInclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testNonExistingGroupInclusion.txt @@ -7,5 +7,8 @@ Running Tests groups-test.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExclusion.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExclusion.txt index b4eec9298ec6..d8fe3d6c8d41 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExclusion.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExclusion.txt @@ -6,6 +6,12 @@ Compiling source Running Tests groups-test.bal + +testFunc5: has failed. + + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExecution.txt index f1099c274d84..064851e29288 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testSingleGroupExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests groups-test.bal + + Test execution time :*****ms + [pass] testFunc1 [pass] testFunc2 [pass] testFunc3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testWhenAfterGroupsFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testWhenAfterGroupsFails.txt index fd2d05c204dc..e2c83a31876e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testWhenAfterGroupsFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/GroupingTest-testWhenAfterGroupsFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: afterGroupsFunc1 fileName: failed-after-groups-test.bal lineNumber: 37 callableName: afterGroupsFunc1$lambda3$ fileName: failed-after-groups-test.bal lineNumber: 80 + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 [pass] testFunction3 @@ -22,4 +25,4 @@ Running Tests 5 passing 0 failing 0 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ImportTest-testImportTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ImportTest-testImportTest.txt index 3f7a245a8f99..0dc17d06f5f0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ImportTest-testImportTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ImportTest-testImportTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage pre_declared_imports + + Test execution time :*****ms + [pass] testImportTest1 [pass] testImportTest2 [pass] testImportTest3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider.txt index b843eb1c0939..73bac8d8aaa4 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider.txt @@ -8,25 +8,34 @@ Running Tests invalid-data-provider-test.bal +testInvalidDataProvider:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidDataProvider#0: [fail data provider for the function testInvalidDataProvider] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int)' cannot be passed to function expecting parameter list '(string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int)' cannot be passed to function expecting parameter list '(string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test.bal lineNumber: 37 ",functionName="testInvalidDataProvider") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test.bal lineNumber: 37 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider2.txt index 76b7ee13ddf5..17c85728d424 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidDataProvider2.txt @@ -10,25 +10,34 @@ Running Tests invalid-data-provider-test2.bal +testInvalidDataProvider2:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidDataProvider2#0: [fail data provider for the function testInvalidDataProvider2] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int,int,int)' cannot be passed to function expecting parameter list '(string,string,string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(int,int,int)' cannot be passed to function expecting parameter list '(string,string,string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test2.bal lineNumber: 39 ",functionName="testInvalidDataProvider2") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test2.bal lineNumber: 39 @@ -36,4 +45,4 @@ Running Tests 0 passing 1 failing 0 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt index e1f62e2ac8ad..66aedc10ba64 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidDataProviderTestCase-testInvalidTupleDataProvider.txt @@ -7,25 +7,34 @@ Running Tests invalid-data-provider-test3.bal +testInvalidTupleDataProvider:0 has failed. + + + Test execution time :*****ms + + [fail] testInvalidTupleDataProvider#0: [fail data provider for the function testInvalidTupleDataProvider] - error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(string,int)' cannot be passed to function expecting parameter list '(string,string)'") + error {ballerina/test:0}ExecutionError ("error("{ballerina/lang.function}IncompatibleArguments",message="arguments of incompatible types: argument list '(string,int)' cannot be passed to function expecting parameter list '(string,string)'") callableName: call moduleName: ballerina.lang.function.0 fileName: function.bal lineNumber: 37 - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 336 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 129 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test3.bal lineNumber: 36 ",functionName="testInvalidTupleDataProvider") - callableName: executeTestFunction moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 346 - callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 136 - callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 123 - callableName: executeTest moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 83 - callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 58 - callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 48 + callableName: handleTestFuncOutput moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 318 + callableName: executeTestFunction moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 130 + callableName: executeDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 115 + callableName: prepareDataDrivenTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 106 + callableName: executeDataDrivenTestSet moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 63 + callableName: executeTest moduleName: ballerina.test.0 fileName: serialExecuter.bal lineNumber: 28 + callableName: executeTests moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 79 + callableName: startSuite moduleName: ballerina.test.0 fileName: execute.bal lineNumber: 52 callableName: __execute__ fileName: invalid-data-provider-test3.bal lineNumber: 36 @@ -33,4 +42,4 @@ Running Tests 0 passing 1 failing 0 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt index 776413ac8068..10e9590c3018 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/InvalidFunctionMockingTestCase-testMockingFunctionWithIncompatibleTypes.txt @@ -5,6 +5,12 @@ Running Tests incompatible_type_mock +functionMockingTest has failed. + + + Test execution time :*****ms + + [fail] functionMockingTest: error {ballerina/test:0}FunctionSignatureMismatchError ("Return type of function stringHello does not match function intAdd") diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testCoverageWithMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testCoverageWithMocking.txt index db33a6fe8160..250d29b6bef1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testCoverageWithMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testCoverageWithMocking.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage mocking_coverage.mod2 + + Test execution time :*****ms + [pass] testFloatAdd [pass] testStringAdd @@ -13,6 +16,9 @@ Running Tests with Coverage 0 skipped mocking_coverage + + Test execution time :*****ms + [pass] testFloatAdd [pass] testStringAdd diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFuncMockInMultiModulesWDepen.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFuncMockInMultiModulesWDepen.txt index 1953b54b2dff..49605dcb9368 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFuncMockInMultiModulesWDepen.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFuncMockInMultiModulesWDepen.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage function_mocking_with_dependencies.a_dependency + + Test execution time :*****ms + [pass] test1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped function_mocking_with_dependencies.b_dependent + + Test execution time :*****ms + [pass] test1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMocking.txt index 86a5f165fe86..0acaa3a3666b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMocking.txt @@ -4,6 +4,18 @@ Compiling source Running Tests with Coverage function_mocking + +call_Test3 has failed. + + +call_Test4 has failed. + + +call_Test5 has failed. + + + Test execution time :*****ms + [pass] callOriginal_Test1 [pass] callOriginal_Test2 [pass] callOriginal_Test3 @@ -49,6 +61,9 @@ Running Tests with Coverage 0 skipped function_mocking.mock2 + + Test execution time :*****ms + [pass] test1 [pass] test2 [pass] test3 @@ -61,4 +76,4 @@ Running Tests with Coverage Generating Test Report function-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingLegacy.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingLegacy.txt index 184ca4ac709c..a8ca32afc8c5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingLegacy.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingLegacy.txt @@ -1,17 +1,20 @@ -Compiling source - intg_tests/function_mocking_legacy:0.1.0 - -Running Tests with Coverage - - function_mocking_legacy - [pass] testIntAdd - [pass] testIntMul - - - 2 passing - 0 failing - 0 skipped - -Generating Test Report - legacy-function-mocking-tests\target\report\test_results.json - +Compiling source + intg_tests/function_mocking_legacy:0.1.0 + +Running Tests with Coverage + + function_mocking_legacy + + Test execution time :*****ms + + [pass] testIntAdd + [pass] testIntMul + + + 2 passing + 0 failing + 0 skipped + +Generating Test Report + legacy-function-mocking-tests\target\report\test_results.json + \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingModuleLevel.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingModuleLevel.txt index 86a5f165fe86..0acaa3a3666b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingModuleLevel.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingModuleLevel.txt @@ -4,6 +4,18 @@ Compiling source Running Tests with Coverage function_mocking + +call_Test3 has failed. + + +call_Test4 has failed. + + +call_Test5 has failed. + + + Test execution time :*****ms + [pass] callOriginal_Test1 [pass] callOriginal_Test2 [pass] callOriginal_Test3 @@ -49,6 +61,9 @@ Running Tests with Coverage 0 skipped function_mocking.mock2 + + Test execution time :*****ms + [pass] test1 [pass] test2 [pass] test3 @@ -61,4 +76,4 @@ Running Tests with Coverage Generating Test Report function-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt index 68f714730f3b..976aea0736de 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testFunctionMockingThenReturnWithNilRetVal.txt @@ -4,6 +4,12 @@ Compiling source Running Tests with Coverage function_mocking + +testFunctionMock3 has failed. + + + Test execution time :*****ms + [pass] testFunctionMock [pass] testFunctionMock2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMockDouble.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMockDouble.txt index 8ae7fd6208c1..e5a6ea4a3f8e 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMockDouble.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMockDouble.txt @@ -1,16 +1,19 @@ -Compiling source - intg_tests/object_mocking2:0.0.0 - -Running Tests with Coverage - - object_mocking2 - [pass] testFn - - - 1 passing - 0 failing - 0 skipped - -Generating Test Report - object-mocking-tests2\target\report\test_results.json - +Compiling source + intg_tests/object_mocking2:0.0.0 + +Running Tests with Coverage + + object_mocking2 + + Test execution time :*****ms + + [pass] testFn + + + 1 passing + 0 failing + 0 skipped + +Generating Test Report + object-mocking-tests2\target\report\test_results.json + \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking.txt index 629ee60cd9f9..57e57935403a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking.txt @@ -1,90 +1,114 @@ -Compiling source - intg_tests/object_mocking:0.0.0 -WARNING [modules\TestHttpClient\main.bal:(54:45,54:82)] this function should explicitly return a value -WARNING [main.bal:(47:5,47:47)] unused variable 'closeErr' - -Running Tests with Coverage - - object_mocking - [pass] testDependentlyTypedFunctions_testDouble - [pass] testDependentlyTypedFunctions_thenReturn - [pass] testMockMemberVariable - [pass] testMockStreamSuccess - [pass] testProvideAReturnSequence - [pass] testProvideAReturnValue - [pass] testProvideAReturnValueBasedOnInput - [pass] testProvideErrorReturnValue - [pass] testUserDefinedMockObject - - [fail] testDefaultIncompatibleArgs: - - error {ballerina/test:0}FunctionSignatureMismatchError ("incorrect type of argument provided at position '1' to mock the function 'get()'") - callableName: validateArgumentsExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 346 - callableName: withArguments moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 132 - callableName: testDefaultIncompatibleArgs moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 56 - callableName: testDefaultIncompatibleArgs$lambda3$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 7 - - - [fail] testDefaultInvalidMemberReturnValue: - - error {ballerina/test:0}InvalidMemberFieldError ("return value provided does not match the type of 'url'") - callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 - callableName: thenReturn moduleName: ballerina.test.0.MemberVariableStub fileName: mock.bal lineNumber: 212 - callableName: testDefaultInvalidMemberReturnValue moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 74 - callableName: testDefaultInvalidMemberReturnValue$lambda5$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 9 - - - [fail] testDefaultMockInvalidFieldName: - - error {ballerina/test:0}InvalidMemberFieldError ("invalid field name 'invalidField' provided") - callableName: validateFieldNameExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 337 - callableName: getMember moduleName: ballerina.test.0.MockObject fileName: mock.bal lineNumber: 95 - callableName: testDefaultMockInvalidFieldName moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 65 - callableName: testDefaultMockInvalidFieldName$lambda4$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 8 - - - [fail] testDefaultMockInvalidReturnValue: - - error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") - callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 - callableName: thenReturn moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 148 - callableName: testDefaultMockInvalidReturnValue moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 35 - callableName: testDefaultMockInvalidReturnValue$lambda0$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 4 - - - [fail] testDefaultMockWrongAction: - - error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") - callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 - callableName: doNothing moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 180 - callableName: testDefaultMockWrongAction moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 42 - callableName: testDefaultMockWrongAction$lambda1$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 5 - - - [fail] testDefaultTooManyArgs: - - error {ballerina/test:0}FunctionSignatureMismatchError ("too many argument provided to mock the function 'get()'") - callableName: validateArgumentsExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 346 - callableName: withArguments moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 132 - callableName: testDefaultTooManyArgs moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 49 - callableName: testDefaultTooManyArgs$lambda2$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 6 - - - [fail] testMockInvalidStream: - - error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get_stream()'") - callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 - callableName: thenReturn moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 148 - callableName: testMockInvalidStream moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 81 - callableName: testMockInvalidStream$lambda6$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 10 - - - - 9 passing - 7 failing - 0 skipped - -Generating Test Report - object-mocking-tests\target\report\test_results.json - -error: there are test failures +Compiling source + intg_tests/object_mocking:0.0.0 +WARNING [modules\TestHttpClient\main.bal:(54:45,54:82)] this function should explicitly return a value +WARNING [main.bal:(47:5,47:47)] unused variable 'closeErr' + +Running Tests with Coverage + + object_mocking + +testDefaultIncompatibleArgs has failed. + + +testDefaultInvalidMemberReturnValue has failed. + + +testDefaultMockInvalidFieldName has failed. + + +testDefaultMockInvalidReturnValue has failed. + + +testDefaultMockWrongAction has failed. + + +testDefaultTooManyArgs has failed. + + +testMockInvalidStream has failed. + + + Test execution time :*****ms + + [pass] testDependentlyTypedFunctions_testDouble + [pass] testDependentlyTypedFunctions_thenReturn + [pass] testMockMemberVariable + [pass] testMockStreamSuccess + [pass] testProvideAReturnSequence + [pass] testProvideAReturnValue + [pass] testProvideAReturnValueBasedOnInput + [pass] testProvideErrorReturnValue + [pass] testUserDefinedMockObject + + [fail] testDefaultIncompatibleArgs: + + error {ballerina/test:0}FunctionSignatureMismatchError ("incorrect type of argument provided at position '1' to mock the function 'get()'") + callableName: validateArgumentsExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 346 + callableName: withArguments moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 132 + callableName: testDefaultIncompatibleArgs moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 56 + callableName: testDefaultIncompatibleArgs$lambda3$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 7 + + + [fail] testDefaultInvalidMemberReturnValue: + + error {ballerina/test:0}InvalidMemberFieldError ("return value provided does not match the type of 'url'") + callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 + callableName: thenReturn moduleName: ballerina.test.0.MemberVariableStub fileName: mock.bal lineNumber: 212 + callableName: testDefaultInvalidMemberReturnValue moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 74 + callableName: testDefaultInvalidMemberReturnValue$lambda5$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 9 + + + [fail] testDefaultMockInvalidFieldName: + + error {ballerina/test:0}InvalidMemberFieldError ("invalid field name 'invalidField' provided") + callableName: validateFieldNameExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 337 + callableName: getMember moduleName: ballerina.test.0.MockObject fileName: mock.bal lineNumber: 95 + callableName: testDefaultMockInvalidFieldName moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 65 + callableName: testDefaultMockInvalidFieldName$lambda4$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 8 + + + [fail] testDefaultMockInvalidReturnValue: + + error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") + callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 + callableName: thenReturn moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 148 + callableName: testDefaultMockInvalidReturnValue moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 35 + callableName: testDefaultMockInvalidReturnValue$lambda0$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 4 + + + [fail] testDefaultMockWrongAction: + + error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") + callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 + callableName: doNothing moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 180 + callableName: testDefaultMockWrongAction moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 42 + callableName: testDefaultMockWrongAction$lambda1$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 5 + + + [fail] testDefaultTooManyArgs: + + error {ballerina/test:0}FunctionSignatureMismatchError ("too many argument provided to mock the function 'get()'") + callableName: validateArgumentsExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 346 + callableName: withArguments moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 132 + callableName: testDefaultTooManyArgs moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 49 + callableName: testDefaultTooManyArgs$lambda2$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 6 + + + [fail] testMockInvalidStream: + + error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get_stream()'") + callableName: thenReturnExt moduleName: ballerina.test.0 fileName: mock.bal lineNumber: 355 + callableName: thenReturn moduleName: ballerina.test.0.MemberFunctionStub fileName: mock.bal lineNumber: 148 + callableName: testMockInvalidStream moduleName: intg_tests.object_mocking$test.0.tests.main_error_test fileName: tests/main_error_test.bal lineNumber: 81 + callableName: testMockInvalidStream$lambda6$ moduleName: intg_tests.object_mocking$test.0.tests.test_execute-generated_*****lineNumber: 10 + + + + 9 passing + 7 failing + 0 skipped + +Generating Test Report + object-mocking-tests\target\report\test_results.json + +error: there are test failures diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases1.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases1.txt index 03f6d1d7f256..cc1bb608ced5 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases1.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases1.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultIncompatibleArgs has failed. + + + Test execution time :*****ms + + [fail] testDefaultIncompatibleArgs: error {ballerina/test:0}FunctionSignatureMismatchError ("incorrect type of argument provided at position '1' to mock the function 'get()'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases2.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases2.txt index 7423be714237..3109f412b758 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases2.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases2.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultInvalidMemberReturnValue has failed. + + + Test execution time :*****ms + + [fail] testDefaultInvalidMemberReturnValue: error {ballerina/test:0}InvalidMemberFieldError ("return value provided does not match the type of 'url'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases3.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases3.txt index 2dc7df0c34b2..e5e7042e4e56 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases3.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases3.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockInvalidFieldName has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockInvalidFieldName: error {ballerina/test:0}InvalidMemberFieldError ("invalid field name 'invalidField' provided") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases4.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases4.txt index 9bee30e15afd..b32d9661cbaf 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases4.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases4.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockInvalidReturnValue has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockInvalidReturnValue: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases5.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases5.txt index 187c46931654..e6c1ba886705 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases5.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases5.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultMockWrongAction has failed. + + + Test execution time :*****ms + + [fail] testDefaultMockWrongAction: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get()'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases6.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases6.txt index 704bcdac5eef..ef30fc128ac9 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases6.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases6.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testDefaultTooManyArgs has failed. + + + Test execution time :*****ms + + [fail] testDefaultTooManyArgs: error {ballerina/test:0}FunctionSignatureMismatchError ("too many argument provided to mock the function 'get()'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases7.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases7.txt index 88d325faaac9..9d25a830fd9c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases7.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NegativeCases7.txt @@ -7,6 +7,12 @@ Running Tests with Coverage object_mocking +testMockInvalidStream has failed. + + + Test execution time :*****ms + + [fail] testMockInvalidStream: error {ballerina/test:0}FunctionSignatureMismatchError ("return value provided does not match the return type of function 'get_stream()'") @@ -23,4 +29,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\object-mocking-tests\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NonPublicField.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NonPublicField.txt index 50815657114f..0c95be6a7562 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NonPublicField.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/MockTest-testObjectMocking_NonPublicField.txt @@ -5,6 +5,12 @@ Running Tests with Coverage non_public_field_mock +testNonPublicMemberFieldMock has failed. + + + Test execution time :*****ms + + [fail] testNonPublicMemberFieldMock: error("NonPublicMemberFieldError",message="member field should be public to be mocked. The provided field 'url' is not public") @@ -21,4 +27,4 @@ Running Tests with Coverage Generating Test Report*****project-based-tests\non-public-field-mock\target\report\test_results.json -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionFlowTest-test-listener-shutdown.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionFlowTest-test-listener-shutdown.txt index efd47ae865c1..b61511a5b41c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionFlowTest-test-listener-shutdown.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionFlowTest-test-listener-shutdown.txt @@ -8,6 +8,9 @@ Calling init for 'moduleA listener' Calling init for 'current module listener' Calling start for 'moduleA listener' Calling start for 'current module listener' + + Test execution time :*****ms + [pass] main_test1 @@ -20,10 +23,13 @@ Calling stop for 'moduleA listener' moduleExecutionFlow.moduleA Calling init for 'moduleA listener' Calling start for 'moduleA listener' + + Test execution time :*****ms + [pass] test1 1 passing 0 failing 0 skipped -Calling stop for 'moduleA listener' +Calling stop for 'moduleA listener' \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_AllTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_AllTests.txt index 15c2a081f427..1eab01cb8b25 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_AllTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_AllTests.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] commonTest [pass] main_test1 [pass] main_test2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt index 884fcfcf1d84..3384fffea4c0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_EndWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 [pass] main_test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt index 884fcfcf1d84..3384fffea4c0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_MiddleWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 [pass] main_test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_SingleTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_SingleTest.txt index 5f40d869bba8..5f0bb38075e0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_SingleTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_SingleTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] main_test1 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt index 4bd66fd24c74..086050fd2f93 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_DefaultModule_StartWildCardTest.txt @@ -5,10 +5,16 @@ Running Tests with Coverage moduleExecution.Module1 + Test execution time :*****ms + + No tests found moduleExecution + + Test execution time :*****ms + [pass] commonTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_AllTests.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_AllTests.txt index 99680375ccc3..7e1b0682791b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_AllTests.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_AllTests.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] commonTest_Module1 [pass] module1_test1 [pass] module1_test2 @@ -15,6 +18,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_SingleTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_SingleTest.txt index e3b2822f0a62..271299c71d4c 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_SingleTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_SingleTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test1 @@ -13,6 +16,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WildCardTest.txt index f68fec87add1..f6f43a526ff0 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WildCardTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test1 [pass] module1_test2 @@ -14,6 +17,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WithGroups.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WithGroups.txt index 90b49c3f933a..805a6fab92c7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WithGroups.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_Module1_WithGroups.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] module1_test2 @@ -13,6 +16,9 @@ Running Tests with Coverage moduleExecution + Test execution time :*****ms + + No tests found diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_WildCardTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_WildCardTest.txt index c45128679656..34856beee756 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_WildCardTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionTest-test_WildCardTest.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage moduleExecution.Module1 + + Test execution time :*****ms + [pass] commonTest_Module1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped moduleExecution + + Test execution time :*****ms + [pass] commonTest diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionWithInitStartFailures.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionWithInitStartFailures.txt index 37923df2e9be..1d105119cab1 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionWithInitStartFailures.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleExecutionWithInitStartFailures.txt @@ -16,6 +16,12 @@ error: Error from start of moduleC at wso2.moduleExecutionInitStartFailure.moduleC.0.Listener:start(main.bal:32) moduleExecutionInitStartFailure.moduleB + +test2: has failed. + + + Test execution time :*****ms + [pass] test1 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleGracefulStopTest-test-listener-shutdown.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleGracefulStopTest-test-listener-shutdown.txt index 08ff88c19732..8b2c8a25287a 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleGracefulStopTest-test-listener-shutdown.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/ModuleGracefulStopTest-test-listener-shutdown.txt @@ -8,6 +8,15 @@ Calling init for moduleA listener Calling init for default module listener Calling start for moduleA listener Calling start for default module listener + +main_negative_test1: has failed. + + +main_negative_test2: has failed. + + + Test execution time :*****ms + [pass] main_test1 [pass] main_test2 @@ -45,6 +54,12 @@ Calling stop for moduleA listener moduleGracefulStopTest.moduleA Calling init for moduleA listener Calling start for moduleA listener + +negative_test1: has failed. + + + Test execution time :*****ms + [pass] test1 [fail] negative_test1: diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyMissingTestsDirectory.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyMissingTestsDirectory.txt index 2c951a872358..431b63d5a448 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyMissingTestsDirectory.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyMissingTestsDirectory.txt @@ -1 +1,3 @@ -Compiling source intg_tests/missing_tests_dir:0.0.0 No tests found \ No newline at end of file +Compiling source + intg_tests/missing_tests_dir:0.0.0 + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyTestsOutsidePath.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyTestsOutsidePath.txt index 1c0ac4b57c6f..fa4872558181 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyTestsOutsidePath.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/PathVerificationTest-verifyTestsOutsidePath.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage path_verification + + Test execution time :*****ms + [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testFullTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testFullTest.txt index ab7ce1da70e0..3b8c591b532f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testFullTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testFullTest.txt @@ -1,36 +1,45 @@ -Compiling source - intg_tests/rerun_failed:0.0.0 - -Running Tests with Coverage - - rerun_failed - [pass] testFunctionPass1 - [pass] testFunctionPass2 - - [fail] testFunctionFail1: - - error {ballerina/test:0}TestError ("Failed!") - callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 - callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 - callableName: testFunctionFail1 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 35 - callableName: testFunctionFail1$lambda2$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 6 - - - [fail] testFunctionFail2: - - error {ballerina/test:0}TestError ("Failed!") - callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 - callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 - callableName: testFunctionFail2 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 41 - callableName: testFunctionFail2$lambda3$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 7 - - - - 2 passing - 2 failing - 0 skipped - -Generating Test Report - rerun-failed-tests\target\report\test_results.json - +Compiling source + intg_tests/rerun_failed:0.0.0 + +Running Tests with Coverage + + rerun_failed + +testFunctionFail1: has failed. + + +testFunctionFail2: has failed. + + + Test execution time :*****ms + + [pass] testFunctionPass1 + [pass] testFunctionPass2 + + [fail] testFunctionFail1: + + error {ballerina/test:0}TestError ("Failed!") + callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 + callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 + callableName: testFunctionFail1 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 35 + callableName: testFunctionFail1$lambda2$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 6 + + + [fail] testFunctionFail2: + + error {ballerina/test:0}TestError ("Failed!") + callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 + callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 + callableName: testFunctionFail2 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 41 + callableName: testFunctionFail2$lambda3$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 7 + + + + 2 passing + 2 failing + 0 skipped + +Generating Test Report + rerun-failed-tests\target\report\test_results.json + error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testRerunFailedTest.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testRerunFailedTest.txt index 767cfe4cb8e9..ba75ae0a1900 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testRerunFailedTest.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/RerunFailedTest-testRerunFailedTest.txt @@ -1,34 +1,43 @@ -Compiling source - intg_tests/rerun_failed:0.0.0 - -Running Tests with Coverage - - rerun_failed - - [fail] testFunctionFail1: - - error {ballerina/test:0}TestError ("Failed!") - callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 - callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 - callableName: testFunctionFail1 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 35 - callableName: testFunctionFail1$lambda2$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 6 - - - [fail] testFunctionFail2: - - error {ballerina/test:0}TestError ("Failed!") - callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 - callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 - callableName: testFunctionFail2 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 41 - callableName: testFunctionFail2$lambda3$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 7 - - - - 0 passing - 2 failing - 0 skipped - -Generating Test Report - rerun-failed-tests\target\report\test_results.json - +Compiling source + intg_tests/rerun_failed:0.0.0 + +Running Tests with Coverage + + rerun_failed + +testFunctionFail1: has failed. + + +testFunctionFail2: has failed. + + + Test execution time :*****ms + + + [fail] testFunctionFail1: + + error {ballerina/test:0}TestError ("Failed!") + callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 + callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 + callableName: testFunctionFail1 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 35 + callableName: testFunctionFail1$lambda2$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 6 + + + [fail] testFunctionFail2: + + error {ballerina/test:0}TestError ("Failed!") + callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 + callableName: assertTrue moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 61 + callableName: testFunctionFail2 moduleName: intg_tests.rerun_failed$test.0.tests.main_test fileName: tests/main_test.bal lineNumber: 41 + callableName: testFunctionFail2$lambda3$ moduleName: intg_tests.rerun_failed$test.0.tests.test_execute-generated_*****lineNumber: 7 + + + + 0 passing + 2 failing + 0 skipped + +Generating Test Report + rerun-failed-tests\target\report\test_results.json + error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDependentFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDependentFunctionExecution.txt index c89d17ea9b9a..dcbd24715486 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDependentFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDependentFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDisabledFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDisabledFunctionExecution.txt index 87854717a900..2de4a92543bb 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDisabledFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testDisabledFunctionExecution.txt @@ -7,5 +7,8 @@ Running Tests single-test-execution.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testMultipleFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testMultipleFunctionExecution.txt index c89d17ea9b9a..dcbd24715486 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testMultipleFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testMultipleFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc [pass] testFunc2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testNonExistingFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testNonExistingFunctionExecution.txt index 87854717a900..2de4a92543bb 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testNonExistingFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testNonExistingFunctionExecution.txt @@ -7,5 +7,8 @@ Running Tests single-test-execution.bal + Test execution time :*****ms + + No tests found \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testSingleFunctionExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testSingleFunctionExecution.txt index ff9dd2d99739..d9c90a241c48 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testSingleFunctionExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SelectedFunctionTest-testSingleFunctionExecution.txt @@ -6,6 +6,9 @@ Compiling source Running Tests single-test-execution.bal + + Test execution time :*****ms + [pass] testFunc diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterEachFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterEachFails.txt index 4289809fc58a..af7992316543 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterEachFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterEachFails.txt @@ -12,10 +12,13 @@ Running Tests callableName: afterEach fileName: skip-when-afterEach-fails.bal lineNumber: 30 callableName: afterEach$lambda2$ fileName: skip-when-afterEach-fails.bal lineNumber: 55 + + Test execution time :*****ms + [pass] test1 1 passing 0 failing 2 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterFails.txt index 4c2bdb043e32..ad2fed3e7124 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenAfterFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: afterFunc fileName: skip-when-after-fails.bal lineNumber: 30 callableName: afterFunc$lambda6$ fileName: skip-when-after-fails.bal lineNumber: 35 + + Test execution time :*****ms + [fail] afterSuite[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuite fileName: skip-when-after-fails.bal lineNumber: 57 - callableName: afterSuite$lambda5$ fileName: skip-when-after-fails.bal lineNumber: 65 + callableName: afterSuite$lambda2$ fileName: skip-when-after-fails.bal lineNumber: 62 [pass] test1 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt index e403faf61045..ed9a844e3a99 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeEachFails.txt @@ -13,8 +13,11 @@ Running Tests callableName: beforeEach$lambda1$ fileName: skip-when-beforeEach-fails.bal lineNumber: 54 + Test execution time :*****ms + + 0 passing 0 failing 3 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeFails.txt index b02834b86908..1bbdf4d8fb9f 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: before fileName: skip-when-before-fails.bal lineNumber: 28 callableName: before$lambda6$ fileName: skip-when-before-fails.bal lineNumber: 32 + + Test execution time :*****ms + [fail] afterSuite[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuite fileName: skip-when-before-fails.bal lineNumber: 54 - callableName: afterSuite$lambda5$ fileName: skip-when-before-fails.bal lineNumber: 62 + callableName: afterSuite$lambda2$ fileName: skip-when-before-fails.bal lineNumber: 59 [pass] test3 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt index 804000cad82c..333ed93d8be7 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeGroupsFails.txt @@ -12,6 +12,9 @@ Running Tests callableName: beforeGroupsFunc2 fileName: skip-when-beforeGroups-fails.bal lineNumber: 32 callableName: beforeGroupsFunc2$lambda2$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 86 + + Test execution time :*****ms + [fail] afterSuiteFunc[after test suite function]: error {ballerina/test:0}TestError ("Assertion Failed! @@ -31,7 +34,7 @@ Running Tests callableName: createBallerinaError moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 41 callableName: assertEquals moduleName: ballerina.test.0 fileName: assert.bal lineNumber: 109 callableName: afterSuiteFunc fileName: skip-when-beforeGroups-fails.bal lineNumber: 81 - callableName: afterSuiteFunc$lambda9$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 93 + callableName: afterSuiteFunc$lambda4$ fileName: skip-when-beforeGroups-fails.bal lineNumber: 88 [pass] testFunction [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt index 98eac9dc53d2..c966c747064b 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenBeforeSuiteFails.txt @@ -13,8 +13,11 @@ Running Tests callableName: beforeSuite$lambda1$ fileName: skip-when-beforeSuite-fails.bal lineNumber: 76 + Test execution time :*****ms + + 0 passing 0 failing 3 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt index c669836aa5fc..eb480d0b4625 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SkipTestsTestCase-testSkipWhenDependsOnFunctionFails.txt @@ -7,6 +7,12 @@ WARNING [dependson-skip-test.bal:(34:5,34:18)] unused variable 'i' Running Tests dependson-skip-test.bal + +test2 has failed. + + + Test execution time :*****ms + [pass] test1 [pass] test5 @@ -21,4 +27,4 @@ Running Tests 2 passing 1 failing 2 skipped -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt index f89b9051d724..8324fc0637bc 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_DefaultModuleSourceOnly_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage defaultModuleSource.module1 + + Test execution time :*****ms + [pass] test3 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped defaultModuleSource.module2 + + Test execution time :*****ms + [pass] test4 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt index b80264eb6c3f..3db8dae7f160 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessModule_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage sourcelessModulesTest.module1 + + Test execution time :*****ms + [pass] test1 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped sourcelessModulesTest.module2 + + Test execution time :*****ms + [pass] test2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt index c9f902aab511..37d486749e44 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/SourcelessTestExecutionTests-test_SourcelessProject_TestExecution.txt @@ -4,6 +4,9 @@ Compiling source Running Tests with Coverage sourcelessProjectTest + + Test execution time :*****ms + [pass] test7 @@ -12,6 +15,9 @@ Running Tests with Coverage 0 skipped sourcelessProjectTest.module1 + + Test execution time :*****ms + [pass] test5 @@ -20,6 +26,9 @@ Running Tests with Coverage 0 skipped sourcelessProjectTest.module2 + + Test execution time :*****ms + [pass] test6 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestExecutionWithInitFailures.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestExecutionWithInitFailures.txt index c235bb1dec8d..aaa44aeeb4df 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestExecutionWithInitFailures.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestExecutionWithInitFailures.txt @@ -4,6 +4,9 @@ Compiling source Running Tests testExecutionWithModuleInitFailure.moduleD + + Test execution time :*****ms + [pass] testFunc @@ -18,6 +21,9 @@ error: {ballerina}DivisionByZero {"message":" / by zero"} error: {ballerina}DivisionByZero {"message":" / by zero"} testExecutionWithModuleInitFailure.moduleC + + Test execution time :*****ms + [pass] testFunc @@ -27,4 +33,4 @@ error: {ballerina}DivisionByZero {"message":" / by zero"} testExecutionWithModuleInitFailure.moduleB error: {ballerina}DivisionByZero {"message":" / by zero"} -error: there are test failures +error: there are test failures \ No newline at end of file diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForCoverageFormatFlag.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForCoverageFormatFlag.txt index 0fdb5111c3d2..71bb5b5629d2 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForCoverageFormatFlag.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForCoverageFormatFlag.txt @@ -6,6 +6,12 @@ WARNING [main.bal:(36:5,36:19)] unused variable 'b' Running Tests foo + +testMain: has failed. + + + Test execution time :*****ms + [pass] testFunc [fail] testMain: @@ -23,6 +29,9 @@ Running Tests 1 skipped foo.bar.tests + + Test execution time :*****ms + [pass] testBarAdd @@ -31,6 +40,9 @@ Running Tests 0 skipped foo.math + + Test execution time :*****ms + [pass] testFunction1 [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForReportTools.txt b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForReportTools.txt index c3b4b2e76075..d7e5939484ed 100644 --- a/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForReportTools.txt +++ b/tests/testerina-integration-test/src/test/resources/command-outputs/windows/TestReportTest-testWarningForReportTools.txt @@ -5,6 +5,12 @@ WARNING [main.bal:(36:5,36:19)] unused variable 'b' Running Tests with Coverage foo + +testMain: has failed. + + + Test execution time :*****ms + [pass] testFunc [fail] testMain: @@ -22,6 +28,9 @@ Running Tests with Coverage 1 skipped foo.bar.tests + + Test execution time :*****ms + [pass] testBarAdd @@ -30,6 +39,9 @@ Running Tests with Coverage 0 skipped foo.math + + Test execution time :*****ms + [pass] testFunction1 [pass] testFunction2 diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/tests/data_driven_test.bal new file mode 100644 index 000000000000..7be5d4866d43 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/isolated-set-up-tear-down/tests/data_driven_test.bal @@ -0,0 +1,91 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/tests/data_driven_test.bal new file mode 100644 index 000000000000..e9c889a80f04 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-each/tests/data_driven_test.bal @@ -0,0 +1,92 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { + +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { +} + +@test:AfterEach +public function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/tests/data_driven_test.bal new file mode 100644 index 000000000000..0bffdce6d3bc --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-func/tests/data_driven_test.bal @@ -0,0 +1,93 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +public function afterFunc() { + +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { + +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/tests/data_driven_test.bal new file mode 100644 index 000000000000..0cc80f39db76 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-after-grp/tests/data_driven_test.bal @@ -0,0 +1,91 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { +} + +@test:AfterGroups {value: ["g1"]} +public function afterGroups1() { +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/tests/data_driven_test.bal new file mode 100644 index 000000000000..c43e1ab9e7e3 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-each/tests/data_driven_test.bal @@ -0,0 +1,91 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +public function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/tests/data_driven_test.bal new file mode 100644 index 000000000000..c29f456c9c4c --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-func/tests/data_driven_test.bal @@ -0,0 +1,91 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +public function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/tests/data_driven_test.bal new file mode 100644 index 000000000000..47fbcf04bf34 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-before-grp/tests/data_driven_test.bal @@ -0,0 +1,91 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function setup() { +} + +@test:BeforeEach +function beforeEachFunc() { +} + +@test:BeforeGroups {value: ["g1"]} +public function beforeGroups1() { +} + +@test:Config { + dataProvider: mapDataProvider, + before: beforeFunc, + after: afterFunc, + groups: ["g1"] +} + +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.1); +} + +function beforeFunc() { +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} + +function afterFunc() { +} + +@test:AfterGroups {value: ["g1"]} +function afterGroups1() { +} + +@test:AfterEach +function afterEachFunc() { +} + +@test:AfterSuite +function cleanup() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/tests/data_driven_test.bal new file mode 100644 index 000000000000..c320b2838878 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-data-provider/tests/data_driven_test.bal @@ -0,0 +1,58 @@ + +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: mapDataProvider +} +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.5); +} + +public function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/tests/data_driven_test.bal new file mode 100644 index 000000000000..943bcf6d2777 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-test-params/tests/data_driven_test.bal @@ -0,0 +1,58 @@ + +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: mapDataProvider +} +function mapDataProviderTest(int value1, int value2, string fruit, string[] emptyArr) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.5); + test:assertEquals(fruit.length(), 6); +} + +function mapDataProvider() returns map<[int, int, string, string[]]>|error { + map<[int, int, string, string[]]> dataSet = { + "banana": [10, 10, "banana", []], + "cherry": [5, 5, "cherry", []], + "apple": [5, 5, "apple", []], + "orange": [5, 5, "orange", []], + "carrot": [5, 5, "carrot", []], + "lemon": [5, 5, "lemon", []], + "tomatto": [5, 5, "tomatto", []], + "papaya": [5, 5, "papaya", []], + "grapes": [5, 5, "grapes", []], + "mango": [5, 5, "mango", []], + "pineapple": [5, 5, "pineapple", []], + "watermelon": [5, 5, "watermelon", []], + "strawberry": [5, 5, "strawberry", []], + "melon": [5, 5, "melon", []], + "guava": [5, 5, "guava", []], + "pomegranate": [5, 5, "pomegranate", []], + "jackfruit": [5, 5, "jackfruit", []], + "coconut": [5, 5, "coconut", []], + "peach": [5, 5, "peach", []], + "pear": [5, 5, "pear", []], + "plum": [5, 5, "plum", []], + "blueberry": [5, 5, "blueberry", []], + "raspberry": [5, 5, "raspberry", []], + "kiwi": [5, 5, "kiwi", []], + "avocado": [5, 5, "avocado", []], + "cucumber": [5, 5, "cucumber", []], + "pepper": [5, 5, "pepper", []], + "onion": [5, 5, "onion", []], + "potato": [5, 5, "potato", []], + "tomato": [5, 5, "tomato", []], + "garlic": [5, 5, "garlic", []], + "ginger": [5, 5, "ginger", []], + "spinach": [5, 5, "spinach", []], + "broccoli": [5, 5, "broccoli", []], + "cauliflower": [5, 5, "cauliflower", []], + "cabbage": [5, 5, "cabbage", []], + "beetroot": [5, 5, "beetroot", []], + "celery": [5, 5, "celery", []], + "corn": [5, 5, "corn", []], + "mushroom": [5, 5, "mushroom", []] + }; + return dataSet; +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/Ballerina.toml new file mode 100644 index 000000000000..10927eae3866 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/Ballerina.toml @@ -0,0 +1,7 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" + + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/tests/normalTest.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/tests/normalTest.bal new file mode 100644 index 000000000000..c92e46c81ce7 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-isolated-tests/tests/normalTest.bal @@ -0,0 +1,378 @@ + +import ballerina/test; +import ballerina/lang.runtime; + +@test:BeforeSuite +public function beforeSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals1() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1]} +public function testAssertEquals2() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2]} +public function testAssertEquals3() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2]} +public function testAssertEquals4() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4]} +public function testAssertEquals5() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4, testAssertEquals5]} +public function testAssertEquals6() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals7() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals6]} +public function testAssertEquals8() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4, testAssertEquals8]} +public function testAssertEquals9() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals8, testAssertEquals7, testAssertEquals11]} +public function testAssertEquals10() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals11() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals7]} +public function testAssertEquals12() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals6]} +public function testAssertEquals13() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals14() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals15() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals13]} +public function testAssertEquals16() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals17() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals17]} +public function testAssertEquals18() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals16]} +public function testAssertEquals19() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals16]} +public function testAssertEquals20() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals14]} +public function testAssertEquals21() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals14, testAssertEquals15]} +public function testAssertEquals22() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals15, testAssertEquals21]} +public function testAssertEquals23() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals19, testAssertEquals20]} +public function testAssertEquals24() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals20, testAssertEquals24, testAssertEquals12, testAssertEquals11]} +public function testAssertEquals25() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals25, testAssertEquals24]} +public function testAssertEquals26() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals24, testAssertEquals26]} +public function testAssertEquals27() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +public function testAssertEquals28() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +public function testAssertEquals29() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +public function testAssertEquals30() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +public function testAssertEquals31() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +public function testAssertEquals32() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +public function testAssertEquals33() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals34() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals35() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals36() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals37() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals38() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals39() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals40() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals41() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals42() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals43() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals44() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals45() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals46() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals47() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals48() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals49() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals50() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals51() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals52() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals53() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals54() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals55() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals56() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals57() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals58() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals59() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10]} +public function testAssertEquals60() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +// After Suite public function + +@test:AfterSuite +public function afterSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/tests/data_driven_test.bal new file mode 100644 index 000000000000..8a57de038e91 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-map-data-provider/tests/data_driven_test.bal @@ -0,0 +1,60 @@ + +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: mapDataProvider, + serialExecution: true +} +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.5); + test:assertEquals(fruit.length(), 6); +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/tests/data_driven_test.bal new file mode 100644 index 000000000000..b8b3bfbb8e7e --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/non-parallelisation-tuple-data-provider/tests/data_driven_test.bal @@ -0,0 +1,51 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: stringDataProvider, + serialExecution: true +} +function testAddingValues0(string fValue, string sValue, string result) returns error? { + int value1 = check 'int:fromString(fValue); + int value2 = check 'int:fromString(sValue); + int result1 = check 'int:fromString(result); + runtime:sleep(1); + test:assertEquals(value1 + value2, result1, msg = "Incorrect Sum"); +} + +function stringDataProvider() returns (string[][]) { + return [ + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + , + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + , + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + ]; +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/tests/data_driven_test.bal new file mode 100644 index 000000000000..4edbaafb8182 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-map-data-provider/tests/data_driven_test.bal @@ -0,0 +1,59 @@ + +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: mapDataProvider +} +function mapDataProviderTest(int value1, int value2, string fruit) returns error? { + test:assertEquals(value1, value2, msg = "The provided values are not equal"); + runtime:sleep(0.5); + test:assertEquals(fruit.length(), 6); +} + +function mapDataProvider() returns map<[int, int, string]>|error { + map<[int, int, string]> dataSet = { + "banana": [10, 10, "banana"], + "cherry": [5, 5, "cherry"], + "apple": [5, 5, "apple"], + "orange": [5, 5, "orange"], + "carrot": [5, 5, "carrot"], + "lemon": [5, 5, "lemon"], + "tomatto": [5, 5, "tomatto"], + "papaya": [5, 5, "papaya"], + "grapes": [5, 5, "grapes"], + "mango": [5, 5, "mango"], + "pineapple": [5, 5, "pineapple"], + "watermelon": [5, 5, "watermelon"], + "strawberry": [5, 5, "strawberry"], + "melon": [5, 5, "melon"], + "guava": [5, 5, "guava"], + "pomegranate": [5, 5, "pomegranate"], + "jackfruit": [5, 5, "jackfruit"], + "coconut": [5, 5, "coconut"], + "peach": [5, 5, "peach"], + "pear": [5, 5, "pear"], + "plum": [5, 5, "plum"], + "blueberry": [5, 5, "blueberry"], + "raspberry": [5, 5, "raspberry"], + "kiwi": [5, 5, "kiwi"], + "avocado": [5, 5, "avocado"], + "cucumber": [5, 5, "cucumber"], + "pepper": [5, 5, "pepper"], + "onion": [5, 5, "onion"], + "potato": [5, 5, "potato"], + "tomato": [5, 5, "tomato"], + "garlic": [5, 5, "garlic"], + "ginger": [5, 5, "ginger"], + "spinach": [5, 5, "spinach"], + "broccoli": [5, 5, "broccoli"], + "cauliflower": [5, 5, "cauliflower"], + "cabbage": [5, 5, "cabbage"], + "beetroot": [5, 5, "beetroot"], + "celery": [5, 5, "celery"], + "corn": [5, 5, "corn"], + "mushroom": [5, 5, "mushroom"] + + }; + return dataSet; +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/tests/normalTest.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/tests/normalTest.bal new file mode 100644 index 000000000000..2a0a9d9c42a7 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-serialExecution/tests/normalTest.bal @@ -0,0 +1,382 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function beforeSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testFunction() { + test:assertTrue(true, msg = "Failed!"); +} + +@test:Config {serialExecution: true} +function testAssertEquals1() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1]} +function testAssertEquals2() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2]} +function testAssertEquals3() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2]} +function testAssertEquals4() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals4]} +function testAssertEquals5() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals4, testAssertEquals5]} +function testAssertEquals6() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals7() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals6]} +function testAssertEquals8() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals4, testAssertEquals8]} +function testAssertEquals9() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals8, testAssertEquals7, testAssertEquals11]} +function testAssertEquals10() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals11() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals7]} +function testAssertEquals12() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals6]} +function testAssertEquals13() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals14() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals15() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals13]} +function testAssertEquals16() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals17() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals17]} +function testAssertEquals18() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals16]} +function testAssertEquals19() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals16]} +function testAssertEquals20() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals14]} +function testAssertEquals21() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals14, testAssertEquals15]} +function testAssertEquals22() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals15, testAssertEquals21]} +function testAssertEquals23() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals19, testAssertEquals20]} +function testAssertEquals24() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals20, testAssertEquals24, testAssertEquals12, testAssertEquals11]} +function testAssertEquals25() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals25, testAssertEquals24]} +function testAssertEquals26() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals24, testAssertEquals26]} +function testAssertEquals27() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals28() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals28]} +function testAssertEquals29() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals28]} +function testAssertEquals30() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals28]} +function testAssertEquals31() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals28]} +function testAssertEquals32() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals28]} +function testAssertEquals33() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals34() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals35() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals36() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals37() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals38() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals39() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals40() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals41() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals42() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals43() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals44() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals45() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals46() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals47() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals48() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals49() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals50() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals51() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals52() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals53() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals54() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals55() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals56() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals57() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals58() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals59() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true, dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals60() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +// After Suite Function + +@test:AfterSuite +function afterSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/Ballerina.toml new file mode 100644 index 000000000000..10927eae3866 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/Ballerina.toml @@ -0,0 +1,7 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" + + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/tests/normalTest.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/tests/normalTest.bal new file mode 100644 index 000000000000..7aeb57fd649a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-simple-test/tests/normalTest.bal @@ -0,0 +1,382 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:BeforeSuite +function beforeSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +function testFunction() { + test:assertTrue(true, msg = "Failed!"); +} + +@test:Config {} +function testAssertEquals1() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1]} +function testAssertEquals2() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2]} +function testAssertEquals3() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2]} +function testAssertEquals4() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4]} +function testAssertEquals5() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4, testAssertEquals5], serialExecution: true} +function testAssertEquals6() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +function testAssertEquals7() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals6]} +function testAssertEquals8() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals4, testAssertEquals8]} +function testAssertEquals9() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals8, testAssertEquals7, testAssertEquals11]} +function testAssertEquals10() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals11() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals7]} +function testAssertEquals12() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals6]} +function testAssertEquals13() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals14() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +function testAssertEquals15() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals13]} +function testAssertEquals16() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {} +function testAssertEquals17() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals17]} +function testAssertEquals18() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals16]} +function testAssertEquals19() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals16]} +function testAssertEquals20() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals14]} +function testAssertEquals21() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals14, testAssertEquals15]} +function testAssertEquals22() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals15, testAssertEquals21]} +function testAssertEquals23() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals19, testAssertEquals20], serialExecution: true} +function testAssertEquals24() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals20, testAssertEquals24, testAssertEquals12, testAssertEquals11]} +function testAssertEquals25() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals25, testAssertEquals24]} +function testAssertEquals26() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals24, testAssertEquals26]} +function testAssertEquals27() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {serialExecution: true} +function testAssertEquals28() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +function testAssertEquals29() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +function testAssertEquals30() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +function testAssertEquals31() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +function testAssertEquals32() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals28]} +function testAssertEquals33() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals34() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals35() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals36() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals37() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals38() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals39() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals40() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals41() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals42() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals43() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals44() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals45() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals46() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals47() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals48() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals49() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals50() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals51() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals52() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals53() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals54() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals55() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals56() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals57() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals58() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals59() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +@test:Config {dependsOn: [testAssertEquals1, testAssertEquals2, testAssertEquals4, testAssertEquals5, testAssertEquals6, testAssertEquals7, testAssertEquals8, testAssertEquals9, testAssertEquals10, testFunction]} +function testAssertEquals60() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + +// After Suite Function + +@test:AfterSuite +function afterSuiteFunc() { + runtime:sleep(0.5); + test:assertEquals(100, 100); +} + diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/Ballerina.toml b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/Ballerina.toml new file mode 100644 index 000000000000..a0611873503a --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/Ballerina.toml @@ -0,0 +1,8 @@ +[package] +org = "luheerathan" +name = "test_parallelisation_test" +version = "0.1.0" +distribution = "2201.3.0-rc3" + +[build-options] +observabilityIncluded = true diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/main.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/main.bal new file mode 100644 index 000000000000..6b71ef415c69 --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/main.bal @@ -0,0 +1,2 @@ +public function main() { +} diff --git a/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/tests/data_driven_test.bal b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/tests/data_driven_test.bal new file mode 100644 index 000000000000..14b9a4db316c --- /dev/null +++ b/tests/testerina-integration-test/src/test/resources/project-based-tests/parallelisation-test/parallelisation-tuple-data-provider/tests/data_driven_test.bal @@ -0,0 +1,50 @@ +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + dataProvider: stringDataProvider +} +function testAddingValues0(string fValue, string sValue, string result) returns error? { + int value1 = check 'int:fromString(fValue); + int value2 = check 'int:fromString(sValue); + int result1 = check 'int:fromString(result); + runtime:sleep(1); + test:assertEquals(value1 + value2, result1, msg = "Incorrect Sum"); +} + +function stringDataProvider() returns (string[][]) { + return [ + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + , + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + , + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"], + ["1", "2", "3"], + ["10", "20", "30"], + ["5", "6", "11"] + ]; +} diff --git a/tests/testerina-integration-test/src/test/resources/testng.xml b/tests/testerina-integration-test/src/test/resources/testng.xml index db46e1c50239..03620f5dd31b 100644 --- a/tests/testerina-integration-test/src/test/resources/testng.xml +++ b/tests/testerina-integration-test/src/test/resources/testng.xml @@ -57,6 +57,7 @@ under the License. +