-
Notifications
You must be signed in to change notification settings - Fork 72
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
Spec tests shell command fix #1923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using backticks to run shell commands the output is printed to stdout.
So when log level is set to info, the output would be printed as log lines (to stdout), as well as to stdout again (for the backticks).
For the intended outcome of this PR, we could use the Process module.
There is also a ShellCmd module within the project that can be used/repurposed for the intended outcome of this PR. This wraps the Process module’s function call.
I was wrong about the behaviour of backticks. I just tested it. But it still applies to stderr. If we use backticks, we will get some lines in stderr and some lines in stdout (in the log block) if the command outputs both. This is the testsuite/src/tasks/utils/utils.cr Lines 15 to 36 in 83f08b6
If there is missing functionality with the ShellCmd module, please feel free to update it as required. |
Should all backtick usage be refactored to ShellCmd module? |
New PR: #1954 |
Description
This PR will remove shell commands from Log.info wrapper.
Part of PR is also removal of command
./cnf-testsuite setup
, which is used two times in microservice_spec.cr before_all construct.PR only provides quick fix of issue, where spec tests fail, if shell command is run in Log.info and log level error is used. To avoid repetition and add uniform way of logging spec tests I created different task for that (#1922), as that's not point of this fix.
Issues:
Refs: #1495
How has this been tested:
Types of changes:
Checklist:
Documentation
Code Review
Issue