Skip to content

Commit 11b281f

Browse files
authored
Merge branch 'zowe-v2-lts' into v2/port-misc-fixes
2 parents 7d8781d + 08e02ce commit 11b281f

File tree

59 files changed

+404
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+404
-159
lines changed

__tests__/__resources__/properties/default_properties.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ zosjobs:
104104
modifiedJobclass: B
105105
# System affinity
106106
sysaff: zosjobs-sysaff
107+
# CIM Support
108+
skipCIM: false
107109
#-----------------------------------------------------------------------------#
108110
# Set of properties for testing provisioning #
109111
#-----------------------------------------------------------------------------#

__tests__/__src__/properties/ITestZosJobsSchema.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export interface ITestZosJobsSchema {
1616
jobclass: string;
1717
modifiedJobclass: string;
1818
sysaff: string;
19+
skipCIM?: boolean;
1920
}

jest.config.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,11 @@ module.exports = {
133133
...projectConfig,
134134
"reporters": [
135135
"default",
136+
"jest-stare",
136137
["jest-junit", {
137138
"outputDirectory": "__tests__/__results__",
138139
"reportTestSuiteErrors": true
139140
}],
140-
["jest-stare", {
141-
"coverageLink": "../unit/coverage/lcov-report/index.html",
142-
"resultDir": "__tests__/__results__/jest-stare"
143-
}],
144141
["github-actions", { "silent": false } ]
145142
],
146143
"testResultsProcessor": "jest-sonar-reporter",

npm-shrinkwrap.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"prepare": "husky install && npm run bundle:webHelp",
4242
"package": "lerna run prepublishOnly && node scripts/bundleCliTgz.js"
4343
},
44-
"dependencies": {},
4544
"devDependencies": {
4645
"@lerna-lite/changed": "^3.3.0",
4746
"@lerna-lite/cli": "^3.3.0",
@@ -69,7 +68,7 @@
6968
"jest-html-reporter": "^3.6.0",
7069
"jest-junit": "^12.0.0",
7170
"jest-sonar-reporter": "^2.0.0",
72-
"jest-stare": "^2.2.0",
71+
"jest-stare": "^2.5.2",
7372
"js-yaml": "^4.1.0",
7473
"jsonfile": "^4.0.0",
7574
"madge": "^4.0.1",
@@ -85,5 +84,13 @@
8584
},
8685
"jestSonar": {
8786
"reportPath": "__tests__/__results__/jest-sonar"
87+
},
88+
"jest-stare": {
89+
"additionalResultsProcessors": [
90+
"jest-junit",
91+
"jest-sonar-reporter"
92+
],
93+
"coverageLink": "../unit/coverage/lcov-report/index.html",
94+
"resultDir": "__tests__/__results__/jest-stare"
8895
}
8996
}

packages/cli/__tests__/auth/__system__/__scripts__/auth_login_apiml_show_token.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
HOST=$1

packages/cli/__tests__/auth/__system__/__scripts__/auth_login_apiml_show_token_rfj.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
HOST=$1

packages/cli/__tests__/auth/__system__/__scripts__/auth_logout_apiml_show_token.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
HOST=$1

packages/cli/__tests__/config/auto-init/__system__/__scripts__/config_auto_init.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
HOST=$1

packages/cli/__tests__/config/auto-init/__system__/__scripts__/config_auto_init_cert.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
HOST=$1

packages/cli/__tests__/config/auto-init/__system__/__scripts__/config_auto_init_profile.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23

34
zowe config auto-init

packages/cli/__tests__/config/auto-init/__system__/cli.config.auto-init.system.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe("config auto-init without profile", () => {
4545
base.rejectUnauthorized
4646
]
4747
);
48+
expect(response.status).toEqual(0);
4849

4950
const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
5051
const profiles = JSONC.parse(config).profiles;
@@ -105,6 +106,7 @@ describe("config auto-init without profile", () => {
105106
base.rejectUnauthorized
106107
]
107108
);
109+
expect(response.status).toEqual(0);
108110

109111
config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
110112
const profiles = JSONC.parse(config).profiles;
@@ -183,6 +185,7 @@ describe("config auto-init without profile and with certificates", () => {
183185
base.rejectUnauthorized
184186
]
185187
);
188+
expect(response.status).toEqual(0);
186189

187190
const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
188191
const profiles = JSONC.parse(config).profiles;
@@ -249,6 +252,7 @@ describe("config auto-init without profile and with certificates", () => {
249252
base.rejectUnauthorized
250253
]
251254
);
255+
expect(response.status).toEqual(0);
252256

