Skip to content
Snippets Groups Projects
Commit f95735ab authored by finnball's avatar finnball
Browse files

temp-directory bot now returns stderr, stdout and exit code to client.

parent fb9cedd3
No related branches found
No related tags found
Loading
...@@ -74,14 +74,25 @@ def work_temp_directory(context, lease): ...@@ -74,14 +74,25 @@ def work_temp_directory(context, lease):
process = subprocess.Popen(command_line, process = subprocess.Popen(command_line,
cwd=working_directory, cwd=working_directory,
universal_newlines=True,
env=environment, env=environment,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE) stdout=subprocess.PIPE,
# TODO: Should return the stdout and stderr in the ActionResult. stderr=subprocess.PIPE)
process.communicate()
stdout, stderr = process.communicate()
returncode = process.returncode
action_result = remote_execution_pb2.ActionResult() action_result = remote_execution_pb2.ActionResult()
# TODO: Upload to CAS or output RAW
# For now, just pass raw
# https://gitlab.com/BuildGrid/buildgrid/issues/90
action_result.stdout_raw = stdout.encode()
action_result.stderr_raw = stderr.encode()
action_result.exit_code = returncode
logger.debug("Command stderr: [{}]".format(stderr.encode()))
logger.debug("Command stdout: [{}]".format(stdout.encode()))
logger.debug("Command exit code: [{}]".format(returncode))
with upload(context.cas_channel, instance=instance_name) as cas: with upload(context.cas_channel, instance=instance_name) as cas:
for output_path in command.output_files: for output_path in command.output_files:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment