@@ -1302,7 +1302,7 @@ describe("BundlePusher01", () => {
1302
1302
it ( "should generate diagnostics even if deploy fails" , async ( ) => {
1303
1303
cicsProfile = { host : "wibble" , port : 443 , user : "user" , password : "thisIsntReal" } ;
1304
1304
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1305
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I" } ] ) ;
1305
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I DFHRL2067W " } ] ) ;
1306
1306
readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1307
1307
if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1308
1308
return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
@@ -1653,6 +1653,55 @@ describe("BundlePusher01", () => {
1653
1653
expect ( uploadSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1654
1654
expect ( cmciSpy ) . toHaveBeenCalledTimes ( 2 ) ;
1655
1655
} ) ;
1656
+
1657
+ it ( "should not attempt to generate diagnostics for NODEJSAPPs if bundle does not install" , async ( ) => {
1658
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1659
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1660
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1661
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1662
+ "</manifest>" ;
1663
+ }
1664
+ } ) ;
1665
+ submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1666
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I" } ] ) ;
1667
+ cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1668
+ cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1669
+ if ( nodejsData . name === "CICSRegion" ) {
1670
+ return { response : {
1671
+ records : {
1672
+ cicsregion : {
1673
+ applid : "ABCDEFG" , jobid : "JOB12345" , jobname : "MYCICS"
1674
+ }
1675
+ }
1676
+ }
1677
+ } ;
1678
+ } else if ( nodejsData . name === "CICSNodejsapp" ) {
1679
+ return { response : {
1680
+ records : {
1681
+ cicsnodejsapp : [ {
1682
+ name : "name" , pid : "22" , enablestatus : "ENABLED" , stderr : "/tmp/stderr" , stdout : "/tmp/stdout" , eyu_cicsname : "1"
1683
+ } ]
1684
+ }
1685
+ }
1686
+ } ;
1687
+ } else {
1688
+ return { } ;
1689
+ }
1690
+ } ) ;
1691
+
1692
+ const parms = getCommonParmsForPushTests ( ) ;
1693
+
1694
+ await runPushTestWithError ( "__tests__/__resources__/ExampleBundle01" , false ,
1695
+ "DFHDPLOY stopped processing for jobid UNKNOWN due to an error." , parms ) ;
1696
+
1697
+ expect ( consoleText ) . toContain ( "Gathering scope information" ) ;
1698
+ expect ( consoleText ) . toContain ( "Querying regions in scope over CMCI" ) ;
1699
+ expect ( consoleText ) . not . toContain ( "Querying NODEJSAPP resources over CMCI" ) ;
1700
+ expect ( consoleText ) . not . toContain ( "zowe cics get resource CICSNodejsapp" ) ;
1701
+ expect ( consoleText ) . not . toContain ( "An attempt to query the remote CICSplex using the cics plug-in has failed" ) ;
1702
+ expect ( consoleText ) . toContain ( "DFHDPLOY output implied the bundle failed to install." ) ;
1703
+ expect ( cmciSpy ) . toHaveBeenCalledTimes ( 1 ) ;
1704
+ } ) ;
1656
1705
} ) ;
1657
1706
1658
1707
async function runPushTestWithError ( localBundleDir : string , overwrite : boolean , errorText : string , parmsIn ?: IHandlerParameters ) {
0 commit comments