test: Add in_ci utility test function
in_ci checks for environment variables set by a selection of CI systems and returns true if the test appears to be running in CI. Additionally it can test for specific CI systems, and returns true if the CI system is listed. Deduplicate existing environment checks for Travis and Jenkins. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
@@ -8,7 +8,7 @@ cd "${ROOT}"
|
||||
. test/util.sh
|
||||
|
||||
# travis is slow for some reason
|
||||
if env | grep -q -e '^TRAVIS=true$'; then
|
||||
if in_ci travis; then
|
||||
export GO_TEST_TIMEOUT_SCALE=3
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user