collect C++ code coverage (#23619)

* collect cpp coverage

* install llvm

* compile with coverage

* cd to root

* remove broken gcda files

* remove newline

* delete more stuff

* script to collect coverage

* Update tools/collect_coverage.sh

* actually delete
This commit is contained in:
Willem Melching
2022-01-25 23:15:24 +01:00
committed by GitHub
parent ea2da86e81
commit 698ab6ac97
6 changed files with 46 additions and 10 deletions
+11 -9
View File
@@ -209,7 +209,7 @@ jobs:
run: eval "$BUILD"
- name: Run valgrind
run: |
${{ env.RUN }} "scons -j$(nproc) && \
${{ env.RUN }} "scons -j$(nproc) --coverage && \
FILEREADER_CACHE=1 python selfdrive/test/test_valgrind_replay.py"
- name: Print logs
if: always()
@@ -244,7 +244,7 @@ jobs:
run: eval "$BUILD"
- name: Run unit tests
run: |
${{ env.RUN }} "scons -j$(nproc) --test && \
${{ env.RUN }} "scons -j$(nproc) --test --coverage && \
coverage run selfdrive/test/test_fingerprints.py && \
$UNIT_TEST common && \
$UNIT_TEST opendbc/can && \
@@ -265,7 +265,7 @@ jobs:
./selfdrive/proclogd/tests/test_proclog && \
./selfdrive/ui/replay/tests/test_replay && \
./selfdrive/camerad/test/ae_gray_test && \
coverage xml"
tools/collect_coverage.sh"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
@@ -299,9 +299,9 @@ jobs:
run: eval "$BUILD"
- name: Run replay
run: |
${{ env.RUN }} "scons -j$(nproc) && \
${{ env.RUN }} "scons -j$(nproc) --coverage && \
FILEREADER_CACHE=1 CI=1 coverage run selfdrive/test/process_replay/test_processes.py && \
coverage xml"
tools/collect_coverage.sh"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
- name: Print diff
@@ -354,10 +354,12 @@ jobs:
- name: Test longitudinal
run: |
${{ env.RUN }} "mkdir -p selfdrive/test/out && \
scons -j$(nproc) && \
scons -j$(nproc) --coverage && \
cd selfdrive/test/longitudinal_maneuvers && \
coverage run ./test_longitudinal.py && \
coverage xml"
coverage xml && \
cd ../../.. && \
tools/collect_coverage.sh"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
- uses: actions/upload-artifact@v2
@@ -401,9 +403,9 @@ jobs:
run: eval "$BUILD"
- name: Test car models
run: |
${{ env.RUN }} "scons -j$(nproc) --test && \
${{ env.RUN }} "scons -j$(nproc) --test --coverage && \
FILEREADER_CACHE=1 coverage run -m pytest selfdrive/test/test_models.py && \
coverage xml && \
tools/collect_coverage.sh && \
chmod -R 777 /tmp/comma_download_cache"
env:
NUM_JOBS: 4