Use absolute path for the profile.cov (#19535)

There's a path change introduced by #19508 which may impact showing the
coverage on codecov.
This commit makes sure the profile.cov is referenced as absolute path in
`coverage4gotest.sh`

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
Daniel Jiang 2023-11-06 13:58:08 +08:00 committed by GitHub
parent e1a44232f4
commit ebb2c40095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,10 @@
#!/bin/bash #!/bin/bash
set -x set -x
set -e set -e
echo "mode: set" >>profile.cov profile_path=$(pwd)/profile.cov
echo "profile.cov path: $profile_path"
echo "mode: set" >>"$profile_path"
deps="" deps=""
cd $(dirname $(find . -name go.mod)) cd $(dirname $(find . -name go.mod))
@ -33,7 +36,7 @@ do
go test -race -v -cover -coverprofile=profile.tmp -coverpkg "$deps" $package go test -race -v -cover -coverprofile=profile.tmp -coverpkg "$deps" $package
if [ -f profile.tmp ] if [ -f profile.tmp ]
then then
cat profile.tmp | tail -n +2 >> profile.cov cat profile.tmp | tail -n +2 >> "$profile_path"
rm profile.tmp rm profile.tmp
fi fi
done done