Skip to content

Commit

Permalink
fix all system tests and any remaining behavior issues
Browse files Browse the repository at this point in the history
Signed-off-by: zFernand0 <[email protected]>
  • Loading branch information
zFernand0 committed Mar 6, 2024
1 parent 20836b0 commit d97087e
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 34 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ All notable changes to the z/OS FTP Plug-in for Zowe CLI will be documented in t
- For a full list of transfer modes, see [TransferMode by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/zosAccessor.ts#L67)
- `IConnectionOption`
- For a full list of transfer modes, see [ConnectionOption by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/interfaces/ConnectionOption.ts#L17)
- `IDatasetEntry`
- For a full list of transfer modes, see [DatasetEntry by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/interfaces/DatasetEntry.ts#L17)
- `IUSSEntry`
- For a full list of transfer modes, see [USSEntry by `zos-node-accessor`](https://github.com/IBM/zos-node-accessor/blob/faf55873f37cc40e927f1b1c19f697de8cf08b95/src/interfaces/USSEntry.ts#L19)
- **Breaking**:
- Removed the following constants, interfaces, and other values:
- `IGetSpoolFileOption.jobName`
Expand All @@ -36,7 +40,7 @@ All notable changes to the z/OS FTP Plug-in for Zowe CLI will be documented in t
- `JobUtils.listJobs`
- `JobUtils.deleteJob`
- `UssUtils.listFiles`
- Return type changed: `Promise<any[]> --> Promise<IDatasetEntry[]>`
- Return type changed: `Promise<any[]> --> Promise<IUSSEntry[]>`
- `UssUtils.makeDirectory`
- `UssUtils.renameFile`
- `UssUtils.deleteFile`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ describe("allocate data set command", () => {
expect(result.stdout.toString()).toContain('Allocated dataset ' + destination + ' successfully!');

const attributes = await connection.listDatasets(destination);
expect(attributes[0].Dsorg).toEqual("PO");
expect(attributes[0].Lrecl).toEqual("100");
expect(attributes[0].Recfm).toEqual("FB");
expect(attributes[0].dsOrg).toEqual("PO");
expect(attributes[0].recordLength).toEqual(100);
expect(attributes[0].recordFormat).toEqual("FB");
});

it("should give a syntax error if the data set are omitted", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { FTPConfig } from "../../../../../src/api/FTPConfig";
import { IO } from "@zowe/imperative";
import { CoreUtils } from "../../../../../src/api/CoreUtils";
import { prepareTestJclDataSet } from "../../PrepareTestJclDatasets";
import { ZosAccessor } from "zos-node-accessor";

let connection: any;
let connection: ZosAccessor;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;
let iefbr14DataSet: string;

Expand All @@ -42,7 +43,7 @@ describe("download all-spool-by-jobid command", () => {

it("should be able to submit an IEFBR14 job and then download the jobid", async () => {
// download the appropriate JCL content from the data set
const iefbr14Content = (await connection.getDataset(iefbr14DataSet)).toString();
const iefbr14Content = (await connection.downloadDataset(iefbr14DataSet)).toString();
const jobid = await connection.submitJCL(iefbr14Content.toString());
const JOB_WAIT = 2000;
await CoreUtils.sleep(JOB_WAIT);
Expand All @@ -60,7 +61,7 @@ describe("download all-spool-by-jobid command", () => {

it("should be able to submit a job from a local file and then download the spool, omitting the jobid directory", async () => {
// download the appropriate JCL content from the data set
const iefbr14Content = (await connection.getDataset(iefbr14DataSet)).toString();
const iefbr14Content = (await connection.downloadDataset(iefbr14DataSet)).toString();
const jobid = await connection.submitJCL(iefbr14Content.toString());
const JOB_WAIT = 2000;
await CoreUtils.sleep(JOB_WAIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ describe("list spool-files-by-jobid command", () => {
// download the appropriate JCL content from the data set
const iefbr14Content = (await connection.downloadDataset(iefbr14DataSet)).toString();
expect(iefbr14Content).toContain("IEFBR14");
const jobid = await connection.submitJCL(iefbr14Content);
const jobId = await connection.submitJCL(iefbr14Content);
const ONE_SECOND = 1000;
await CoreUtils.sleep(ONE_SECOND);
const result = runCliScript(__dirname + "/__scripts__/command_list_spool_files_by_jobid.sh", testEnvironment, [jobid]);
const result = runCliScript(__dirname + "/__scripts__/command_list_spool_files_by_jobid.sh", testEnvironment, [jobId]);
expect(result.stderr.toString()).toEqual("");
expect(result.status).toEqual(0);
expect(result.stdout.toString()).toContain("JESJCL");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("rename data set command", () => {
const renameDataSetListResults: any[] = await connection.listDatasets(renameDestination);
let renamedDataSet: any;
for (const dataSet of renameDataSetListResults) {
if (dataSet.Dsname === renameDestination.toUpperCase()) {
if (dataSet.name === renameDestination.toUpperCase()) {
renamedDataSet = dataSet;
break;
}
Expand All @@ -97,15 +97,15 @@ describe("rename data set command", () => {
const resetNameResults: any[] = await connection.listDatasets(originalName);
let resetDataset: any;
for (const dataSet of resetNameResults) {
if (dataSet.Dsname === originalName.toUpperCase()) {
if (dataSet.name === originalName.toUpperCase()) {
resetDataset = dataSet;
}
}
expect(resetDataset).toBeDefined();

} catch (e) {
throw new Error("Warning! Rename of data set from your custom_properties file did not succeed!\nAttempted to rename from '" + originalName
+ "' to '" + renameDestination + "'You may have to manually rename " +
+ "' to '" + renameDestination + "'\nYou may have to manually rename " +
"or re-create the data set! Error encountered while renaming: \n" + inspect(e));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ describe("view job-status-by-jobid command", () => {
const result = runCliScript(__dirname + "/__scripts__/command_view_job_status_by_jobid.sh", testEnvironment, [jobID]);
expect(result.stderr.toString()).toEqual("");
expect(result.status).toEqual(0);
expect(result.stdout.toString()).toContain("jobname");
expect(result.stdout.toString()).toContain("jobid");
expect(result.stdout.toString()).toContain("jobName");
expect(result.stdout.toString()).toContain("jobId");
expect(result.stdout.toString()).toContain(jobID);
});

it("should give a syntax error if the local file to submit is omitted", async () => {
const result = runCliScript(__dirname + "/__scripts__/command_view_job_status_by_jobid.sh", testEnvironment, []);
const stderr = result.stderr.toString();
expect(stderr).toContain("Positional");
expect(stderr).toContain("jobid");
expect(stderr).toContain("jobId");
expect(stderr).toContain("Syntax");
expect(result.status).toEqual(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("view spool-file-by-id command", () => {
const jobStatus = await connection.getJobStatus({jobId});
let jesJCLID;
for (const file of jobStatus.spoolFiles ?? []) {
if (file.ddname === "JESJCL") {
if (file.ddName === "JESJCL") {
jesJCLID = file.id;
break;
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"setupFilesAfterEnv": [
"./__tests__/setUpJest.js"
],
"testResultsProcessor": "jest-stare",
"transform": {
".(ts)": "ts-jest"
},
Expand Down
16 changes: 8 additions & 8 deletions src/api/UssUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { StreamUtils } from "./StreamUtils";
import { IDeleteFileOption, IDownloadFileOption, IUSSEntry, IUploadFileOption } from "./doc/UssInterface";
import { TransferMode, ZosAccessor } from "zos-node-accessor";
import { ReadStream } from "fs";
import { ITransferMode } from "./doc/constants";
import { IFileType, ITransferMode } from "./doc/constants";

export class UssUtils {

Expand Down Expand Up @@ -92,10 +92,10 @@ export class UssUtils {
public static async deleteFile(connection: ZosAccessor, fileOrDir: string, option?: IDeleteFileOption): Promise<void> {
this.log.debug("Deleting USS file '%s'", fileOrDir);

if (option && option.recursive) {
if (option?.recursive) {
await UssUtils.deleteDirectory(connection, fileOrDir, option.console);
} else {
await connection.deleteDataset(fileOrDir);
await connection.deleteFile(fileOrDir);

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, macos-14)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:40 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:39 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, macos-14)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:40 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:39 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:40 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)

Check failure on line 98 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

Delete uss file handler › should return correct message if the uss file is deleted.

TypeError: connection.deleteFile is not a function at Function.deleteFile (src/api/UssUtils.ts:98:30) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.deleteFile (src/api/UssUtils.ts:2944:12) at DeleteUSSFileHandler.deleteFile (src/cli/delete/uss-file/UssFile.Handler.ts:24:24) at src/cli/delete/uss-file/UssFile.Handler.ts:794:40 at Object.<anonymous>.__awaiter (src/cli/delete/uss-file/UssFile.Handler.ts:743:10) at DeleteUSSFileHandler.processFTP (src/cli/delete/uss-file/UssFile.Handler.ts:815:12) at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:30:23 at __tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/delete/uss-file/UssFile.Handler.test.ts:17:80)
}
}

Expand Down Expand Up @@ -147,7 +147,7 @@ export class UssUtils {
// if we're in ascii mode, we need carriage returns to avoid errors
content = Buffer.from(CoreUtils.addCarriageReturns(content.toString()));
}
await connection.uploadDataset(content, ussFile, transferType);
await connection.uploadFile(content, ussFile, transferType);

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, macos-14)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:39 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, macos-14)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:40 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, macos-14)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:39 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, macos-14)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:40 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:39 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:39 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

Upload file to data set handler › should return no data set if the data set is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadFileToUssFileHandler.uploadFile (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:25:24) at src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:816:39 at Object.<anonymous>.__awaiter (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:765:10) at UploadFileToUssFileHandler.processFTP (src/cli/upload/file-to-uss-file/FileToUssFile.Handler.ts:837:12) at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:36:23 at __tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:18:71 at Object.<anonymous>.__awaiter (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:14:12) at Object.<anonymous> (__tests__/__unit__/cli/upload/file-to-uss-file/FileToUssFile.Handler.test.ts:19:78)

Check failure on line 150 in src/api/UssUtils.ts

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

Upload stdin to USS file handler › should return no data set if the USS file is not found.

TypeError: connection.uploadFile is not a function at Function.uploadFile (src/api/UssUtils.ts:150:26) at src/api/UssUtils.ts:2760:40 at Object.<anonymous>.__awaiter (src/api/UssUtils.ts:2709:10) at Function.uploadFile (src/api/UssUtils.ts:3046:12) at UploadStdinToUssFileHandler.uploadFile (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:28:24) at fulfilled (src/cli/upload/stdin-to-uss-file/StdinToUssFile.Handler.ts:790:24)
}

/**
Expand Down Expand Up @@ -185,19 +185,19 @@ export class UssUtils {
}

public static async deleteDirectory(connection: ZosAccessor, dir: string, response?: IHandlerResponseConsoleApi): Promise<void> {
const files = await connection.listDatasets(dir);
const files = await connection.listFiles(dir);
for (const file of files) {
const filePath = PATH.posix.join(dir, file.name);
if (file.isDirectory) {
if (file.fileType === IFileType.DIRECTORY) {
await this.deleteDirectory(connection, filePath, response);
} else {
await connection.deleteDataset(filePath);
await connection.deleteFile(filePath);
if (response) {
response.log("Deleted %s", filePath);
}
}
}
await connection.deleteDataset(dir);
await connection.deleteFile(dir);
if (response) {
response.log("Deleted %s", dir);
}
Expand Down
4 changes: 4 additions & 0 deletions src/api/doc/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
*/

import { TransferMode } from "zos-node-accessor";
import { FileType } from "zos-node-accessor/lib/interfaces/USSEntry";

/**
* Bytes per track.
*/
export const TRACK = 56664;

export const IFileType = { ...FileType };
export type IFileType = typeof IFileType;

export const ITransferMode = { ...TransferMode };
export type ITransferMode = typeof ITransferMode;

Expand Down
4 changes: 2 additions & 2 deletions src/cli/delete/uss-file/UssFile.Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

import { FTPBaseHandler } from "../../../FTPBase.Handler";
import { IFTPHandlerParams } from "../../../IFTPHandlerParams";
import { UssUtils } from "../../../api";
import { IDeleteFileOption, UssUtils } from "../../../api";

export default class DeleteUSSFileHandler extends FTPBaseHandler {
public async processFTP(params: IFTPHandlerParams): Promise<void> {

const ussFile = UssUtils.normalizeUnixPath(params.arguments.ussFile);
const option = {
const option: IDeleteFileOption = {
console: params.response.console,
recursive: params.arguments.recursive,
};
Expand Down
2 changes: 1 addition & 1 deletion src/cli/list/data-set/DataSet.Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ListDataSetsHandler extends FTPBaseHandler {
params.response.format.output({
output: filteredFiles,
format: "table",
fields: ["dsname"]
fields: ["name"]
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default class ListSpoolFilesByJobidHandler extends FTPBaseHandler {

// Format & print the response
params.response.format.output({
fields: ["id", "ddname", "procstep", "stepname"],
fields: ["id", "ddName", "procStep", "stepName"],
output: files,
format: "table"
format: "table",
});
}
}
6 changes: 3 additions & 3 deletions src/cli/view/job-status-by-jobid/JobStatusByJobId.Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { JobUtils } from "../../../api";

export default class ViewJobStatusByJobIdHandler extends FTPBaseHandler {
public async processFTP(params: IFTPHandlerParams): Promise<void> {
this.log.debug("Viewing all spool files for job id: " + params.arguments.jobid);
const jobDetails = await JobUtils.findJobByID(params.connection, params.arguments.jobid);
this.log.debug("Viewing all spool files for job id: " + params.arguments.jobId);
const jobDetails = await JobUtils.findJobByID(params.connection, params.arguments.jobId);
params.response.data.setObj(jobDetails);
params.response.format.output(
{
fields: ["jobname", "jobid", "owner", "status", "rc", "retcode"],
fields: ["jobName", "jobId", "owner", "status", "rc", "retcode"],
output: jobDetails,
format: "object"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ViewJobStatusByJobidDefinition: ICommandDefinition = {
],
positionals: [
{
name: "jobid",
name: "jobId",
description: "The ID of the job" +
"for which you would like to list spool files",
type: "string",
Expand Down

0 comments on commit d97087e

Please sign in to comment.