mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +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
|
#!/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
|
||||||
|
Loading…
Reference in New Issue
Block a user