Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribute zowe files download dataset-matching command #1435

Merged
merged 44 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ea34b1a
Refactor old API code and contribute unit tests
t1m0thyj May 16, 2022
3033286
Add max-concurrent-requests and more unit tests
t1m0thyj May 16, 2022
f7476dc
Add command definition
zFernand0 May 31, 2022
f93cf1e
Add unit tests
zFernand0 May 31, 2022
482ae3c
Add extension map, and update help text
zFernand0 May 31, 2022
f171e74
add integration tests
zFernand0 Jun 1, 2022
b9bb080
Started with system tests
zFernand0 Jun 1, 2022
0bf158c
update system tests
zFernand0 Jun 2, 2022
6fa11e2
Better extension and extensionmap handling
awharn Jun 6, 2022
d366e60
Fix extension maps and option overwrite
awharn Jun 6, 2022
a8f54b7
Fix some lint errors
awharn Jun 6, 2022
5710606
Fix more linting errors
awharn Jun 6, 2022
f24e111
Merge remote-tracking branch 'origin/master' into files-download-data…
awharn Jun 6, 2022
ad4acb9
Add more tests
awharn Jun 6, 2022
0f178fe
Add even more tests for coverage
awharn Jun 6, 2022
200adde
Finish up API unit testing.
awharn Jun 6, 2022
f0a3b59
Add PS system tests
awharn Jun 8, 2022
c82b34f
First pass of enhancements to download dsm API
t1m0thyj Jun 8, 2022
541ae9e
Split out method to build download dsm response
t1m0thyj Jun 9, 2022
371cd87
Fix unit tests and add comments
t1m0thyj Jun 10, 2022
498a3b2
Update integration test snapshot
t1m0thyj Jun 10, 2022
92dec26
Add basic and extension related system tests
awharn Jun 10, 2022
ba311e9
Merge branch 'master' into files-download-data-sets-matching
zFernand0 Jun 13, 2022
8444abb
Add more system tests
awharn Jun 13, 2022
bcb8d1f
Remove accidentally focused tests
awharn Jun 13, 2022
ab94057
Add more API unit tests
t1m0thyj Jun 13, 2022
c23eb17
Update changelogs
t1m0thyj Jun 13, 2022
f8e5acd
Fix promise handling in download dsm API
t1m0thyj Jun 14, 2022
65a5bb6
Fix CLI system tests for download dsm
t1m0thyj Jun 14, 2022
fefb7f0
Fix files issues
awharn Jun 14, 2022
bb29934
Merge branch 'files-download-data-sets-matching' of github.com:/zowe/…
awharn Jun 14, 2022
c169e08
Fix lint error
t1m0thyj Jun 15, 2022
0d05ce6
Split APIs and update command based on PR feedback
t1m0thyj Jun 15, 2022
b2e46ee
Don't fail to list data sets because of TSO prompt
t1m0thyj Jun 16, 2022
7d7c797
Improve support for max-concurrent-requests option
t1m0thyj Jun 17, 2022
2941346
Update unit tests after splitting the APIs
t1m0thyj Jun 24, 2022
bbb4171
Increase test coverage a bit more
t1m0thyj Jun 24, 2022
7a32370
Update system tests after splitting the APIs
t1m0thyj Jun 24, 2022
08f7b2f
Fix unit test snapshots
t1m0thyj Jun 24, 2022
5b71641
Deprecate excludePatterns on IDownloadOptions
t1m0thyj Jun 27, 2022
35ef910
Merge branch 'master' into files-download-data-sets-matching
t1m0thyj Jun 27, 2022
da2fa97
Update Imperative to include bug fixes
t1m0thyj Jun 30, 2022
df782ed
Fix lint warning
t1m0thyj Jul 1, 2022
37a25cd
Test Node.js 18 and lock down Rust to 1.61
t1m0thyj Jul 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- Enhancement: Added the `zowe files download data-sets-matching` command to download multiple data sets at once. [#1287](https://github.com/zowe/zowe-cli/issues/1287)
- Note: If you used this command previously in the extended files plug-in for Zowe v1, the `--fail-fast` option now defaults to true which is different from the original behavior.

## `7.2.3`

- BugFix: Updated Imperative to address `ProfileInfo` related issues.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
dsn=$1
rfj=$2
set -e

echo "================Z/OS FILES DOWNLOAD DATASET MATCHING==============="
zowe zos-files download dsm "$1" $2 $3
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

echo "================Z/OS FILES DOWNLOAD DATASET MATCHING HELP==============="
zowe zos-files download dsm --help
if [ $? -gt 0 ]
then
exit $?
fi

echo "================Z/OS FILES DOWNLOAD DATASET MATCHING HELP WITH RFJ==========="
zowe zos-files download dsm --help --rfj
exit $?

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/

import * as path from "path";
import { ITestEnvironment, runCliScript } from "@zowe/cli-test-utils";
import { TestEnvironment } from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
import { ITestPropertiesSchema } from "../../../../../../../__tests__/__src__/properties/ITestPropertiesSchema";

// Test Environment populated in the beforeAll();
let TEST_ENVIRONMENT: ITestEnvironment<ITestPropertiesSchema>;

describe("Download Dataset Matching", () => {

beforeAll(async () => {
TEST_ENVIRONMENT = await TestEnvironment.setUp({
testName: "download_data_set_matching",
skipProperties: true
});
});

afterAll(async () => {
await TestEnvironment.cleanUp(TEST_ENVIRONMENT);
});

it("should display the help", () => {
const shellScript = path.join(__dirname, "__scripts__", "command_download_dsm_help.sh");
const response = runCliScript(shellScript, TEST_ENVIRONMENT);

expect(response.stderr.toString()).toBe("");
expect(response.status).toBe(0);
expect(response.stdout.toString()).toMatchSnapshot();
});

it("should fail due to missing pattern", async () => {
const shellScript = path.join(__dirname, "__scripts__", "command", "command_download_dsm.sh");
const response = runCliScript(shellScript, TEST_ENVIRONMENT, [""]);
expect(response.status).toBe(1);
expect(response.stderr.toString()).toContain("pattern");
expect(response.stderr.toString()).toContain("Missing Positional");
});

it("should fail due to specifying both binary and record", async () => {
const shellScript = path.join(__dirname, "__scripts__", "command", "command_download_dsm.sh");
const response = runCliScript(shellScript, TEST_ENVIRONMENT, ["test", "--binary", "--record"]);
expect(response.status).toBe(1);
expect(response.stderr.toString()).toContain("following options conflict");
expect(response.stderr.toString()).toContain("--record");
expect(response.stderr.toString()).toContain("--binary");
});

it("should fail due to specifying both extension and extensionMap", async () => {
const shellScript = path.join(__dirname, "__scripts__", "command", "command_download_dsm.sh");
const response = runCliScript(shellScript, TEST_ENVIRONMENT, ["test", "--extension", "--extension-map"]);
expect(response.status).toBe(1);
expect(response.stderr.toString()).toContain("following options conflict");
expect(response.stderr.toString()).toContain("--extension");
expect(response.stderr.toString()).toContain("--extension-map");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

zowe zos-files download dsm $*
if [ $? -gt 0 ]
then
exit $?
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
HOST=$2
PORT=$3
USER=$4
PASS=$5

zowe zos-files download dsm "$1" --host $HOST --port $PORT --user $USER --password $PASS --ru=false
exit $?
Loading