From c9c6eaa725ed9f2a3c0dd98d844979ccdf358fea Mon Sep 17 00:00:00 2001 From: Aubrey Wahl <10409668+aubsw@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:15:58 -0400 Subject: [PATCH 1/5] test can ignition... --- selfdrive/car/tests/test_models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 53f2bb586d..48b33b42b4 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -243,6 +243,11 @@ class TestCarModelBase(unittest.TestCase): if self.safety.safety_rx_hook(to_send) != 1: failed_addrs[hex(msg.address)] += 1 + if self.CP.brand in ("gm", "mazda", "rivian", "tesla"): + self.assertTrue(self.safety.get_ignition_can()) + else: + self.assertFalse(self.safety.get_ignition_can()) + # ensure all msgs defined in the addr checks are valid self.safety.safety_tick_current_safety_config() if t > 1e6: From e06e1e36199f3542f9be470ad84720a0425bc643 Mon Sep 17 00:00:00 2001 From: Aubrey Wahl <10409668+aubsw@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:16:33 -0400 Subject: [PATCH 2/5] add smol test for can ignition (will delete this later --- .gitmodules | 3 ++- release/check-submodules.sh | 9 +++++++++ selfdrive/car/tests/big_cars_test.sh | 2 +- selfdrive/car/tests/test_models_segs_smol.txt | 7 +++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 selfdrive/car/tests/test_models_segs_smol.txt diff --git a/.gitmodules b/.gitmodules index 54c7393986..06c6a1304a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,8 @@ url = ../../commaai/panda.git [submodule "opendbc"] path = opendbc_repo - url = ../../commaai/opendbc.git + url = https://github.com/aubsw/opendbc.git + branch = ignition-can-move [submodule "msgq"] path = msgq_repo url = ../../commaai/msgq.git diff --git a/release/check-submodules.sh b/release/check-submodules.sh index 93869a7403..2111184505 100755 --- a/release/check-submodules.sh +++ b/release/check-submodules.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -x while read hash submodule ref; do if [ "$submodule" = "tinygrad_repo" ]; then @@ -6,6 +7,14 @@ while read hash submodule ref; do continue fi + if [ "$submodule" = "opendbc_repo" ]; then + git -C $submodule remote show origin + git -C $submodule fetch origin 0c6fd651735615ec9c7f1babb1812addc4994980 + git -C $submodule checkout FETCH_HEAD + echo "$submodule ok (custom Aubrey version)" + continue + fi + git -C $submodule fetch --depth 100 origin master git -C $submodule branch -r --contains $hash | grep "origin/master" if [ "$?" -eq 0 ]; then diff --git a/selfdrive/car/tests/big_cars_test.sh b/selfdrive/car/tests/big_cars_test.sh index 863b8bead0..0bcdb09476 100755 --- a/selfdrive/car/tests/big_cars_test.sh +++ b/selfdrive/car/tests/big_cars_test.sh @@ -7,6 +7,6 @@ cd $BASEDIR export MAX_EXAMPLES=300 export INTERNAL_SEG_CNT=300 export FILEREADER_CACHE=1 -export INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt +export INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs_smol.txt cd selfdrive/car/tests && pytest test_models.py test_car_interfaces.py diff --git a/selfdrive/car/tests/test_models_segs_smol.txt b/selfdrive/car/tests/test_models_segs_smol.txt new file mode 100644 index 0000000000..2b6e5627f5 --- /dev/null +++ b/selfdrive/car/tests/test_models_segs_smol.txt @@ -0,0 +1,7 @@ +# MAZDA CX-5 2022 +066b8ed7a80184fb|2023-06-13--23-33-37--62 +# TESLA AP2 MODEL S +7277bddf4748e615|2023-05-10--10-30-06--11 +# CHEVROLET VOLT PREMIER 2017 +dcaf04bb53a1f9df|2023-06-02--10-08-55--1 +# ...Why is there no Rivian :( From fd5949274bb4a3da75b870c9472192a99edf7b17 Mon Sep 17 00:00:00 2001 From: Aubrey Wahl <10409668+aubsw@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:39:57 -0400 Subject: [PATCH 3/5] apply WIP patches for panda and opendbc --- .github/workflows/selfdrive_tests.yaml | 3 +++ .gitmodules | 3 +-- release/check-submodules.sh | 12 ++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 25fc258634..36ecf29f3f 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -232,6 +232,9 @@ jobs: with: path: .ci_cache/comma_download_cache key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'opendbc/car/tests/routes.py') }}-${{ matrix.job }} + - name: Check submodules + timeout-minutes: 3 + run: release/check-submodules.sh - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" - name: Test car models diff --git a/.gitmodules b/.gitmodules index 06c6a1304a..c56250ab91 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,10 +1,9 @@ [submodule "panda"] path = panda - url = ../../commaai/panda.git + url = https://github.com/aubsw/panda.git [submodule "opendbc"] path = opendbc_repo url = https://github.com/aubsw/opendbc.git - branch = ignition-can-move [submodule "msgq"] path = msgq_repo url = ../../commaai/msgq.git diff --git a/release/check-submodules.sh b/release/check-submodules.sh index 2111184505..4a99c7043c 100755 --- a/release/check-submodules.sh +++ b/release/check-submodules.sh @@ -8,8 +8,16 @@ while read hash submodule ref; do fi if [ "$submodule" = "opendbc_repo" ]; then - git -C $submodule remote show origin - git -C $submodule fetch origin 0c6fd651735615ec9c7f1babb1812addc4994980 + git -C $submodule fetch origin e932b98abd16554246012c79007657d8903805bd + git -C $submodule checkout FETCH_HEAD + cat opendbc_repo/opendbc/safety/tests/libsafety/safety_helpers.py | grep ignition + ls -la opendbc + echo "$submodule ok (custom Aubrey version)" + continue + fi + + if [ "$submodule" = "panda" ]; then + git -C $submodule fetch origin c66e9a46349d152199a4a0997f82f0bea3c9b5a6 git -C $submodule checkout FETCH_HEAD echo "$submodule ok (custom Aubrey version)" continue From 62e5d391b3df67874fc24080068eed36c8347ddc Mon Sep 17 00:00:00 2001 From: Aubrey Wahl <10409668+aubsw@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:44:33 -0400 Subject: [PATCH 4/5] less taxing test --- selfdrive/car/tests/test_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 48b33b42b4..15c233c758 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -243,10 +243,10 @@ class TestCarModelBase(unittest.TestCase): if self.safety.safety_rx_hook(to_send) != 1: failed_addrs[hex(msg.address)] += 1 - if self.CP.brand in ("gm", "mazda", "rivian", "tesla"): - self.assertTrue(self.safety.get_ignition_can()) - else: - self.assertFalse(self.safety.get_ignition_can()) + if self.CP.brand in ("gm", "mazda", "rivian", "tesla"): + self.assertTrue(self.safety.get_ignition_can()) + else: + self.assertFalse(self.safety.get_ignition_can()) # ensure all msgs defined in the addr checks are valid self.safety.safety_tick_current_safety_config() From 9d681db03f12f87b899b0187c310e4dd6bc764a1 Mon Sep 17 00:00:00 2001 From: Aubrey Wahl <10409668+aubsw@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:57:34 -0400 Subject: [PATCH 5/5] long test, not negative test --- .github/workflows/selfdrive_tests.yaml | 5 +---- selfdrive/car/tests/test_models.py | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 36ecf29f3f..38c0d395c9 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -238,13 +238,10 @@ jobs: - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" - name: Test car models - timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 6 }} + timeout-minutes: 15 run: | ${{ env.RUN }} "MAX_EXAMPLES=1 $PYTEST selfdrive/car/tests/test_models.py && \ chmod -R 777 /tmp/comma_download_cache" - env: - NUM_JOBS: 4 - JOB_ID: ${{ matrix.job }} - name: "Upload coverage to Codecov" uses: codecov/codecov-action@v4 with: diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 15c233c758..d1d56f8c5a 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -243,10 +243,8 @@ class TestCarModelBase(unittest.TestCase): if self.safety.safety_rx_hook(to_send) != 1: failed_addrs[hex(msg.address)] += 1 - if self.CP.brand in ("gm", "mazda", "rivian", "tesla"): - self.assertTrue(self.safety.get_ignition_can()) - else: - self.assertFalse(self.safety.get_ignition_can()) + if self.CP.brand not in ("gm", "mazda", "rivian", "tesla"): + self.assertFalse(self.safety.get_ignition_can()) # ensure all msgs defined in the addr checks are valid self.safety.safety_tick_current_safety_config()