The Wayback Machine - https://web.archive.org/web/20201007071012/https://github.com/hpcng/singularity/issues/3441
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

all calls to exec.Command should go through the cmd package #3441

Open
jscook2345 opened this issue Apr 29, 2019 · 2 comments
Open

all calls to exec.Command should go through the cmd package #3441

jscook2345 opened this issue Apr 29, 2019 · 2 comments

Comments

@jscook2345
Copy link
Contributor

@jscook2345 jscook2345 commented Apr 29, 2019

We have a lot of calls to exec.Command that would be better done with a single wrapper around that functionality. A single location that calls exec.Command could help increase both traceability and debugging.

I would like to suggest the cmd package I added in my help test PR.

@mem
Copy link
Contributor

@mem mem commented May 14, 2019

This should also deal with the code duplication around handling exit failures. A basic function to wrap exec.Command, and then another wrapper around that with zero/non-zero exit codes. The second wrapper should take a testing.T argument to log / report failures. It should log both the command that ran and its output.

@jscook2345
Copy link
Contributor Author

@jscook2345 jscook2345 commented Jun 7, 2019

@mem implemented a command tool at internal/pkg/test/exec/exec.go. Let's start by replacing the default library calls of exec.Command with our own helper there. Once we've done that we can improve the helper's handling of failures.

mem pushed a commit that referenced this issue Jun 20, 2019
Calls to os exec command should be done through a single location to allow traceability and debugging.

This updates the E2E version tests.

Related to #3441.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.