Skip to content

Commit f2ed09b

Browse files
committed
Ensure output arrives on stderr
1 parent 044e112 commit f2ed09b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

repo2docker/buildpacks/repo2docker-entrypoint

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ if [[ ! -z "${R2D_ENTRYPOINT:-}" ]]; then
1515
if [[ ! -x "$R2D_ENTRYPOINT" ]]; then
1616
chmod u+x "$R2D_ENTRYPOINT"
1717
fi
18-
exec "$R2D_ENTRYPOINT" "$@" >&"$log_fd" 2>&1
18+
exec "$R2D_ENTRYPOINT" "$@" >&"$log_fd"
1919
else
20-
exec "$@" >&"$log_fd" 2>&1
20+
exec "$@" >&"$log_fd"
2121
fi
2222

23-
# Close the loggging output aggain
24-
exec {log_fd}>&-
23+
# Close the logging output again
24+
#exec {log_fd}>&-

tests/unit/test_env.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def test_env():
5858

5959
# all docker output is returned by repo2docker on stderr
6060
# extract just the declare for better failure message formatting
61+
# stdout should be empty
62+
assert not result.stdout
63+
64+
# stderr should contain lines of output
6165
declares = [x for x in result.stderr.split("\n") if x.startswith("declare")]
6266
assert 'declare -x FOO="{}"'.format(ts) in declares
6367
assert 'declare -x BAR="baz"' in declares

0 commit comments

Comments
 (0)