mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
ci: no-exit: Do not run no-exit check on test files
The test files do not have access to our app level exit() function, and are thus OK to call os.Exit() if they need. Skip them from the check. Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
parent
62495d45be
commit
031632d5b0
@ -15,12 +15,10 @@ echo "Checking for no os.Exit() calls for package [${go_packages}]"
|
|||||||
candidates=`go list -f '{{.Dir}}/*.go' $go_packages`
|
candidates=`go list -f '{{.Dir}}/*.go' $go_packages`
|
||||||
for f in $candidates; do
|
for f in $candidates; do
|
||||||
filename=`basename $f`
|
filename=`basename $f`
|
||||||
|
# skip all go test files
|
||||||
|
[[ $filename == *_test.go ]] && continue
|
||||||
# skip exit.go where, the only file we should call os.Exit() from.
|
# skip exit.go where, the only file we should call os.Exit() from.
|
||||||
[[ $filename == "exit.go" ]] && continue
|
[[ $filename == "exit.go" ]] && continue
|
||||||
# skip exit_test.go
|
|
||||||
[[ $filename == "exit_test.go" ]] && continue
|
|
||||||
# skip main_test.go
|
|
||||||
[[ $filename == "main_test.go" ]] && continue
|
|
||||||
files="$f $files"
|
files="$f $files"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user