Skip to content

Commit

Permalink
skip psnotify tests when running in container
Browse files Browse the repository at this point in the history
  • Loading branch information
luan committed Nov 21, 2017
1 parent 63258d4 commit dcb1afc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bin/test-unit
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
#!/bin/bash

running_in_container() {
# look for a non-root cgroup
grep --quiet --invert-match ':/$' /proc/self/cgroup
}

main() {
set -eu -o pipefail -x

go install github.com/cloudfoundry/gosigar/vendor/github.com/onsi/ginkgo/ginkgo

ginkgo -p -r -randomizeAllSpecs -randomizeSuites -keepGoing -race -skipPackage=windows
skip_packages=""

if running_in_container; then
set +x
skip_packages="$skip_packages,psnotify"
echo -e "\e[33mDetected running in container."
echo -e "Cannot run \e[1mpsnotify\e[21m suite because of socket syscall limitations."
echo -e "Skipping...\e[0m"
set -x
fi

ginkgo -p -r -randomizeAllSpecs -randomizeSuites -keepGoing -race -skipPackage=$skip_packages
}

main "$@"

0 comments on commit dcb1afc

Please sign in to comment.