From c614b363a3baa62bc92417b834507f3756ae52fa Mon Sep 17 00:00:00 2001 From: Alan Ly <36793262+aly76@users.noreply.github.com> Date: Wed, 29 Jul 2020 19:47:23 +1000 Subject: [PATCH] Validate code coverage for individual test classes in TriggerApexTest task (#109) * Validate code coverage for individual test classes in TriggerApexTest task * Update core dependency in TriggerApexTest task * Update Azp core dependecy to ^1.0.2 * Bump versions for changes to TriggerApexTest task Bump major version of Trigger Apex Test task Bump minor version of core and CLI --- .../AnalyzeWithPMDTask/package-lock.json | 2 +- .../AnalyzeWithPMDTask/package.json | 4 +-- .../BuildTasks/AnalyzeWithPMDTask/task.json | 2 +- .../package-lock.json | 2 +- .../AuthenticateOrgTaskCurrent/package.json | 2 +- .../AuthenticateOrgTaskCurrent/task.json | 2 +- .../package-lock.json | 2 +- .../package.json | 2 +- .../CheckoutProjectFromArtifactTask/task.json | 2 +- .../CreateDeltaPackageTask/package-lock.json | 2 +- .../CreateDeltaPackageTask/package.json | 4 +-- .../CreateDeltaPackageTask/task.json | 2 +- .../CreateSourcePackageTask/package-lock.json | 2 +- .../CreateSourcePackageTask/package.json | 4 +-- .../CreateSourcePackageTask/task.json | 2 +- .../package-lock.json | 2 +- .../CreateUnlockedPackageTask/package.json | 4 +-- .../CreateUnlockedPackageTask/task.json | 2 +- .../package-lock.json | 2 +- .../package.json | 4 +-- .../task.json | 2 +- .../DeploySourceToOrgTask/package-lock.json | 2 +- .../DeploySourceToOrgTask/package.json | 4 +-- .../DeploySourceToOrgTask/task.json | 4 +-- .../package-lock.json | 2 +- .../ExportSourceFromAnOrgTask/package.json | 4 +-- .../ExportSourceFromAnOrgTask/task.json | 2 +- .../package-lock.json | 2 +- .../package.json | 2 +- .../package-lock.json | 2 +- .../package.json | 4 +-- .../InstallPackageDependenciesTask/task.json | 2 +- .../package-lock.json | 2 +- .../InstallSFDXCLITaskCurrent/package.json | 2 +- .../InstallSFDXCLITaskCurrent/task.json | 2 +- .../package-lock.json | 2 +- .../InstallUnlockedPackageTask/package.json | 4 +-- .../InstallUnlockedPackageTask/task.json | 2 +- .../package-lock.json | 2 +- .../ManageScratchOrgTaskCurrent/package.json | 2 +- .../PostPackageCreateTask/package-lock.json | 2 +- .../PostPackageCreateTask/package.json | 2 +- .../PostPackageCreateTask/task.json | 2 +- .../package-lock.json | 2 +- .../PromoteUnlockedPackageTask/package.json | 4 +-- .../PromoteUnlockedPackageTask/task.json | 2 +- .../TriggerApexTestTask/TriggerApexTest.ts | 6 ++-- .../TriggerApexTestTask/package-lock.json | 2 +- .../TriggerApexTestTask/package.json | 4 +-- .../BuildTasks/TriggerApexTestTask/task.json | 21 ++++++++++-- .../package-lock.json | 2 +- .../ValidateApexCoverageTask/package.json | 4 +-- .../ValidateApexCoverageTask/task.json | 2 +- .../package-lock.json | 2 +- .../package.json | 4 +-- .../ValidateDXUnlockedPackageTask/task.json | 2 +- .../package-lock.json | 2 +- .../package.json | 4 +-- .../ValidateTestCoveragePackageTask/task.json | 2 +- packages/azpipelines/package-lock.json | 2 +- packages/azpipelines/package.json | 2 +- packages/core/package-lock.json | 2 +- packages/core/package.json | 2 +- .../src/sfdxwrappers/TriggerApexTestImpl.ts | 33 +++++++++++++++++-- .../messages/trigger_apex_test.json | 4 ++- packages/sfpowerscripts-cli/package-lock.json | 2 +- packages/sfpowerscripts-cli/package.json | 4 +-- .../sfpowerscripts/TriggerApexTest.ts | 6 +++- 68 files changed, 139 insertions(+), 89 deletions(-) diff --git a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package-lock.json b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package-lock.json index 19008ed9d..15a14e789 100644 --- a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-analyzewithpmd-task", - "version": "6.0.6", + "version": "6.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package.json b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package.json index d53f1c21e..680feb691 100644 --- a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package.json +++ b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-analyzewithpmd-task", "description": "sfpowerscripts-analyzewithpmd-task", - "version": "6.0.6", + "version": "6.0.7", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0", "xml2js": "^0.4.22" } diff --git a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/task.json b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/task.json index 00fa8b0ae..374f9e9fc 100644 --- a/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/task.json +++ b/packages/azpipelines/BuildTasks/AnalyzeWithPMDTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 6, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "instanceNameFormat": "Analyze $(directory) using PMD", "inputs": [ diff --git a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package-lock.json b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package-lock.json index 43dc49d81..1a8380fb8 100644 --- a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package-lock.json +++ b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-authenticateorg-task", - "version": "9.0.6", + "version": "9.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package.json b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package.json index b3145873a..3f53af439 100644 --- a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package.json +++ b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-authenticateorg-task", "description": "sfpowerscripts-authenticateorg-task", - "version": "9.0.6", + "version": "9.0.7", "private": true, "repository": { "type": "git", diff --git a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/task.json b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/task.json index f050b2a08..1c81b72c6 100644 --- a/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/task.json +++ b/packages/azpipelines/BuildTasks/AuthenticateOrgTaskCurrent/task.json @@ -9,7 +9,7 @@ "version": { "Major": 9, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package-lock.json b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package-lock.json index 58a13732c..4d637cae1 100644 --- a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-checkoutprojectfromartifact-task", - "version": "13.3.2", + "version": "13.3.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package.json b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package.json index 5ed648f7f..53c7e07ef 100644 --- a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package.json +++ b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-checkoutprojectfromartifact-task", "description": "sfpowerscripts-checkoutprojectfromartifact-task", - "version": "13.3.2", + "version": "13.3.3", "private": true, "repository": { "type": "git", diff --git a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/task.json b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/task.json index 646a127ff..f2049c653 100644 --- a/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/task.json +++ b/packages/azpipelines/BuildTasks/CheckoutProjectFromArtifactTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 13, "Minor": 3, - "Patch": 2 + "Patch": 3 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package-lock.json b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package-lock.json index 4ec5187ab..952fc8bdd 100644 --- a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-createdeltapackage-task", - "version": "5.0.7", + "version": "5.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package.json b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package.json index c8b4b811b..ec2fa0447 100644 --- a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package.json +++ b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-createdeltapackage-task", "description": "sfpowerscripts-createdeltapackage-task", - "version": "5.0.7", + "version": "5.0.8", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "applicationinsights": "^1.6.0", "azure-pipelines-task-lib": "^2.8.0" } diff --git a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/task.json b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/task.json index be1fac6b3..b60d7881e 100644 --- a/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/task.json +++ b/packages/azpipelines/BuildTasks/CreateDeltaPackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 5, "Minor": 0, - "Patch": 7 + "Patch": 8 }, "instanceNameFormat": "Create Delta Package based on two commits", "inputs": [ diff --git a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package-lock.json b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package-lock.json index 7f763d995..6b9f9bef3 100644 --- a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-createsourcepackage-task", - "version": "10.0.4", + "version": "10.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package.json b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package.json index 47c7a0c93..1eb58c5b5 100644 --- a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package.json +++ b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-createsourcepackage-task", "description": "sfpowerscripts-createsourcepackage-task", - "version": "10.0.4", + "version": "10.0.5", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "applicationinsights": "^1.6.0", "azure-pipelines-task-lib": "^2.8.0", "fs-extra": "^8.1.0" diff --git a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/task.json b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/task.json index 3423c3207..b2846ba6e 100644 --- a/packages/azpipelines/BuildTasks/CreateSourcePackageTask/task.json +++ b/packages/azpipelines/BuildTasks/CreateSourcePackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 10, "Minor": 0, - "Patch": 4 + "Patch": 5 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package-lock.json b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package-lock.json index 8068a9a3b..8965ed36a 100644 --- a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-createunlockedpackage-task", - "version": "11.0.4", + "version": "11.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package.json b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package.json index 0764a3a10..5c290dc94 100644 --- a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package.json +++ b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-createunlockedpackage-task", "description": "sfpowerscripts-createunlockedpackage-task", - "version": "11.0.4", + "version": "11.0.5", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/task.json b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/task.json index d58b4b1ea..97425b6cf 100644 --- a/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/task.json +++ b/packages/azpipelines/BuildTasks/CreateUnlockedPackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 11, "Minor": 0, - "Patch": 4 + "Patch": 5 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package-lock.json b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package-lock.json index ac9dcbfe8..79f93325b 100644 --- a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-deploydestructivemanifesttoorg-task", - "version": "5.0.2", + "version": "5.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package.json b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package.json index 358ed4b29..d59513c12 100644 --- a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package.json +++ b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-deploydestructivemanifesttoorg-task", "description": "sfpowerscripts-deploydestructivemanifesttoorg-task", - "version": "5.0.2", + "version": "5.0.3", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0", "rimraf": "^3.0.0" } diff --git a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/task.json b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/task.json index c0394efe6..162cce874 100644 --- a/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/task.json +++ b/packages/azpipelines/BuildTasks/DeployDestructiveManifestToOrgTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 5, "Minor": 0, - "Patch": 2 + "Patch": 3 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package-lock.json b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package-lock.json index b48adaa85..4fae32225 100644 --- a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-deploysourcetoorg-task", - "version": "9.0.2", + "version": "9.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package.json b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package.json index 3b71a4232..296d5a66e 100644 --- a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package.json +++ b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-deploysourcetoorg-task", "description": "sfpowerscripts-deploysourcetoorg-task", - "version": "9.0.2", + "version": "9.0.3", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0", "rimraf": "^3.0.0" } diff --git a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/task.json b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/task.json index 8b2bfeb90..3d0e2d42a 100644 --- a/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/task.json +++ b/packages/azpipelines/BuildTasks/DeploySourceToOrgTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 9, "Minor": 0, - "Patch": 2 + "Patch": 3 }, "runsOn": [ "Agent" @@ -134,4 +134,4 @@ "target": "lib/DeploySourceToOrg.js" } } -} +} \ No newline at end of file diff --git a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package-lock.json b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package-lock.json index 11e317cbc..3d3a3fdd5 100644 --- a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-exportsourcefromorg-task", - "version": "3.0.6", + "version": "3.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package.json b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package.json index c625779bb..9ca4bb846 100644 --- a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package.json +++ b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-exportsourcefromorg-task", "description": "sfpowerscripts-exportsourcefromorg-task", - "version": "3.0.6", + "version": "3.0.7", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "applicationinsights": "^1.6.0", "azure-pipelines-task-lib": "^2.8.0" } diff --git a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/task.json b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/task.json index 21fad4e14..42b38a690 100644 --- a/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/task.json +++ b/packages/azpipelines/BuildTasks/ExportSourceFromAnOrgTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 3, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package-lock.json b/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package-lock.json index 7de840c09..600549cd2 100644 --- a/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-incrementprojectbuildnumber-task", - "version": "9.0.6", + "version": "9.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package.json b/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package.json index ccd32ab77..b21a51a0f 100644 --- a/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package.json +++ b/packages/azpipelines/BuildTasks/IncrementProjectBuildNumberTask/package.json @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0", "simple-git": "^1.126.0" } diff --git a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package-lock.json b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package-lock.json index 834e62f7f..b4ad1dcf9 100644 --- a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-installpackagedependencies-task", - "version": "4.0.7", + "version": "4.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package.json b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package.json index a210a3e68..0f2ca9d46 100644 --- a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package.json +++ b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-installpackagedependencies-task", "description": "sfpowerscripts-installpackagedependencies-task", - "version": "4.0.7", + "version": "4.0.8", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/task.json b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/task.json index 506302f9a..e51539fc2 100644 --- a/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/task.json +++ b/packages/azpipelines/BuildTasks/InstallPackageDependenciesTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 4, "Minor": 0, - "Patch": 7 + "Patch": 8 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package-lock.json b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package-lock.json index 731db1c8e..e8eb898a3 100644 --- a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package-lock.json +++ b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-installsfdx-task", - "version": "7.0.6", + "version": "7.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package.json b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package.json index ed6e23c38..ac52a9c48 100644 --- a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package.json +++ b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-installsfdx-task", "description": "Install SFDX CLI Task", - "version": "7.0.6", + "version": "7.0.7", "private": true, "repository": { "type": "git", diff --git a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/task.json b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/task.json index 5c40d3cc3..7dbc1f867 100644 --- a/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/task.json +++ b/packages/azpipelines/BuildTasks/InstallSFDXCLITaskCurrent/task.json @@ -9,7 +9,7 @@ "version": { "Major": 7, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package-lock.json b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package-lock.json index d1dc03056..f44fb9509 100644 --- a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-installunlockedpackage-task", - "version": "10.0.1", + "version": "10.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package.json b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package.json index fbbb6d62a..eb8be1671 100644 --- a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package.json +++ b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-installunlockedpackage-task", "description": "sfpowerscripts-installunlockedpackage-task", - "version": "10.0.1", + "version": "10.0.2", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/task.json b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/task.json index 8ee55f856..436ddd72c 100644 --- a/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/task.json +++ b/packages/azpipelines/BuildTasks/InstallUnlockedPackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 10, "Minor": 0, - "Patch": 1 + "Patch": 2 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package-lock.json b/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package-lock.json index cdfebc06d..6f0659ae7 100644 --- a/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package-lock.json +++ b/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-managescratchorg-task", - "version": "8.0.7", + "version": "8.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package.json b/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package.json index 4594bc2cd..5a28c79ef 100644 --- a/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package.json +++ b/packages/azpipelines/BuildTasks/ManageScratchOrgTaskCurrent/package.json @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/PostPackageCreateTask/package-lock.json b/packages/azpipelines/BuildTasks/PostPackageCreateTask/package-lock.json index 2fa141b06..d004fb588 100644 --- a/packages/azpipelines/BuildTasks/PostPackageCreateTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/PostPackageCreateTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-postcreatepackage-task", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/PostPackageCreateTask/package.json b/packages/azpipelines/BuildTasks/PostPackageCreateTask/package.json index 06675f5e9..01b1148dd 100644 --- a/packages/azpipelines/BuildTasks/PostPackageCreateTask/package.json +++ b/packages/azpipelines/BuildTasks/PostPackageCreateTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-postcreatepackage-task", "description": "sfpowerscripts-postcreatepackage-task", - "version": "1.0.4", + "version": "1.0.5", "private": true, "repository": { "type": "git", diff --git a/packages/azpipelines/BuildTasks/PostPackageCreateTask/task.json b/packages/azpipelines/BuildTasks/PostPackageCreateTask/task.json index c764668cb..dcd14c215 100644 --- a/packages/azpipelines/BuildTasks/PostPackageCreateTask/task.json +++ b/packages/azpipelines/BuildTasks/PostPackageCreateTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 4 + "Patch": 5 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package-lock.json b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package-lock.json index eb75722c2..73c10fd57 100644 --- a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-promoteunlocked-task", - "version": "7.0.2", + "version": "7.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package.json b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package.json index 4f9627a5f..6eb0ae3c5 100644 --- a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package.json +++ b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-promoteunlocked-task", "description": "sfpowerscripts-promoteunlocked-task", - "version": "7.0.2", + "version": "7.0.3", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/task.json b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/task.json index 4440bab49..61b0a2401 100644 --- a/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/task.json +++ b/packages/azpipelines/BuildTasks/PromoteUnlockedPackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 7, "Minor": 0, - "Patch": 2 + "Patch": 3 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/TriggerApexTestTask/TriggerApexTest.ts b/packages/azpipelines/BuildTasks/TriggerApexTestTask/TriggerApexTest.ts index 7458a7afb..775327e1b 100644 --- a/packages/azpipelines/BuildTasks/TriggerApexTestTask/TriggerApexTest.ts +++ b/packages/azpipelines/BuildTasks/TriggerApexTestTask/TriggerApexTest.ts @@ -9,12 +9,12 @@ async function run() { try { const target_org: string = tl.getInput("target_org", true); - test_options["wait_time"] = tl.getInput("wait_time", true); - - test_options["testlevel"] = tl.getInput("testlevel", true); test_options["synchronous"] = tl.getBoolInput("synchronous", false); + test_options["isValidateCoverage"] = tl.getBoolInput("isValidateCoverage", false); + test_options["coverageThreshold"] = parseInt(tl.getInput("coverageThreshold", false), 10); + if (test_options["testlevel"] == "RunSpecifiedTests") test_options["specified_tests"] = tl.getInput("specified_tests", true); diff --git a/packages/azpipelines/BuildTasks/TriggerApexTestTask/package-lock.json b/packages/azpipelines/BuildTasks/TriggerApexTestTask/package-lock.json index 7af2e50a2..2fe14f567 100644 --- a/packages/azpipelines/BuildTasks/TriggerApexTestTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/TriggerApexTestTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-triggerapextest-task", - "version": "7.0.6", + "version": "8.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/TriggerApexTestTask/package.json b/packages/azpipelines/BuildTasks/TriggerApexTestTask/package.json index ab2897c7b..fd6e90aee 100644 --- a/packages/azpipelines/BuildTasks/TriggerApexTestTask/package.json +++ b/packages/azpipelines/BuildTasks/TriggerApexTestTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-triggerapextest-task", "description": "sfpowerscripts-triggerapextest-task", - "version": "7.0.6", + "version": "8.0.0", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0", "fs-extra": "^8.1.0" } diff --git a/packages/azpipelines/BuildTasks/TriggerApexTestTask/task.json b/packages/azpipelines/BuildTasks/TriggerApexTestTask/task.json index 8717b4dd5..fb6d46e7a 100644 --- a/packages/azpipelines/BuildTasks/TriggerApexTestTask/task.json +++ b/packages/azpipelines/BuildTasks/TriggerApexTestTask/task.json @@ -7,9 +7,9 @@ "category": "Build", "author": "dxatscale@accenture.com", "version": { - "Major": 7, + "Major": 8, "Minor": 0, - "Patch": 6 + "Patch": 0 }, "runsOn": [ "Agent" @@ -64,6 +64,23 @@ "helpMarkDown": "Select an option if the tests are to be run synchronously", "required": false }, + { + "name": "isValidateCoverage", + "type": "boolean", + "label": "Validate code coverage of individual test classes", + "defaultValue": false, + "helpMarkDown": "When enabled, verifies whether indvidual test classes meet minimum code coverage requirement", + "required": false + }, + { + "name": "coverageThreshold", + "type": "string", + "label": "Minimum percentage coverage required per test class", + "defaultValue": "75", + "helpMarkDown": "Minimum coverage required per test class, in order for the task to succeed", + "required": false, + "visibleRule": "isValidateCoverage = true" + }, { "name": "wait_time", "type": "string", diff --git a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package-lock.json b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package-lock.json index 56da7bf6e..99b90e25f 100644 --- a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-validateapextestcoverage-task", - "version": "4.0.6", + "version": "4.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package.json b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package.json index d2a75580b..a3f8f9d27 100644 --- a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package.json +++ b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-validateapextestcoverage-task", "description": "sfpowerscripts-validateapextestcoverage-task", - "version": "4.0.6", + "version": "4.0.7", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/task.json b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/task.json index b9ab97408..7bc32d24d 100644 --- a/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/task.json +++ b/packages/azpipelines/BuildTasks/ValidateApexCoverageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 4, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package-lock.json b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package-lock.json index bfd003a58..50ea827b0 100644 --- a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-validatedxunlockedpackage-task", - "version": "4.0.6", + "version": "4.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package.json b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package.json index dbbbf4ea6..77b0baf9f 100644 --- a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package.json +++ b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-validatedxunlockedpackage-task", "description": "sfpowerscripts-validatedxunlockedpackage-task", - "version": "4.0.6", + "version": "4.0.7", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/task.json b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/task.json index a766a09da..3bd2b18ab 100644 --- a/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/task.json +++ b/packages/azpipelines/BuildTasks/ValidateDXUnlockedPackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 4, "Minor": 0, - "Patch": 6 + "Patch": 7 }, "instanceNameFormat": "Validates $(package) for MetadataCoverage", "inputs": [ diff --git a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package-lock.json b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package-lock.json index d0751333c..402b2c713 100644 --- a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package-lock.json +++ b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package-lock.json @@ -1,6 +1,6 @@ { "name": "sfpowerscripts-validatetestcoverage-task", - "version": "4.0.7", + "version": "4.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package.json b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package.json index 7b1ce026a..4f650f187 100644 --- a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package.json +++ b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/package.json @@ -1,7 +1,7 @@ { "name": "sfpowerscripts-validatetestcoverage-task", "description": "sfpowerscripts-validatetestcoverage-task", - "version": "4.0.7", + "version": "4.0.8", "private": true, "repository": { "type": "git", @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^0.4.4", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "azure-pipelines-task-lib": "^2.8.0" } } diff --git a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/task.json b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/task.json index 6f0384ee9..91c427cae 100644 --- a/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/task.json +++ b/packages/azpipelines/BuildTasks/ValidateTestCoveragePackageTask/task.json @@ -9,7 +9,7 @@ "version": { "Major": 4, "Minor": 0, - "Patch": 7 + "Patch": 8 }, "runsOn": [ "Agent" diff --git a/packages/azpipelines/package-lock.json b/packages/azpipelines/package-lock.json index d7b1fd1ac..e1d0be450 100644 --- a/packages/azpipelines/package-lock.json +++ b/packages/azpipelines/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dxatscale/sfpowerscripts.azpipelines", - "version": "16.0.1", + "version": "16.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/azpipelines/package.json b/packages/azpipelines/package.json index f603b53a4..11d2d061c 100644 --- a/packages/azpipelines/package.json +++ b/packages/azpipelines/package.json @@ -1,7 +1,7 @@ { "name": "@dxatscale/sfpowerscripts.azpipelines", "private": true, - "version": "16.0.1", + "version": "16.0.2", "description": "CI/CD extensions for Salesforce", "repository": { "type": "git", diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 2f3ceb9ef..cd0ca4dc9 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dxatscale/sfpowerscripts.core", - "version": "1.0.2", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 1c93c286f..a21fb85b8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@dxatscale/sfpowerscripts.core", - "version": "1.0.2", + "version": "1.1.0", "description": "Core Module used by sfpowerscripts", "main": "lib/index", "types": "lib/index", diff --git a/packages/core/src/sfdxwrappers/TriggerApexTestImpl.ts b/packages/core/src/sfdxwrappers/TriggerApexTestImpl.ts index 9a2bebab1..aee1edcec 100644 --- a/packages/core/src/sfdxwrappers/TriggerApexTestImpl.ts +++ b/packages/core/src/sfdxwrappers/TriggerApexTestImpl.ts @@ -6,7 +6,10 @@ let fs = require("fs-extra"); let path = require("path"); export default class TriggerApexTestImpl { - public constructor(private target_org: string, private test_options: any) {} + public constructor( + private target_org: string, + private test_options: any, + ) {} public async exec(): Promise<{ id: string; @@ -84,8 +87,32 @@ export default class TriggerApexTestImpl { test_result.result = false; console.error(output); } else { - test_result.message = `${test_report_json.summary.passing} Tests passed with overall Test Run Coverage of ${test_report_json.summary.testRunCoverage}`; - test_result.result = true; + const classesWithInvalidCoverage: string[] = []; + + if (this.test_options["isValidateCoverage"]) { + let code_coverage = fs.readFileSync( + path.join( + this.test_options["outputdir"], + `test-result-codecoverage.json` + ), + "utf8" + ); + let code_coverage_json = JSON.parse(code_coverage); + + for (let testClass of code_coverage_json) { + if (testClass["coveredPercent"] < this.test_options["coverageThreshold"]) { + classesWithInvalidCoverage.push(testClass["name"]); + } + } + } + + if (classesWithInvalidCoverage.length == 0) { + test_result.message = `${test_report_json.summary.passing} Tests passed with overall Test Run Coverage of ${test_report_json.summary.testRunCoverage}`; + test_result.result = true; + } else { + test_result.message=`The test classes ${classesWithInvalidCoverage.toString()} do not meet the required code coverage of ${this.test_options["coverageThreshold"]}`; + test_result.result = false; + } console.log(output); } diff --git a/packages/sfpowerscripts-cli/messages/trigger_apex_test.json b/packages/sfpowerscripts-cli/messages/trigger_apex_test.json index 7b9a2adec..ac2b0a734 100644 --- a/packages/sfpowerscripts-cli/messages/trigger_apex_test.json +++ b/packages/sfpowerscripts-cli/messages/trigger_apex_test.json @@ -5,5 +5,7 @@ "synchronousFlagDescription": "Select an option if the tests are to be run synchronously", "specifiedTestsFlagDescription": "comma-separated list of Apex test class names or IDs and, if applicable, test methods to run", "apexTestSuiteFlagDescription": "comma-separated list of Apex test suite names to run", + "validateCoverageFlagDescription": "Enable code coverage validation for individual test classes", + "coveragePercentFlagDescription": "Minimum coverage percentage required for each test class", "waitTimeFlagDescription": "wait time for command to finish in minutes" -} \ No newline at end of file +} diff --git a/packages/sfpowerscripts-cli/package-lock.json b/packages/sfpowerscripts-cli/package-lock.json index 13f37cfde..519b7f5c1 100644 --- a/packages/sfpowerscripts-cli/package-lock.json +++ b/packages/sfpowerscripts-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dxatscale/sfpowerscripts", - "version": "0.7.2", + "version": "0.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/sfpowerscripts-cli/package.json b/packages/sfpowerscripts-cli/package.json index 86ba66461..33cd258a3 100644 --- a/packages/sfpowerscripts-cli/package.json +++ b/packages/sfpowerscripts-cli/package.json @@ -1,14 +1,14 @@ { "name": "@dxatscale/sfpowerscripts", "description": "Simple wrappers around sfdx commands to help set up CI/CD quickly", - "version": "0.7.2", + "version": "0.8.0", "author": "dxatscale", "bin": { "readVars": "./scripts/readVars.sh" }, "bugs": "https://github.com/Accenture/sfpowerscripts/issues", "dependencies": { - "@dxatscale/sfpowerscripts.core": "^1.0.2", + "@dxatscale/sfpowerscripts.core": "^1.1.0", "@oclif/command": "^1", "@oclif/config": "^1", "@oclif/errors": "^1", diff --git a/packages/sfpowerscripts-cli/src/commands/sfpowerscripts/TriggerApexTest.ts b/packages/sfpowerscripts-cli/src/commands/sfpowerscripts/TriggerApexTest.ts index c06e6fa90..a9dbc181e 100644 --- a/packages/sfpowerscripts-cli/src/commands/sfpowerscripts/TriggerApexTest.ts +++ b/packages/sfpowerscripts-cli/src/commands/sfpowerscripts/TriggerApexTest.ts @@ -25,6 +25,8 @@ export default class TriggerApexTest extends SfdxCommand { synchronous: flags.boolean({char: 's', description: messages.getMessage('synchronousFlagDescription')}), specifiedtests: flags.string({description: messages.getMessage('specifiedTestsFlagDescription')}), apextestsuite: flags.string({description: messages.getMessage('apexTestSuiteFlagDescription')}), + validatecoverage: flags.boolean({char: 'c', description: messages.getMessage('validateCoverageFlagDescription')}), + coveragepercent: flags.integer({char: 'p', description: messages.getMessage('coveragePercentFlagDescription'), dependsOn: ['validatecoverage'], default: 75}), waittime: flags.string({description: messages.getMessage('waitTimeFlagDescription'), default: '60'}) }; @@ -38,6 +40,8 @@ export default class TriggerApexTest extends SfdxCommand { test_options["wait_time"] = this.flags.waittime; test_options["testlevel"] = this.flags.testlevel; test_options["synchronous"] = this.flags.synchronous; + test_options["isValidateCoverage"] = this.flags.validatecoverage; + test_options["coverageThreshold"] = this.flags.coveragepercent; if (test_options["testlevel"] == "RunSpecifiedTests") test_options["specified_tests"] = this.flags.specifiedtests; @@ -63,7 +67,7 @@ export default class TriggerApexTest extends SfdxCommand { } } catch(err) { // AppInsights.trackExcepiton("sfpwowerscript-triggerapextest-task",err); - console.log(err); + console.error(err); // Fail the task when an error occurs process.exit(1); }