* Document extractor service * Fixing vendor modules * Addressing PR Review comments * Some small simplifications * Fixing a linter complain * simplifying a bit the code using package variables Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
18 строки
649 B
Bash
18 строки
649 B
Bash
#!/bin/bash
|
|
|
|
# Run test coverage on each subdirectory and merge the coverage profile.
|
|
echo "mode: count" > target/report/profile.cov
|
|
|
|
# Standard go tooling behavior is to ignore dirs with leading underscors
|
|
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); do
|
|
if ls $dir/*.go &> /dev/null; then
|
|
go test -covermode=count -coverprofile=$dir/profile.tmp $dir
|
|
if [ -f $dir/profile.tmp ]; then
|
|
cat $dir/profile.tmp | tail -n +2 >> target/report/profile.cov
|
|
rm $dir/profile.tmp
|
|
fi
|
|
fi
|
|
done
|
|
go tool cover -html target/report/profile.cov -o target/report/coverage.html
|
|
|