Ensure output arrives on stderr
MODIFY
repo2docker/buildpacks/repo2docker-entrypoint
repo2docker/buildpacks/repo2docker-entrypoint
@@ -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}>&-

MODIFY
tests/unit/test_env.py
tests/unit/test_env.py
@@ -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

Ensure output arrives on stderr