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

Makes dcos_cli.exec return the full process object. Marks exec_command as deprecated #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fabs
Copy link

@Fabs Fabs commented Dec 18, 2018

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:

  • DCOS-43648 Add support for returncode on dcos-test-utils cli

Related tickets (optional)

Other tickets related to this change:

There is a follow up epic with the rest of the work.

  • DCOS-44823 dcos-test-utils - exec cmd contributions to other projects

Checklist for all PRs

  • Included a test which will fail if code is reverted but test is not. If there is no test please explain here:
  • Include a test in dcos-integration-tests in https://github.com/dcos/dcos or explain why this is not applicable:
  • Include a test in https://github.com/dcos/dcos-launch or explain why this is not applicable:

Integration tests were run and

  • Integration Test - Enterprise (link to job: )
  • Integration Test - Open (link to job: )

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:

  • Developers who understand the code being modified.
  • Developers responsible for code that interacts with or depends on the code being modified.

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.

@Fabs Fabs changed the title feature: add 'exec' returning a process and deprecates 'exec_command' Makes dcos_cli.exec return the full process object. Marks exec_command as deprecated Dec 18, 2018
vespian
vespian previously approved these changes Dec 18, 2018
Copy link
Contributor

@vespian vespian left a 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.

dcos_test_utils/dcos_cli.py Outdated Show resolved Hide resolved
@Fabs Fabs force-pushed the fabs/feature/cli-return-process branch 5 times, most recently from a010b8b to ad806b4 Compare December 19, 2018 15:18
@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have check?

Copy link
Author

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.

@Fabs Fabs force-pushed the fabs/feature/cli-return-process branch from b6b1cbe to daebf75 Compare December 24, 2018 12:10
@Fabs
Copy link
Author

Fabs commented Dec 24, 2018

@mainred, @vespian and @adamtheturtle. This is ready for a next pass.

mainred
mainred previously approved these changes Dec 24, 2018
@Fabs
Copy link
Author

Fabs commented Jan 29, 2019

So @adamtheturtle, do you think this is in a state you would merge?

@cprovencher cprovencher removed their request for review September 15, 2023 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants