Skip to content

Conversation

@JWaters02
Copy link
Member

@JWaters02 JWaters02 commented Oct 6, 2025

What It Does

Fixes #2594

Added new interfaces IDownloadAmResult and IDownloadAmResponse to provide detailed results when downloading all members of a PDS.

Added new optional field skippedExisting to IDownloadDsmResult.

How to Test

Run zowe zos-files download all-members, all-members-matching, data-set, data-sets-matching and uss-file commands with and without overwrite option, deleting some files in the middle to test capabilities of each.

Review Checklist
I certify that I have:

  • updated the changelog
  • manually tested my changes
  • added/updated automated unit/integration tests
  • created/ran system tests (provide build number if applicable)
  • followed the contribution guidelines

Additional Comments

There is one failing test, but I am stumped how to fix it...

@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Oct 6, 2025
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Oct 6, 2025
Signed-off-by: JWaters02 <[email protected]>
Signed-off-by: JWaters02 <[email protected]>
Signed-off-by: JWaters02 <[email protected]>
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (fdd6221) to head (e58412f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2620      +/-   ##
==========================================
+ Coverage   91.81%   91.83%   +0.01%     
==========================================
  Files         644      644              
  Lines       19143    19181      +38     
  Branches     4124     4218      +94     
==========================================
+ Hits        17577    17615      +38     
  Misses       1564     1564              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JTonda JTonda requested review from t1m0thyj and traeok October 6, 2025 15:12
@JWaters02
Copy link
Member Author

I suppose there should probably be some system tests but vast majority of existing download system tests fail for me probably due to some misconfiguration but idk if Ross would even be very happy to have a massive number of requests come on the zxplore system.

@traeok
Copy link
Member

traeok commented Oct 7, 2025

Regarding the failed unit tests, I only see one failing test on Windows but 2 failing tests on other platforms:

The test z/OS Files - Download › allDataSets › should handle mixed PS and PDS datasets with overwrite false is failing because the commandResponse now appears to print the data sets in alphabetical order. This change makes sense, but it looks like the test is checking for the old order (as TEST.PS2.DATA.SET was previously printed before TEST.PO.DATA.SET). Updating the expected order for the message assertion in that test should resolve the issue.

As for the second test, this seems like an issue specific to building the correct destination path on Linux and MacOS. This may be related to path normalization between platforms - you might want to double check that the platform-specific path import is used to ensure proper path generation, e.g. import * as path from "path"; - I can provide more advice once I take a deeper look at the tests/logic.

Regarding the failed integration tests, these are all due to snapshots that have updated from the change. If you run npm run test:integration -- -u, that should update the snapshots and resolve those failing tests.

@JWaters02
Copy link
Member Author

Regarding the failed integration tests, these are all due to snapshots that have updated from the change. If you run npm run test:integration -- -u, that should update the snapshots and resolve those failing tests.

Hey sorry I know I must've asked/figured this out before, but which folder do I run this in? in root folder, I get error

PS F:\Github Projects\Work\zowe-cli> npm run test:integration -- -u

> pretest:integration
> node scripts/sampleCliTool.js install

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\Bobby\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:C:\Users\Bobby\AppData\Roaming\npm\node_modules\npm\npmrc
4 silly config load:file:C:\Users\Bobby\.npmrc
5 silly config load:file:C:\Users\Bobby\AppData\Roaming\npm\etc\npmrc
6 verbose title npm install . Projects\Work\zowe-cli\.npm-global
7 verbose argv "install" "--global" "." "--prefix" "F:\\Github" "Projects\\Work\\zowe-cli\\.npm-global" "--install-links" "false"
8 verbose logfile logs-max:10 dir:C:\Users\Bobby\AppData\Local\npm-cache\_logs\2025-10-12T11_00_08_955Z-
9 verbose logfile C:\Users\Bobby\AppData\Local\npm-cache\_logs\2025-10-12T11_00_08_955Z-debug-0.log
10 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
11 silly logfile start cleaning logs, removing 2 files
12 verbose stack Error: EEXIST: file already exists, mkdir 'F:\Github'
13 error code EEXIST
14 error syscall mkdir
15 error path F:\Github
16 error errno -4075
17 error EEXIST: file already exists, mkdir 'F:\Github'
18 error File exists: F:\Github
19 error Remove the existing file and try again, or run npm
20 error with --force to overwrite files recklessly.
21 silly unfinished npm timer reify 1760266809438
22 verbose cwd F:\Github Projects\Work\zowe-cli\packages\imperative\__tests__\__integration__\cmd
23 verbose os Windows_NT 10.0.19045
24 verbose node v20.11.1
25 verbose npm  v10.8.3
26 verbose exit -4075
27 verbose code -4075

and then in packages/zosfiles there is no integration test script to run

@traeok
Copy link
Member

traeok commented Oct 13, 2025

Regarding the failed integration tests, these are all due to snapshots that have updated from the change. If you run npm run test:integration -- -u, that should update the snapshots and resolve those failing tests.

Hey sorry I know I must've asked/figured this out before, but which folder do I run this in? in root folder, I get error

PS F:\Github Projects\Work\zowe-cli> npm run test:integration -- -u

<snip>
and then in packages/zosfiles there is no integration test script to run

You should be able to run from the root, it seems that you're encountering an issue when installing the test/sample CLIs as part of the pretest script - if you run npm run posttest:integration and then npm run test:integration without any args, does this resolve the error?

@JWaters02
Copy link
Member Author

Regarding the failed integration tests, these are all due to snapshots that have updated from the change. If you run npm run test:integration -- -u, that should update the snapshots and resolve those failing tests.

Hey sorry I know I must've asked/figured this out before, but which folder do I run this in? in root folder, I get error

PS F:\Github Projects\Work\zowe-cli> npm run test:integration -- -u

<snip>
and then in packages/zosfiles there is no integration test script to run

You should be able to run from the root, it seems that you're encountering an issue when installing the test/sample CLIs as part of the pretest script - if you run npm run posttest:integration and then npm run test:integration without any args, does this resolve the error?

Nope

@traeok
Copy link
Member

traeok commented Oct 16, 2025

@JWaters02 revisiting the error details, I think the issue may be a side effect of having a space in the path of your current working directory ("GitHub Projects"). Can you try renaming that folder or moving the repo to a path without a space to see if the issue goes away?

@JWaters02
Copy link
Member Author

@JWaters02 revisiting the error details, I think the issue may be a side effect of having a space in the path of your current working directory ("GitHub Projects"). Can you try renaming that folder or moving the repo to a path without a space to see if the issue goes away?

As yes good observation, you are right. I fixed this in #2627

@github-project-automation github-project-automation bot moved this from Review/QA to Closed in Zowe CLI Squad Oct 17, 2025
@JWaters02
Copy link
Member Author

@t1m0thyj Hi is this a misclick? Any chance you could re-open the PR?

@t1m0thyj
Copy link
Member

t1m0thyj commented Oct 18, 2025

@JWaters02 Apologies for this, it should be re-opened now.

There wasn't a misclick - when a PR is merged, GitHub auto-closes issues/PRs that are mentioned with the "Fixes" or "Resolves" keyword. So the description of #2627 triggered it:

Resolves #2620 (comment)

@t1m0thyj t1m0thyj reopened this Oct 18, 2025
@github-project-automation github-project-automation bot moved this from Closed to New Issues in Zowe CLI Squad Oct 18, 2025
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Oct 18, 2025
@JWaters02
Copy link
Member Author

@JWaters02 Apologies for this, it should be re-opened now.

There wasn't a misclick - when a PR is merged, GitHub auto-closes issues/PRs that are mentioned with the "Fixes" or "Resolves" keyword. So the description of #2627 triggered it:

Resolves #2620 (comment)

Ahh okay I see thanks. I knew it did it for issues but had never seen it do it for PRs 😅

@JWaters02
Copy link
Member Author

JWaters02 commented Oct 18, 2025

As for the second test, this seems like an issue specific to building the correct destination path on Linux and MacOS. This may be related to path normalization between platforms - you might want to double check that the platform-specific path import is used to ensure proper path generation, e.g. import * as path from "path"; - I can provide more advice once I take a deeper look at the tests/logic.

@traeok not sure whats going wrong, mind taking another look again? I can't test on unix right now (I plan to set up a unix box for zowe on proxmox server just need the time to get round to it). apologies

@traeok
Copy link
Member

traeok commented Oct 22, 2025

As for the second test, this seems like an issue specific to building the correct destination path on Linux and MacOS. This may be related to path normalization between platforms - you might want to double check that the platform-specific path import is used to ensure proper path generation, e.g. import * as path from "path"; - I can provide more advice once I take a deeper look at the tests/logic.

@traeok not sure whats going wrong, mind taking another look again? I can't test on unix right now (I plan to set up a unix box for zowe on proxmox server just need the time to get round to it). apologies

Sorry for the delay - I'll take a look 👍

@traeok
Copy link
Member

traeok commented Oct 22, 2025

@JWaters02 Regarding issues with Mac/Linux pipelines:

not sure whats going wrong, mind taking another look again? I can't test on unix right now (I plan to set up a unix box for zowe on proxmox server just need the time to get round to it). apologies

Fixed in 46eb97d - the mock implementation for existsSync on Linux/Mac was a bit off, now we look for an exact match in the existsSync mock when the platform is not win32

@sonarqubecloud
Copy link

@JWaters02
Copy link
Member Author

@JWaters02 Regarding issues with Mac/Linux pipelines:

not sure whats going wrong, mind taking another look again? I can't test on unix right now (I plan to set up a unix box for zowe on proxmox server just need the time to get round to it). apologies

Fixed in 46eb97d - the mock implementation for existsSync on Linux/Mac was a bit off, now we look for an exact match in the existsSync mock when the platform is not win32

Ooh okay I see now so just silly mistake. Was just getting confused then. Thanks so much as usual trae ❤️

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Joshua for the fix!


## Recent Changes

- Added support for `--overwrite` option to all Download methods. The default behavior is no longer to always overwrite existing files. [#2620](https://github.com/zowe/zowe-cli/pull/2620)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nitpick) missing BugFix prefix here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

Download data set commands should support overwrite flag

3 participants