test: Improve golang tests with root and disabling cache

This allows golang tests to be marked as root or !root using build tags.
The matching tests are then run as expected using our test runner.

This also disables test caching which is unfriendly to repeated test
running and is an absurd golang default to add.

Lastly this hooks up the testing verbose flag to tests that accept a
debug variable.

These tests aren't enabled on travis yet because of how it installs
golang.
This commit is contained in:
James Shubin
2018-05-09 12:48:16 -04:00
parent 3ced981d28
commit 22c0ff3cf5
37 changed files with 133 additions and 5 deletions

11
test.sh
View File

@@ -63,11 +63,22 @@ if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL=' -e '^BUILD_TAG=jenkins';
run-testsuite ./test/test-gotest.sh --race
run-testsuite ./test/test-integration.sh
run-testsuite ./test/test-integration.sh --race
# XXX: fix and enable these on travis (sudo: go: command not found)
#run-testsuite ./test/test-gotest.sh --root
#run-testsuite ./test/test-gotest.sh --root --race
#run-testsuite ./test/test-integration.sh --root
#run-testsuite ./test/test-integration.sh --root --race
else
REASON="CI server only test" skip-testsuite ./test/test-shell.sh
REASON="CI server only test" skip-testsuite ./test/test-gotest.sh --race
REASON="CI server only test" skip-testsuite ./test/test-integration.sh
REASON="CI server only test" skip-testsuite ./test/test-integration.sh --race
REASON="CI server only test" skip-testsuite ./test/test-gotest.sh --root
REASON="CI server only test" skip-testsuite ./test/test-gotest.sh --root --race
REASON="CI server only test" skip-testsuite ./test/test-integration.sh --root
REASON="CI server only test" skip-testsuite ./test/test-integration.sh --root --race
fi
run-testsuite ./test/test-gometalinter.sh