Skip to content

Commit 536513b

Browse files
authored
[topsrider] add Topsrider coverage (DeepLink-org#901)
* add Topsrider coverage
1 parent 2ccfbab commit 536513b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ jobs:
399399
run: |
400400
set -e
401401
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${BUILD_TEST1} && cp -R source ${BUILD_TEST1} && cd ${BUILD_TEST1}
402+
export USE_COVERAGE=ON
402403
export DIOPI_BUILD_TESTRT=ON
403404
cd impl && mkdir lib
404405
cp -R /home/deeplink/*.so lib/
@@ -419,6 +420,15 @@ jobs:
419420
ln -sf /mnt/cache/share/deeplinkci/data/inputs ./cache/diopi && ln -sf /mnt/cache/share/deeplinkci/data/outputs ./cache/diopi && ln -sf /mnt/cache/share/deeplinkci/data/diopi_case_items.cfg ./cache/diopi
420421
python main.py --mode gen_case --impl_folder ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1}/impl/topsrider/
421422
python main.py --mode run_test
423+
if [ "${ALL_COVERAGE}" = "ON" ]; then
424+
bash /mnt/cache/share/platform/dep/sonar/coverage_DIOPI.sh ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} || echo "get coverage fail"
425+
fi
426+
- name: increment coverage check
427+
if: ${{ contains( github.event_name, 'pull_request' ) && contains( github.base_ref, 'main' ) }}
428+
run: |
429+
set -e
430+
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1}
431+
bash scripts/increment_coverage.sh ${REQUIRE_COVERAGE}
422432
423433
# Rt-Test-Topsrider:
424434
# name: Rt-Test-Topsrider

impl/scripts/build_impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ case $1 in
1212
mkdir -p build && cd build
1313
# do not use && between cmake and make -j, because the cmake error will not incur error exit (return code is 0) in switch case statementts.
1414
cmake -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") .. -DIMPL_OPT=tops -DTEST=ON -DCMAKE_BUILD_TYPE=Debug \
15-
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTOPS_HOME=/home/cse/src/install/usr
15+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTOPS_HOME=/home/cse/src/install/usr -DENABLE_COVERAGE=${USE_COVERAGE}
1616
make -j8
1717
;;
1818
clean)

0 commit comments

Comments
 (0)