Skip to content

Commit 3d815cc

Browse files
committed
display JESMSGLG if SYSTSPRT not found
1 parent f7c9a85 commit 3d815cc

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

__tests__/api/BundleDeploy/BundleDeployer.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ describe("BundleDeployer01", () => {
133133
expect(listSpy).toHaveBeenCalledTimes(2);
134134
expect(submitSpy).toHaveBeenCalledTimes(1);
135135
});
136+
it("should failover to JESMSGLG if SYSTSPRT not found", async () => {
137+
138+
const createSpy = jest.spyOn(ZosmfSession, "createBasicZosmfSession").mockImplementationOnce(() => ({}));
139+
const listSpy = jest.spyOn(List, "allMembers").mockImplementationOnce(() => ( { val: "DFHDPLOY" }))
140+
.mockImplementationOnce(() => ( { val: "EYU9ABSI" }));
141+
const submitSpy = jest.spyOn(SubmitJobs, "submitJclString").mockImplementationOnce(() =>
142+
[{ddName: "JESMSGLG", stepName: "DFHDPLOY"}] );
143+
await runDeployTestWithError();
144+
145+
expect(createSpy).toHaveBeenCalledTimes(1);
146+
expect(listSpy).toHaveBeenCalledTimes(2);
147+
expect(submitSpy).toHaveBeenCalledTimes(1);
148+
});
136149
it("should tolerate empty output from DFHDPLOY", async () => {
137150

138151
const createSpy = jest.spyOn(ZosmfSession, "createBasicZosmfSession").mockImplementationOnce(() => ({}));

__tests__/api/BundleDeploy/__snapshots__/BundleDeployer.test.ts.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`BundleDeployer01 should complain if DFHDPLOY ends with an error 1`] = `
44

55
exports[`BundleDeployer01 should complain if DFHDPLOY ends with an error 2`] = `"DFHDPLOY stopped processing due to an error."`;
66

7-
exports[`BundleDeployer01 should complain if SYSTSPRT not found 1`] = `"SYSTSPRT output from DFHDPLOY not found. Most recent status update: 'Submitting DFHDPLOY JCL for the DEPLOY action'."`;
7+
exports[`BundleDeployer01 should complain if SYSTSPRT not found 1`] = `"SYSTSPRT and JESMSGLG output from DFHDPLOY not found. Most recent status update: 'Submitting DFHDPLOY JCL for the DEPLOY action'."`;
88

99
exports[`BundleDeployer01 should complain if cicshlq not found 1`] = `"Validation of --cicshlq dataset failed: Injected CICSHLQ error"`;
1010

@@ -30,6 +30,10 @@ exports[`BundleDeployer01 should deploy successfully 1`] = `"Bundle deployment s
3030

3131
exports[`BundleDeployer01 should fail with overlong jobcard 1`] = `"--jobcard parameter section cannot be split into 72 character lines: '// 73CHARS=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1'."`;
3232

33+
exports[`BundleDeployer01 should failover to JESMSGLG if SYSTSPRT not found 1`] = `"undefined"`;
34+
35+
exports[`BundleDeployer01 should failover to JESMSGLG if SYSTSPRT not found 2`] = `"DFHDPLOY command completed in error without generating SYSTSPRT output."`;
36+
3337
exports[`BundleDeployer01 should generate deploy JCL for AVAILABLE 1`] = `
3438
"//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT
3539
//DFHDPLOY EXEC PGM=DFHDPLOY,REGION=100M

__tests__/api/BundlePush/BundlePusher.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ const DEFAULT_PARAMTERS: IHandlerParameters = {
4848
progress: {
4949
startBar: jest.fn((parms) => undefined),
5050
endBar: jest.fn(() => undefined)
51-
},
52-
consoleText: ""
51+
}
5352
} as any,
5453
definition: PushBundleDefinition.PushBundleDefinition,
5554
fullDefinition: PushBundleDefinition.PushBundleDefinition,

src/api/BundleDeploy/BundleDeployer.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,17 @@ export class BundleDeployer {
343343
}
344344
}
345345

346+
// If we haven't found SYSTSPRT then echo JESMSGLG instead
347+
for (const file of spoolOutput) {
348+
if (file.ddName === "JESMSGLG") {
349+
status.stageName = TaskStage.FAILED;
350+
// log the error output to the console
351+
this.params.response.console.log(file.data);
352+
throw new Error("DFHDPLOY command completed in error without generating SYSTSPRT output.");
353+
}
354+
}
355+
346356
status.stageName = TaskStage.FAILED;
347-
throw new Error("SYSTSPRT output from DFHDPLOY not found. Most recent status update: '" + status.statusMessage + "'.");
357+
throw new Error("SYSTSPRT and JESMSGLG output from DFHDPLOY not found. Most recent status update: '" + status.statusMessage + "'.");
348358
}
349359
}

0 commit comments

Comments
 (0)