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

Display daemon messages on standard error #2150

Merged
merged 3 commits into from
May 23, 2024
Merged

Display daemon messages on standard error #2150

merged 3 commits into from
May 23, 2024

Conversation

gejohnston
Copy link
Member

@gejohnston gejohnston commented May 22, 2024

What It Does

The zowe executable, which controls the daemon, now sends all informational messages, progress messages, and error messages to standard error instead of standard output.

How to Test

On Linux, you can run a command that starts the daemon and observe that the "starting" message goes to standard error.

$ zowe --version 2>stderr.txt
CLI Version: 8.0.0-next.202405161750
Zowe Release Version: V3

$ type stderr.txt
Starting a background process to increase performance ...

On Windows, redirecting stdout or stderr on a Zowe command when the daemon is being started locks stdout and stderr until the daemon process is terminated. The Zowe command hangs until the daemon is terminated. This is existing daemon behavior. Instead, run one Zowe command just to start the daemon. You can then redirect stdout and stderr on subsequent Zowe commands.

> zowe --version
Starting a background process to increase performance ...
CLI Version: 8.0.0-next.202405161750
Zowe Release Version: V3

# Now that the daemon is running, you can redirect stdout or stderr on Zowe commands.
# Corrupt your environment to cause a daemon communication error, which will
# display an error message on stderr.
#
# In File Explorer, on the file C:\Users\YourUserName\.zowe\daemon\daemon.lock,
# RightClick - Properties - Security - Edit
# Select your user name. Check the following 'Deny' boxes:
# Read & execute, Read, and Write

> zowe --version
Unable to create zowe daemon lock file = C:\Users\ej608771\.zowe\daemon\daemon.lock.
Reason = Access is denied. (os error 5).

> zowe --version 2> stderr.txt
> type stderr.txt
Unable to create zowe daemon lock file = C:\Users\ej608771\.zowe\daemon\daemon.lock.
Reason = Access is denied. (os error 5).

# Undo your changes if you want to run a daemon command ever again.

You can also confirm that the daemon's executable version number continues to be displayed on standard output.

> zowe --version-exe
1.2.3

> zowe --version-exe > stdout.txt
> type stdout.txt
1.2.3

Review Checklist
I certify that I have:

Additional Comments

Similar system tests fail on the master branch when run as daemon. My conclusion is that the system tests have not been affected by this change.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.21%. Comparing base (2214b7a) to head (80fe511).
Report is 2 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #2150    +/-   ##
========================================
  Coverage   91.21%   91.21%            
========================================
  Files         628      628            
  Lines       17891    17891            
  Branches     3689     3793   +104     
========================================
  Hits        16319    16319            
  Misses       1571     1571            
  Partials        1        1            

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

Copy link

sonarcloud bot commented May 22, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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 Gene!

Copy link
Member

@t1m0thyj t1m0thyj 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 @gejohnston!

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

LGTM! 😋

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

Looks good @gejohnston, thank you!

@gejohnston gejohnston merged commit dbbd3ce into next May 23, 2024
25 checks passed
@gejohnston gejohnston deleted the daemon-stderr-v3 branch May 23, 2024 18:55
Copy link

Release failed for the next branch. 😢

Error: The process '/opt/hostedtoolcache/node/20.13.1/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:974:21)
    at ExecState.CheckComplete (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:960:16)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:863:21)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

Check the workflow run for more error details.

Powered by Octorelease 🚀

Copy link

Release failed for the next branch. 😢

Error: The process '/opt/hostedtoolcache/node/20.13.1/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:974:21)
    at ExecState.CheckComplete (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:960:16)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:863:21)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

Check the workflow run for more error details.

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

5 participants