253257
config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
254258
const profiles = JSONC.parse(config).profiles;
@@ -313,7 +317,7 @@ describe("config auto-init with profile", () => {
313317

314318
it("should successfully issue the auto-init command", () => {
315319
const response = runCliScript(__dirname + "/__scripts__/config_auto_init_profile.sh", TEST_ENVIRONMENT);
316-
320+
expect(response.status).toEqual(0);
317321
const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
318322
const profiles = JSONC.parse(config).profiles;
319323
let zosmfExists = false;
@@ -372,7 +376,7 @@ describe("config auto-init with profile and certificates", () => {
372376

373377
it("should successfully issue the auto-init command", () => {
374378
const response = runCliScript(__dirname + "/__scripts__/config_auto_init_profile.sh", TEST_ENVIRONMENT);
375-
379+
expect(response.status).toEqual(0);
376380
const config = fs.readFileSync(path.join(TEST_ENVIRONMENT.workingDir, "zowe.config.json")).toString();
377381
const profiles = JSONC.parse(config).profiles;
378382
let zosmfExists = false;

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job.sh

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ then
1616
exit $RC
1717
fi
1818

19+
sleep 1
20+
1921
# Cancel the job
2022
zowe jobs cancel job $JOBID
2123
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job_fully_qualified.sh

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ then
2222
exit $RC
2323
fi
2424

25+
sleep 1
26+
2527
# Cancel the job
2628
zowe jobs cancel job $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false
2729
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job_v1.sh

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ then
1616
exit $RC
1717
fi
1818

19+
sleep 1
20+
1921
# Cancel the job 1
2022
zowe jobs cancel job $JOBID --modify-version 1.0
2123
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job_v2.sh

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ then
1616
exit $RC
1717
fi
1818

19+
sleep 1
20+
1921
# Cancel the job 1
2022
zowe jobs cancel job $JOBID --modify-version 2.0
2123
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job_v2_bad.sh

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ then
1616
exit $RC
1717
fi
1818

19+
sleep 1
20+
1921
# Cancel the job 1
2022
zowe jobs cancel job $JOBID --modify-version 2.0
2123
RC=$?
@@ -26,6 +28,8 @@ then
2628
exit $RC
2729
fi
2830

31+
sleep 1
32+
2933
# Cancel the job 2
3034
zowe jobs cancel job $JOBID --modify-version 2.0
3135
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/__scripts__/job/cancel_job_v2_fully_qualified.sh

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ then
2222
exit $RC
2323
fi
2424

25+
sleep 1
26+
2527
# Cancel the job
2628
zowe jobs cancel job $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --modify-version 2.0
2729
RC=$?

packages/cli/__tests__/zosjobs/__system__/cancel/cli.zos-jobs.cancel.job.system.test.ts

+46-16
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ import { TestEnvironment } from "../../../../../../__tests__/__src__/environment
1414
import { ITestPropertiesSchema } from "../../../../../../__tests__/__src__/properties/ITestPropertiesSchema";
1515
import { JobTestsUtils } from "../../../../../zosjobs/__tests__/__system__/JobTestsUtils";
1616
import { IO } from "@zowe/imperative";
17+
import { DeleteJobs, IJob } from "@zowe/zos-jobs-for-zowe-sdk";
18+
import { Session } from "@zowe/imperative";
1719

1820
// Test Environment populated in the beforeAll();
21+
let REAL_SESSION: Session;
1922
let TEST_ENVIRONMENT: ITestEnvironment<ITestPropertiesSchema>;
2023
const LOCAL_JCL_FILE: string = __dirname + "/" + "testFileOfLocalJCL.txt";
24+
const jobsToDelete = new Map<string, string>();
25+
const jobDataRegexV1 = /Successfully submitted request to cancel job (\w+) \((JOB\d+)\)/;
26+
const jobNameRegexV1 = /job (\w+)/i;
2127

2228
describe("zos-jobs cancel job command", () => {
2329
// Create the unique test environment
@@ -28,6 +34,8 @@ describe("zos-jobs cancel job command", () => {
2834
});
2935
const systemProps = TEST_ENVIRONMENT.systemTestProperties;
3036

37+
REAL_SESSION = TestEnvironment.createZosmfSession(TEST_ENVIRONMENT);
38+
3139
const jcl = JobTestsUtils.getSleepJCL(systemProps.zosmf.user, systemProps.tso.account, systemProps.zosjobs.jobclass);
3240
const bufferJCL: Buffer = Buffer.from(jcl);
3341
IO.createFileSync(LOCAL_JCL_FILE);
@@ -36,6 +44,9 @@ describe("zos-jobs cancel job command", () => {
3644

3745
afterAll(async () => {
3846
IO.deleteFile(LOCAL_JCL_FILE);
47+
for (const [jobname, jobid] of jobsToDelete) {
48+
await DeleteJobs.deleteJob(REAL_SESSION, jobname, jobid);
49+
}
3950
});
4051

4152
describe("error handling", () => {
@@ -67,10 +78,20 @@ describe("zos-jobs cancel job command", () => {
6778

6879
describe("successful scenario", () => {
6980
it("should cancel a job v1", () => {
70-
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
71-
expect(response.stderr.toString()).toBe("");
72-
expect(response.status).toBe(0);
73-
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");
81+
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM) {
82+
process.stdout.write("Skipping test because skipCIM is set.");
83+
} else {
84+
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1.sh", TEST_ENVIRONMENT, [LOCAL_JCL_FILE]);
85+
86+
expect(response.stderr.toString()).toBe("");
87+
expect(response.status).toBe(0);
88+
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");
89+
90+
const jobname = response.stdout.toString().match(jobNameRegexV1).pop();
91+
const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
92+
93+
jobsToDelete.set(jobname, jobid);
94+
}
7495
});
7596

7697
it("should cancel a job v2", () => {
@@ -108,18 +129,27 @@ describe("zos-jobs cancel job command", () => {
108129
});
109130

110131
it("cancel a job without a profile 1.0", async () => {
111-
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1_fully_qualified.sh",
112-
TEST_ENVIRONMENT_NO_PROF,
113-
[
114-
LOCAL_JCL_FILE,
115-
DEFAULT_SYSTEM_PROPS.zosmf.host,
116-
DEFAULT_SYSTEM_PROPS.zosmf.port,
117-
DEFAULT_SYSTEM_PROPS.zosmf.user,
118-
DEFAULT_SYSTEM_PROPS.zosmf.password,
119-
]);
120-
expect(response.stderr.toString()).toBe("");
121-
expect(response.status).toBe(0);
122-
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");
132+
if (TEST_ENVIRONMENT.systemTestProperties.zosjobs.skipCIM) {
133+
process.stdout.write("Skipping test because skipCIM is set.");
134+
} else {
135+
const response = runCliScript(__dirname + "/__scripts__/job/cancel_job_v1_fully_qualified.sh",
136+
TEST_ENVIRONMENT_NO_PROF,
137+
[
138+
LOCAL_JCL_FILE,
139+
DEFAULT_SYSTEM_PROPS.zosmf.host,
140+
DEFAULT_SYSTEM_PROPS.zosmf.port,
141+
DEFAULT_SYSTEM_PROPS.zosmf.user,
142+
DEFAULT_SYSTEM_PROPS.zosmf.password,
143+
]);
144+
expect(response.stderr.toString()).toBe("");
145+
expect(response.status).toBe(0);
146+
expect(response.stdout.toString()).toContain("Successfully submitted request to cancel job");
147+
148+
const jobname = response.stdout.toString().match(jobNameRegexV1).pop();
149+
const jobid = response.stdout.toString().match(jobDataRegexV1).pop();
150+
151+
jobsToDelete.set(jobname, jobid);
152+
}
123153
});
124154

125155
it("cancel a job without a profile 2.0", async () => {

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ then
1717
fi
1818

1919
# Loop until the job goes to the output queue
20-
until [ $ATTEMPTS -gt 0 ]
20+
until [ $ATTEMPTS -lt 1 ]
2121
do
2222
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
2323
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job_fully_qualified.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ then
2323
fi
2424

2525
# Loop until the job goes to the output queue
26-
until [ $ATTEMPTS -gt 0 ]
26+
until [ $ATTEMPTS -lt 1 ]
2727
do
2828
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
2929
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job_v1.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ then
1717
fi
1818

1919
# Loop until the job goes to the output queue
20-
until [ $ATTEMPTS -gt 0 ]
20+
until [ $ATTEMPTS -lt 1 ]
2121
do
2222
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
2323
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job_v1_fully_qualified.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ then
2323
fi
2424

2525
# Loop until the job goes to the output queue
26-
until [ $ATTEMPTS -gt 0 ]
26+
until [ $ATTEMPTS -lt 1 ]
2727
do
2828
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
2929
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job_v2.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ then
1717
fi
1818

1919
# Loop until the job goes to the output queue
20-
until [ $ATTEMPTS -gt 0 ]
20+
until [ $ATTEMPTS -lt 1 ]
2121
do
2222
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
2323
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/job/delete_job_v2_fully_qualified.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ then
2323
fi
2424

2525
# Loop until the job goes to the output queue
26-
until [ $ATTEMPTS -gt 0 ]
26+
until [ $ATTEMPTS -lt 1 ]
2727
do
2828
STATUS=`zowe jobs view job-status-by-jobid $JOBID --host $HOST --port $PORT --user $USER --password $PASS --ru=false --rff status --rft string`
2929
RC=$?

packages/cli/__tests__/zosjobs/__system__/delete/__scripts__/old-jobs/delete_old_jobs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ then
1818
fi
1919

2020
# Loop until the job goes to the output queue
21-
until [ $ATTEMPTS -gt 0 ]
21+
until [ $ATTEMPTS -lt 1 ]
2222
do
2323
STATUS=`zowe jobs view job-status-by-jobid $JOBID --rff status --rft string`
2424
RC=$?

0 commit comments

Comments
 (0)