Skip to content

Commit

Permalink
Fix more items
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew W. Harn <andrew.harn@broadcom.com>
  • Loading branch information
awharn committed Feb 18, 2025
1 parent 714fc81 commit c0247b4
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe("DaemonDecider tests", () => {

const envWinPipeName = "MyWinPipeName";
const envDaemonDir = path.normalize("./testOutput/daemonDir");
let expectedCommChannel: string = "NotAssignedYet";
let expectedCommChannel: string;

if (process.platform === "win32") {
process.env.ZOWE_DAEMON_PIPE = envWinPipeName;
Expand Down Expand Up @@ -238,7 +238,7 @@ describe("DaemonDecider tests", () => {
const daemonDecider = new DaemonDecider(["node", "zowe", "--daemon"]);
daemonDecider.init();

let expectedCommChannel: string = "NotAssignedYet";
let expectedCommChannel: string;
if (process.platform === "win32") {
expectedCommChannel = `\\\\.\\pipe\\${os.userInfo().username}\\ZoweDaemon`;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("Delete Data Set", () => {
});

it("should delete a data set", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
TEST_ENVIRONMENT, [dsname]);

const ZOWE_OPT_BASE_PATH = "ZOWE_OPT_BASE_PATH";
Expand All @@ -69,7 +69,7 @@ describe("Delete Data Set", () => {
TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = defaultSys.zosmf.basePath;
}

response = runCliScript(__dirname + "/__scripts__/command/command_delete_ds_fully_qualified.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_ds_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF, [dsname, "--for-sure",
defaultSys.zosmf.host,
defaultSys.zosmf.port,
Expand All @@ -84,43 +84,43 @@ describe("Delete Data Set", () => {
describe("Success scenarios", () => {

it("should delete a data set", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
TEST_ENVIRONMENT, [dsname]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should delete a data set with response timeout", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--responseTimeout 5"]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--responseTimeout 5 --for-sure"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should delete a partitioned data set and print attributes", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
TEST_ENVIRONMENT, [dsname]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure", "--rfj"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should delete a partitioned data set member", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh",
TEST_ENVIRONMENT, [dsname]);
const dsnameWithMember = dsname + "(TESTMEM)";
const fileLocation = __dirname + "/__scripts__/command/file.txt";
response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set_member.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_data_set_member.sh",
TEST_ENVIRONMENT, [dsnameWithMember, fileLocation]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh",
TEST_ENVIRONMENT, [dsnameWithMember, "--for-sure", "--rfj"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("Delete VSAM Data Set", () => {
});

it("should delete a data set", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);

const ZOWE_OPT_BASE_PATH = "ZOWE_OPT_BASE_PATH";
Expand All @@ -70,7 +70,7 @@ describe("Delete VSAM Data Set", () => {
TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = systemProps.zosmf.basePath;
}

response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set_fully_qualified.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF, [dsname, "--for-sure",
systemProps.zosmf.host,
systemProps.zosmf.port,
Expand All @@ -85,38 +85,38 @@ describe("Delete VSAM Data Set", () => {
describe("Success scenarios", () => {

it("should delete a VSAM data set", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should delete a VSAM data set with response timeout", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure", "--responseTimeout 5"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should delete a VSAM data set And print attributes", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure", "--rfj"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
});

it("should delete a VSAM data set that has a retention period", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);
response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure", "--purge"]);
expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
Expand Down Expand Up @@ -162,10 +162,10 @@ describe("Delete VSAM Data Set", () => {
});

it("should fail due to retention period not being exceeded", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh",
runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh",
TEST_ENVIRONMENT, [dsname, volume]);
// delete without --purge should fail
response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
let response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh",
TEST_ENVIRONMENT, [dsname, "--for-sure"]);
expect(response.status).toBe(1);
expect(stripNewLines(response.stderr.toString())).toContain("IDC3023I UNEXPIRED PURGE DATE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ describe("Delete z/OS File System", () => {
TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = defaultSys.zosmf.basePath;
}

let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs_fully_qualified.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_zfs_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF, [fsname, volume,
defaultSys.zosmf.host,
defaultSys.zosmf.port,
defaultSys.zosmf.user,
defaultSys.zosmf.password]);

response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs_fully_qualified.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs_fully_qualified.sh",
TEST_ENVIRONMENT_NO_PROF, [fsname, "--for-sure",
defaultSys.zosmf.host,
defaultSys.zosmf.port,
Expand All @@ -89,10 +89,10 @@ describe("Delete z/OS File System", () => {

describe("Success scenarios", () => {
it("should delete a ZFS", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh",
TEST_ENVIRONMENT, [fsname, volume]);

response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh",
TEST_ENVIRONMENT, [fsname, "--for-sure"]);

expect(response.stderr.toString()).toBe("");
Expand All @@ -101,10 +101,10 @@ describe("Delete z/OS File System", () => {
});

it("should delete a ZFS with response timeout", async () => {
let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh",
runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh",
TEST_ENVIRONMENT, [fsname, volume, "--responseTimeout 5"]);

response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh",
const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh",
TEST_ENVIRONMENT, [fsname, "--for-sure", "--responseTimeout 5"]);

expect(response.stderr.toString()).toBe("");
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/workflows/archive/Archive.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class ArchiveHandler extends ZosmfBaseHandler {
const failedWfs: IWorkflowsInfo[] = [];
for(const element of getWfKey.workflows){
try {
resp = await ArchiveWorkflow.archiveWorkflowByKey(this.mSession, element.workflowKey);
await ArchiveWorkflow.archiveWorkflowByKey(this.mSession, element.workflowKey);
successWfs.push(element);
} catch (err) {
failedWfs.push(element);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/workflows/create/Create.common.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class CreateCommonHandler extends ZosmfBaseHandler {
);
if (wfKey) {
try {
resp = await DeleteWorkflow.deleteWorkflow(
await DeleteWorkflow.deleteWorkflow(

Check warning on line 62 in packages/cli/src/workflows/create/Create.common.handler.ts

View check run for this annotation

Codecov / codecov/patch

packages/cli/src/workflows/create/Create.common.handler.ts#L62

Added line #L62 was not covered by tests
this.mSession,
wfKey
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ describe("Using a Plugin", () => {

// install the override plugin
let cmd = `plugins install ${overridePluginDir}`;
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
T.executeTestCLICommand(cliBin, this, cmd.split(" "));

// confirm the plugin summary is displayed from zowe help
const pluginGrpNm = "override-plugin";
cmd = ``;
result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
expect(result.stderr).toBe("");
expect(result.stdout).toContain(pluginGrpNm);
expect(result.stdout).toContain("imperative override plugin pluginSummary");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ export class PluginManagementFacility {
): void {
for (const pluginCmdDef of pluginCmdDefs) {
// check for name property
let pluginCmdName: string = "NotYetAssigned";
let pluginCmdName: string;
if (Object.prototype.hasOwnProperty.call(pluginCmdDef, "name")) {
pluginCmdName = pluginCmdDef.name + " (at depth = " + cmdTreeDepth + ")";
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/imperative/src/operations/src/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export abstract class Operation<T> implements ITaskWithStatus {
this.mOperationResults = result;
this.log.debug("Queued first operation to result list: " + result.operationName);
} else {
let prevResult: IOperationResult<any> = this.mOperationResults;
let prevResult: IOperationResult<any>;
let currentResult: IOperationResult<any> = this.mOperationResults;
do {
prevResult = currentResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ProvisioningTestUtils {

} else if (instanceState === this.STATE_BEING_INIT || instanceState === this.STATE_BEING_PROV) {
// Wait until instance state is 'provisioned'
instance = await this.waitInstanceState(session, zOSMFVersion, instanceID, this.STATE_PROV);
await this.waitInstanceState(session, zOSMFVersion, instanceID, this.STATE_PROV);

// Deprovision an instance in 'provisioned' state
instance = await PerformAction.doProvisioningActionCommon(session, ProvisioningConstants.ZOSMF_VERSION,
Expand Down

0 comments on commit c0247b4

Please sign in to comment.