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:
Joe Groocock
2021-02-12 14:40:47 +00:00
parent 6a61774fb7
commit 5af1dcb8b1
8 changed files with 36 additions and 21 deletions

View File

@@ -4,7 +4,7 @@
exit 0 # TODO: this test needs to be update to use deploys instead
#if env | grep -q -e '^TRAVIS=true$'; then
#if in_ci; then
# # inotify doesn't seem to work properly on travis
# echo "Travis and Jenkins give wonky results here, skipping test!"
# exit