mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-22 08:44:25 +01: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:
@@ -15,12 +15,10 @@ echo "Checking for no os.Exit() calls for package [${go_packages}]"
|
||||
candidates=`go list -f '{{.Dir}}/*.go' $go_packages`
|
||||
for f in $candidates; do
|
||||
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.
|
||||
[[ $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"
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user