-
Notifications
You must be signed in to change notification settings - Fork 313
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
Fixes #1595: Add method to process.py to return both return code and logs #1828
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.
LGTM, but #1595 lacks explicit clarification of what's exactly the win. I think we can find it here.
WDYT about using the modified run_subprocess()
to avoid the double call in is_branch() as part of this PR? On quick scan that's probably the only improvement in the git
module we can make as other methods use different commands in a sequence?
What do you think about the latest change? |
Thank you for iterating. 21caafa eliminates duplication but made me realize we're missing the logging now which I think should be kept for troubleshooting purposes. We could add snowflake logging at |
Adding logging option to I could certainly be convinced that the latter one is the correct approach, but maybe not in this small PR? EDIT: But then again, the original usecase that brought about this change was needing to do exactly that, so I can run through and add a |
This will be more compatible with the changes, and keep the return type the same as `run_subprocess()` - universal_newline was changed to text in recent versions of the library
IT tests are failing as it turns out |
Will be adding new function
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.
LGTM. Please change the title of the PR as it's no longer relevant. I've left 2 minor comments.
esrally/utils/process.py
Outdated
def run_subprocess(command_line): | ||
def run_subprocess(command_line: str) -> int: | ||
""" | ||
Runs the provided command line in a subprocess. All output will be returned in the `CompletedProcess.stdout` field. |
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.
Runs the provided command line in a subprocess. All output will be returned in the `CompletedProcess.stdout` field. | |
Runs the provided command line in a subprocess. |
esrally/utils/process.py
Outdated
LogLevel = int | ||
FileId = int |
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.
Nit: Should type definitions be moved to the top of the file?
CompletedProcess
object
Huh, I see the IT tests failed, but looking at the logs, I don't actually see any failures noted. |
As requested in #1595
[x] Have you signed the contributor license agreement?
[x] Have you followed the contributor guidelines?
[x] Have you run
make check-all
successfully?[x] Did you choose a descriptive title and description for your PR?