Skip to content

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

Open
Fabs wants to merge 2 commits into
masterfrom
fabs/feature/cli-return-process
Open

Makes dcos_cli.exec return the full process object. Marks exec_command as deprecated#74
Fabs wants to merge 2 commits into
masterfrom
fabs/feature/cli-return-process

Conversation

@Fabs

@Fabs Fabs commented Dec 18, 2018

Copy link
Copy Markdown

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

@vespian vespian left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread dcos_test_utils/dcos_cli.py Outdated
@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
Comment thread dcos_test_utils/dcos_cli.py Outdated
Comment thread dcos_test_utils/dcos_cli.py Outdated
if os.path.exists(path):
shutil.rmtree(path)

def exec(self, cmd: str, stdin=None, check=True) -> subprocess.CompletedProcess:

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread dcos_test_utils/dcos_cli.py
@Fabs Fabs force-pushed the fabs/feature/cli-return-process branch from b6b1cbe to daebf75 Compare December 24, 2018 12:10
@Fabs

Fabs commented Dec 24, 2018

Copy link
Copy Markdown
Author

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

Comment thread dcos_test_utils/dcos_cli.py Outdated
mainred
mainred previously approved these changes Dec 24, 2018
@Fabs

Fabs commented Jan 29, 2019

Copy link
Copy Markdown
Author

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