Commit a1651414 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for more robust output formatting

parent caf4d3c9
...@@ -2,16 +2,19 @@ info() { ...@@ -2,16 +2,19 @@ info() {
echo " $*" echo " $*"
} }
# sed has a problem with the huge build output from npm 3 # format output on both OSX and Ubuntu, cedar-10 and cedar-14, while also splitting to a log file
# try awk? awk '{ print " " $0 }'
output() { output() {
local logfile="$1" local logfile="$1"
local c='s/^/ /' local c='s/^/ /'
case $(uname) in if [ "${STACK:-cedar-14}" = "cedar" ]; then
Darwin) tee -a "$logfile" | awk '{ print " " $0 }';; tee -a "$logfile" | awk -W interactive '{ print " " $0 }'
*) tee -a "$logfile" | awk -W interactive '{ print " " $0 }';; else
esac case $(uname) in
Darwin) sed -l "$c" | tee -i -a "$logfile" 2> /dev/null;;
*) stdbuf -oL -eL sed -u "$c" | tee -i -a "$logfile" 2> /dev/null;;
esac
fi
} }
header() { header() {
......
...@@ -2,12 +2,12 @@ test: test-cedar-14 test-cedar-10 ...@@ -2,12 +2,12 @@ test: test-cedar-14 test-cedar-10
test-cedar-14: test-cedar-14:
@echo "Running tests in docker (cedar-14)..." @echo "Running tests in docker (cedar-14)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it heroku/cedar:14 bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;' @docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=cedar-14" heroku/cedar:14 bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@echo "" @echo ""
test-cedar-10: test-cedar-10:
@echo "Running tests in docker (cedar)..." @echo "Running tests in docker (cedar)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it fabiokung/cedar bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;' @docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=cedar" fabiokung/cedar bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
shell: shell:
@echo "Opening cedar-14 shell..." @echo "Opening cedar-14 shell..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment