Add CLI tests for mqtrigger/timetrigger (#2872)

* Add tests for mqtrigger/timetrigger
* Change command to run tests
* correct coverage command
* update coverpkg

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2023-11-13 17:14:47 +05:30
committed by GitHub
parent 2e4825def0
commit 57b537f09e
4 changed files with 160 additions and 12 deletions
+10 -8
View File
@@ -34,11 +34,13 @@ export KUBEBUILDER_ASSETS
# The executor unit test only works with NodePort-type services for
# now. So disable it for our travis ci tests except some partial tests.
for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v 'benchmark'); do
echo "Running tests in $d"
go test -race -v -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
# for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v 'benchmark'); do
# echo "Running tests in $d"
# go test -race -v -coverprofile=profile.out -covermode=atomic $d
# if [ -f profile.out ]; then
# cat profile.out >> coverage.txt
# rm profile.out
# fi
# done
echo "Running tests ..."
go test -race -v -coverprofile=coverage.txt -covermode=atomic --coverpkg=./... ./...