Files
mgmt/test/test-gotest.sh
James Shubin 9f5057eac7 resources: Do not panic on autogrouped graph switches
Graph changes from autogrouped -> not autogrouped or vice versa cause a
panic (or I assume a leak) because we compared the auto grouped graph to
the ungrouped one, which would cause an Exit on an unstarted Vertex.
This includes a test that seems to reliably reproduces the issue.
2017-06-08 01:05:58 -04:00

33 lines
741 B
Bash
Executable File

#!/bin/bash
. test/util.sh
echo "running test-gotest.sh $1"
failures=''
function run-test()
{
$@ || failures=$( [ -n "$failures" ] && echo "$failures\\n$@" || echo "$@" )
}
ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${ROOT}"
base=$(go list .)
for pkg in `go list ./... | grep -v "^${base}/vendor/" | grep -v "^${base}/examples/" | grep -v "^${base}/test/" | grep -v "^${base}/old/" | grep -v "^${base}/tmp/"`; do
echo "Testing: $pkg"
# FIXME: can we capture and output the stderr from these tests too?
run-test go test "$pkg"
if [ "$1" = "--race" ]; then
run-test go test -race "$pkg"
fi
done
if [[ -n "$failures" ]]; then
echo 'FAIL'
echo 'The following `go test` runs have failed:'
echo -e "$failures"
exit 1
fi
echo 'PASS'