-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip psnotify tests when running in container
[#152736258](https://www.pivotaltracker.com/story/show/152736258)
- Loading branch information
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |