-
Notifications
You must be signed in to change notification settings - Fork 17
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
Makes dcos_cli.exec return the full process object. Marks exec_command as deprecated #74
base: master
Are you sure you want to change the base?
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.
Left one comment, nothing blocking, but it would be nice to have IMO.
a010b8b
to
ad806b4
Compare
@@ -92,6 +94,45 @@ def clear_cli_dir(): | |||
if os.path.exists(path): | |||
shutil.rmtree(path) | |||
|
|||
def exec(self, cmd: str, stdin=None, check=True) -> subprocess.CompletedProcess: |
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.
Why have check
?
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.
While testing I would like to be able to run commands that I know will fail, and assert on their exit, without having to rescue
from the exception. There is a behavior on the subprocess
library that is to pass a boolean called check
that when True, does not check for the command terminating with status code 0. I want to be able to configure this from the client of the exec function.
b6b1cbe
to
daebf75
Compare
@mainred, @vespian and @adamtheturtle. This is ready for a next pass. |
So @adamtheturtle, do you think this is in a state you would merge? |
High-level description
This feature enables Edge-LB tests to look at the returncode of the command. It also enriches the API of cli test with the full content of the process object.
Please see #61 for context
Corresponding DC/OS tickets (obligatory)
These JIRA ticket(s) must be updated (ideally closed) in the moment this PR lands:
Related tickets (optional)
Other tickets related to this change:
There is a follow up epic with the rest of the work.
Checklist for all PRs
dcos-integration-tests
in https://github.com/dcos/dcos or explain why this is not applicable:Integration tests were run and
PLEASE FILL IN THE TEMPLATE ABOVE / DO NOT REMOVE ANY SECTIONS ABOVE THIS LINE
Instructions and review process
What is the review process and when will my changes land?
All PRs require 2 approvals using GitHub's pull request reviews.
Reviewers should be:
It is best to proactively ask for 2 reviews by @mentioning the candidate reviewers in the PR comments area. The responsibility is on the developer submitting the PR to follow-up with reviewers and make sure a PR is reviewed in a timely manner.