Skip to content

Commit

Permalink
br: update code coverage for integration test (#45852)
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer committed Aug 9, 2023
1 parent 1567bb0 commit d8d81eb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion br/tests/_utils/run_br
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

set -eux

br.test -test.coverprofile="$TEST_DIR/cov.$TEST_NAME.$$.out.log" DEVEL "$@" \
br.test -test.coverprofile="$COV_DIR/cov.$TEST_NAME.$$.out.log" DEVEL "$@" \
-L "info" \
--ca "$TEST_DIR/certs/ca.pem" \
--cert "$TEST_DIR/certs/br.pem" \
Expand Down
2 changes: 1 addition & 1 deletion br/tests/_utils/run_lightning
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -eux
cur_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

echo "[$(date)] <<<<<< RUNNING TEST FOR: $cur_dir/../$TEST_NAME $@ >>>>>>" >> "$TEST_DIR/lightning.log"
tidb-lightning.test -test.coverprofile="$TEST_DIR/cov.$TEST_NAME.$$.out" DEVEL \
tidb-lightning.test -test.coverprofile="$COV_DIR/cov.$TEST_NAME.$$.out" DEVEL \
--ca "$TEST_DIR/certs/ca.pem" \
--cert "$TEST_DIR/certs/lightning.pem" \
--key "$TEST_DIR/certs/lightning.key" \
Expand Down
2 changes: 1 addition & 1 deletion br/tests/_utils/run_lightning_ctl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -eux

cur_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

tidb-lightning-ctl.test -test.coverprofile="$TEST_DIR/cov.ctl.$TEST_NAME.$$.out" DEVEL \
tidb-lightning-ctl.test -test.coverprofile="$COV_DIR/cov.ctl.$TEST_NAME.$$.out" DEVEL \
--ca "$TEST_DIR/certs/ca.pem" \
--cert "$TEST_DIR/certs/lightning.pem" \
--key "$TEST_DIR/certs/lightning.key" \
Expand Down
1 change: 1 addition & 0 deletions br/tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -eu
CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
export PATH="$PATH:$CUR/../../bin:$CUR/../bin:$CUR/_utils"
export TEST_DIR=/tmp/backup_restore_test
export COV_DIR="/tmp/group_cover"
source $CUR/_utils/run_services

# Reset TEST_DIR
Expand Down
6 changes: 3 additions & 3 deletions br/tests/run_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ set -eo pipefail
# Step 1
CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
group=$1

export COV_DIR="/tmp/group_cover"
rm -rf COV_DIR
mkdir $COV_DIR

# Define groups
# Note: If new group is added, the group name must also be added to CI
Expand Down Expand Up @@ -65,8 +67,6 @@ elif [[ " ${!groups[*]} " =~ " ${group} " ]]; then
echo "Run cases: ${case_name}"
rm -rf /tmp/backup_restore_test
mkdir -p /tmp/backup_restore_test
rm -rf cover
mkdir cover
TEST_NAME=${case_name} ${CUR}/run.sh
done
fi
Expand Down

0 comments on commit d8d81eb

Please sign in to comment.