From a7acb77889326a2044eb7fd777650d71822ee590 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 14 Dec 2017 08:26:09 -0800 Subject: [PATCH 1/3] fix empty continuation line docker error I believe this is actually a bug in docker but it's easier to fix it ourselves here. License: MIT Signed-off-by: Steven Allen --- Dockerfile.fast | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.fast b/Dockerfile.fast index 28dd292b8fe..9b714223638 100644 --- a/Dockerfile.fast +++ b/Dockerfile.fast @@ -44,8 +44,7 @@ RUN set -x \ && cd /tmp \ && wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \ && chmod +x tini \ - # Install them - && mv su-exec/su-exec tini /sbin/ + && mv su-exec/su-exec tini /sbin/ # Install them # Ports for Swarm TCP, Swarm uTP, API, Gateway, Swarm Websockets EXPOSE 4001 From de02525594ba8da860517fbf03428fc93adcce04 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 14 Dec 2017 08:37:27 -0800 Subject: [PATCH 2/3] strip ANSI sequences from docker build output sharness was failing because an ANSI reset sequence was getting inserted at the beginning of the line. License: MIT Signed-off-by: Steven Allen --- test/ipfs-test-lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/ipfs-test-lib.sh b/test/ipfs-test-lib.sh index c2e804a2bcd..fc856df47df 100644 --- a/test/ipfs-test-lib.sh +++ b/test/ipfs-test-lib.sh @@ -1,5 +1,9 @@ # Generic test functions for go-ipfs +ansi_strip() { + sed 's/\x1b\[[0-9;]*m//g' +} + # Quote arguments for sh eval shellquote() { _space='' @@ -48,7 +52,7 @@ test_path_cmp() { # This takes a Dockerfile, and a build context directory docker_build() { - docker build --rm -f "$1" "$2" + docker build --rm -f "$1" "$2" | ansi_strip } # This takes an image as argument and writes a docker ID on stdout From af21ae129dc6259f51c0a795b9c9e22124165124 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 14 Dec 2017 08:41:57 -0800 Subject: [PATCH 3/3] politely ask programs to not print ANSI codes by setting TERM to dumb License: MIT Signed-off-by: Steven Allen --- test/sharness/lib/test-lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 1084d99d413..bddfdd538df 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -43,6 +43,8 @@ SHARNESS_LIB="lib/sharness/sharness.sh" # Make sure the ipfs path is set, also set in test_init_ipfs but that # is not always used. export IPFS_PATH="$(pwd)/.ipfs" +# Ask programs to please not print ANSI codes +export TERM=dumb TEST_OS="$(uname -s | tr '[a-z]' '[A-Z]')"