Skip to content

Commit 32b9fc9

Browse files
authored
Merge branch 'dev' into master
2 parents f55cfd8 + d2b4c9b commit 32b9fc9

File tree

3 files changed

+66
-4
lines changed

3 files changed

+66
-4
lines changed

__tests__/api/BundlePush/BundlePusher.test.ts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ describe("BundlePusher01", () => {
11411141
it("should generate diagnostics even if deploy fails", async () => {
11421142
cicsProfile = { host: "wibble", user: "user", password: "thisIsntReal" };
11431143
submitSpy = jest.spyOn(SubmitJobs, "submitJclString").mockImplementation(() =>
1144-
[{ddName: "SYSTSPRT", stepName: "DFHDPLOY", data: "DFHRL2055I"}] );
1144+
[{ddName: "SYSTSPRT", stepName: "DFHDPLOY", data: "DFHRL2055I DFHRL2067W"}] );
11451145
readSpy = jest.spyOn(fs, "readFileSync").mockImplementation((data: string) => {
11461146
if (data.indexOf("cics.xml") > -1) {
11471147
return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
@@ -1492,6 +1492,55 @@ describe("BundlePusher01", () => {
14921492
expect(uploadSpy).toHaveBeenCalledTimes(1);
14931493
expect(cmciSpy).toHaveBeenCalledTimes(2);
14941494
});
1495+
1496+
it("should not attempt to generate diagnostics for NODEJSAPPs if bundle does not install", async () => {
1497+
readSpy = jest.spyOn(fs, "readFileSync").mockImplementation((data: string) => {
1498+
if (data.indexOf("cics.xml") > -1) {
1499+
return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1500+
"<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1501+
"</manifest>";
1502+
}
1503+
});
1504+
submitSpy = jest.spyOn(SubmitJobs, "submitJclString").mockImplementation(() =>
1505+
[{ddName: "SYSTSPRT", stepName: "DFHDPLOY", data: "DFHRL2055I"}] );
1506+
cicsProfile = { host: "wibble", user: "user", password: "thisIsntReal", cicsPlex: "12345678", regionName: "12345678" };
1507+
cmciSpy.mockImplementation((cicsSession: any, nodejsData: cmci.IResourceParms) => {
1508+
if (nodejsData.name === "CICSRegion") {
1509+
return { response: {
1510+
records: {
1511+
cicsregion: {
1512+
applid: "ABCDEFG", jobid: "JOB12345", jobname: "MYCICS"
1513+
}
1514+
}
1515+
}
1516+
};
1517+
} else if (nodejsData.name === "CICSNodejsapp") {
1518+
return { response: {
1519+
records: {
1520+
cicsnodejsapp: [{
1521+
name: "name", pid: "22", enablestatus: "ENABLED", stderr: "/tmp/stderr", stdout: "/tmp/stdout", eyu_cicsname: "1"
1522+
}]
1523+
}
1524+
}
1525+
};
1526+
} else {
1527+
return {};
1528+
}
1529+
});
1530+
1531+
const parms = getCommonParmsForPushTests();
1532+
1533+
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", false,
1534+
"DFHDPLOY stopped processing for jobid UNKNOWN due to an error.", parms);
1535+
1536+
expect(consoleText).toContain("Gathering scope information");
1537+
expect(consoleText).toContain("Querying regions in scope over CMCI");
1538+
expect(consoleText).not.toContain("Querying NODEJSAPP resources over CMCI");
1539+
expect(consoleText).not.toContain("zowe cics get resource CICSNodejsapp");
1540+
expect(consoleText).not.toContain("An attempt to query the remote CICSplex using the cics plug-in has failed");
1541+
expect(consoleText).toContain("DFHDPLOY output implied the bundle failed to install.");
1542+
expect(cmciSpy).toHaveBeenCalledTimes(1);
1543+
});
14951544
});
14961545

14971546
async function runPushTestWithError(localBundleDir: string, overwrite: boolean, errorText: string, parmsIn?: IHandlerParameters) {

docs/pages/cdp/cdp-Installing.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ toc: false
2121
2. Install [Zowe CLI](https://zowe.github.io/docs-site/latest/user-guide/cli-installcli.html). For example, to install using npm:
2222

2323
```console
24-
sudo npm install -g @zowe/cli
24+
npm install -g @zowe/cli@latest
2525
```
2626

2727
3. Build and install the cics-deploy plug-in as described in [Setting up your development environment](https://github.com/IBM/zowe-cli-cics-deploy-plugin/blob/master/docs-internal/tutorials/Setup.md). For example:
@@ -36,8 +36,13 @@ toc: false
3636
npm run build
3737
zowe plugins install .
3838
```
39+
4. Install the cics plugin:
3940

40-
4. Verify the plug-in is installed:
41+
```console
42+
zowe plugins install @zowe/cics
43+
```
44+
45+
5. Verify the plug-ins are installed:
4146

4247
```console
4348
zowe plugins list

src/api/BundlePush/BundlePusher.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,15 @@ export class BundlePusher {
391391

392392
// Collect general information about the regions in the CICSplex scope
393393
let deployMessages = await this.generateGeneralDiagnostics(cicsSession);
394-
if (deployMessages !== "" && bundle.containsDefinitionsOfType("http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP")) {
394+
395+
if (deployError !== undefined && dfhdployOutput.indexOf("DFHRL2067") === -1) {
396+
// If we have an error, but DFHDPLOY did not report that some bundleparts are disabled,
397+
// we can assume bundle didn't install at all. In this case skip generation of
398+
// Node.js diagnostics.
399+
deployMessages += "DFHDPLOY output implied the bundle failed to install. Check the output above for further information. ";
400+
deployMessages += "Consider examining the JESMSGLG, MSGUSR, SYSPRINT and SYSOUT spool files of the CICS region job, ";
401+
deployMessages += "or consult your CICS system programmer.\n";
402+
} else if (deployMessages !== "" && bundle.containsDefinitionsOfType("http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP")) {
395403
// Generate additional diagnostic output for Node.js
396404
deployMessages += await this.generateNodejsSpecificDiagnostics(cicsSession);
397405
}

0 commit comments

Comments
 (0)