mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
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:
parent
e1a44232f4
commit
ebb2c40095
@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
set -e
|
||||
echo "mode: set" >>profile.cov
|
||||
profile_path=$(pwd)/profile.cov
|
||||
echo "profile.cov path: $profile_path"
|
||||
|
||||
echo "mode: set" >>"$profile_path"
|
||||
|
||||
deps=""
|
||||
cd $(dirname $(find . -name go.mod))
|
||||
@ -33,7 +36,7 @@ do
|
||||
go test -race -v -cover -coverprofile=profile.tmp -coverpkg "$deps" $package
|
||||
if [ -f profile.tmp ]
|
||||
then
|
||||
cat profile.tmp | tail -n +2 >> profile.cov
|
||||
cat profile.tmp | tail -n +2 >> "$profile_path"
|
||||
rm profile.tmp
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user