From ebb2c40095f1c4e5cb95eaf8bd4e3d6a90ca7394 Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Mon, 6 Nov 2023 13:58:08 +0800 Subject: [PATCH] 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 --- tests/coverage4gotest.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/coverage4gotest.sh b/tests/coverage4gotest.sh index d1d6f0d5f..d54958797 100755 --- a/tests/coverage4gotest.sh +++ b/tests/coverage4gotest.sh @@ -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