RedHatQE / uplift

Other
0 stars 1 forks source link

[RFE] Be able to call subprocess, while not blocking and get stdout #3

Open rarebreed opened 9 years ago

rarebreed commented 9 years ago

Rationale

Currently, when a subprocess is launched, the call will block until the subprocess is done. The output from the subprocess does not show until the subprocess completes. This should be changed so that launching the subprocess does not need to block, and output from the subprocess can be obtained as the process is still running.

Furthermore, the subprocess should also be able to be talked to via it's stdin. Use an InputStream in order to feed input to the child process.

The output should be able to be hooked into a various transport mechanism so that the output can be sent to remote processes to be consumed.

Finally, there should be a mechanism to be able to log the stdout/stderr of a process to a log file.

Benefits

From an automation perspective, it may not seem to make sense to provide stdout while a process is still running. However, from a debugging and exploratory testing point of view, waiting for long processes to finish can be problematic. It also prevents things like having log monitors from having any use (for example passing or failing something based on output rather than return code).

Concerns

Currently, uplift is using clj-commons-exec which in turn is a clojuresque wrapper around the apache commons exec. It appears though that commons exec is using Runtime.exec under the hood rather than ProcessBuilder. This means that Redirect and perhaps other features upcoming in Java 9 are or will be unavailable.

Consider taking the old teleproc project as a basis to use instead.

rarebreed commented 8 years ago

Work has been done to get the stdout and stderr while the process is still running. It can also save the output. However, getting data from the program to the stdin still needs work