CI: Add valgrind (#2245)

* prepare a test for valgrind by fixing linter issues

* something went wrong

* Try update cereal

* Not working, fixing replay_learning.py

* Testing

* Testing

* Working now

* More logs, a bit of cleaning, still no idea how this works

* Ok got 10% cleaning done

* trying some stackOverflow code

* Lots of cleaning

* wip

* Delete valgrind_testing.py

* Delete replay_learning.py

* Add to CI, cannot fail though

* Add to CI, cannot fail though

* Now the unit test should fail

* Dump valgrind output in case of a failure

* fix subrepos

* fix subs

* hopefully fixes every issue that we have

* wait for message confirmation

* Revert "wait for message confirmation"

This reverts commit ad7ba280ec6536015ac1a442c9732bfe42fd5664.

* fix local issues

* Revert "fix local issues"

This reverts commit 4498df21df471fa6e9360d50407eaefdf24ae69f.

* attempt 3 to fix things

* untested function extraction

* refactor

* add valgrind task

* add delay and BASEDIR

* Make test not fail, it is not designed for that

* fix subrepositories

* fix tests

* Real fix now :)

* scons

* ... stupid CI

* fix valgrind CI

* Update test.yaml

* Update test.yaml

* Update test.yaml

* add valgrind logs as file

* remove delays

* kill process more reliably

* rename action

* small cleanup

* fix casting to int in case of large leaks

Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
grekiki
2020-10-05 16:09:32 +02:00
committed by GitHub
parent a77548bff6
commit a09fd7c860
4 changed files with 131 additions and 0 deletions
+26
View File
@@ -128,6 +128,32 @@ jobs:
- name: pre-commit
run: $RUN "cd /tmp/openpilot/ && git init && git add -A && pre-commit run --all"
valgrind:
name: valgrind
runs-on: ubuntu-16.04
timeout-minutes: 50
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build Docker image
run: eval "$BUILD"
- name: Run valgrind
run: |
$PERSIST "cd /tmp/openpilot && \
scons -j$(nproc) && \
python selfdrive/test/test_valgrind_replay.py"
- name: Print logs
if: always()
run: |
docker cp tmppilot:/tmp/openpilot/selfdrive/test/valgrind_logs.txt valgrind_logs.txt
cat valgrind_logs.txt
- uses: actions/upload-artifact@v2
if: always()
with:
name: valgrind_logs.txt
path: valgrind_logs.txt
unit_tests:
name: unit tests
runs-on: ubuntu-16.04