diff --git a/packages/sfpowerscripts-cli/src/impl/validate/ValidateImpl.ts b/packages/sfpowerscripts-cli/src/impl/validate/ValidateImpl.ts index 15a0aaee2..b4dc4c009 100644 --- a/packages/sfpowerscripts-cli/src/impl/validate/ValidateImpl.ts +++ b/packages/sfpowerscripts-cli/src/impl/validate/ValidateImpl.ts @@ -52,6 +52,7 @@ import ReleaseConfig from "../release/ReleaseConfig"; import { mapInstalledArtifactstoPkgAndCommits } from "../../utils/FetchArtifactsFromOrg"; import { ApexTestValidator } from "./ApexTestValidator"; import OrgInfoDisplayer from "../../ui/OrgInfoDisplayer"; +import FileOutputHandler from "../../outputs/FileOutputHandler"; export enum ValidateAgainst { @@ -707,6 +708,14 @@ export default class ValidateImpl implements PostDeployHook, PreDeployHook { //Get Changed Components const apextestValidator = new ApexTestValidator(targetUsername, sfpPackage, this.props, this.logger); const testResult = await apextestValidator.validateApexTests(); + + if (!testResult.result) { + FileOutputHandler.getInstance().writeOutput(`validation-error.md`,`### 💣 Validation Failed 💣`); + FileOutputHandler.getInstance().appendOutput(`validation-error.md`,`Package validation failed for **${sfpPackage.packageName}**`); + FileOutputHandler.getInstance().appendOutput(`validation-error.md`,`Reasons:`); + FileOutputHandler.getInstance().appendOutput(`validation-error.md`,`${testResult.message}`); + } + return { isToFailDeployment: !testResult.result, message: testResult.message,