Ensure output arrives on stderr

pull/987/head
Tim Head 2020-11-26 14:53:31 +01:00
rodzic 044e112bae
commit f2ed09bdfb
2 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -15,10 +15,10 @@ if [[ ! -z "${R2D_ENTRYPOINT:-}" ]]; then
if [[ ! -x "$R2D_ENTRYPOINT" ]]; then
chmod u+x "$R2D_ENTRYPOINT"
fi
exec "$R2D_ENTRYPOINT" "$@" >&"$log_fd" 2>&1
exec "$R2D_ENTRYPOINT" "$@" >&"$log_fd"
else
exec "$@" >&"$log_fd" 2>&1
exec "$@" >&"$log_fd"
fi
# Close the loggging output aggain
exec {log_fd}>&-
# Close the logging output again
#exec {log_fd}>&-

Wyświetl plik

@ -58,6 +58,10 @@ def test_env():
# all docker output is returned by repo2docker on stderr
# extract just the declare for better failure message formatting
# stdout should be empty
assert not result.stdout
# stderr should contain lines of output
declares = [x for x in result.stderr.split("\n") if x.startswith("declare")]
assert 'declare -x FOO="{}"'.format(ts) in declares
assert 'declare -x BAR="baz"' in declares