@@ -1141,7 +1141,7 @@ describe("BundlePusher01", () => {
1141
1141
it ( "should generate diagnostics even if deploy fails" , async ( ) => {
1142
1142
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" } ;
1143
1143
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1144
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I" } ] ) ;
1144
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I DFHRL2067W " } ] ) ;
1145
1145
readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1146
1146
if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1147
1147
return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
@@ -1492,6 +1492,55 @@ describe("BundlePusher01", () => {
1492
1492
expect ( uploadSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1493
1493
expect ( cmciSpy ) . toHaveBeenCalledTimes ( 2 ) ;
1494
1494
} ) ;
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
+ } ) ;
1495
1544
} ) ;
1496
1545
1497
1546
async function runPushTestWithError ( localBundleDir : string , overwrite : boolean , errorText : string , parmsIn ?: IHandlerParameters ) {
0 commit comments