Skip to content

Commit

Permalink
Use absolute path for the profile.cov
Browse files Browse the repository at this point in the history
There's a path change introduced by goharbor#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>
  • Loading branch information
reasonerjt committed Nov 6, 2023
1 parent 3f7c605 commit eb45947
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/coverage4gotest.sh
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -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

0 comments on commit eb45947

Please sign in to comment.