From 698d17e02127498181c97be8ef2e380c887e944f Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Mon, 22 Apr 2024 10:28:53 -0700 Subject: [PATCH] fix inconsistent misra mutation tests (#1935) * revert * fix --- .github/workflows/test.yaml | 2 +- Dockerfile | 2 ++ tests/misra/install.sh | 1 - tests/misra/test_misra.sh | 2 +- tests/misra/test_mutation.py | 3 ++- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ffe597abfc..1319ebaf20 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -103,7 +103,7 @@ jobs: timeout-minutes: 1 run: ${{ env.RUN }} "cd tests/misra && ./test_misra.sh" - name: MISRA mutation tests - timeout-minutes: 4 + timeout-minutes: 5 run: ${{ env.RUN }} "cd tests/misra && pytest -n8 test_mutation.py" python_linter: diff --git a/Dockerfile b/Dockerfile index 63601740e6..ffd5a00a81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,8 @@ RUN pyenv install 3.11.4 && \ ENV CPPCHECK_DIR=/tmp/cppcheck COPY tests/misra/install.sh /tmp/ RUN /tmp/install.sh +# don't try to install again +ENV SKIP_CPPCHECK_INSTALL=1 RUN git config --global --add safe.directory /tmp/openpilot/panda RUN cd /tmp && \ diff --git a/tests/misra/install.sh b/tests/misra/install.sh index 6a8a9acb3e..8b264aa61b 100755 --- a/tests/misra/install.sh +++ b/tests/misra/install.sh @@ -11,7 +11,6 @@ fi cd $CPPCHECK_DIR VERS="2.13.4" -git remote prune origin git fetch --all --tags git checkout $VERS git cherry-pick -n f6b538e855f0bacea33c4074664628024ef39dc6 b11b42087ff29569bc3740f5aa07eb6616ea4f63 diff --git a/tests/misra/test_misra.sh b/tests/misra/test_misra.sh index 482eba2414..982a62e740 100755 --- a/tests/misra/test_misra.sh +++ b/tests/misra/test_misra.sh @@ -10,7 +10,7 @@ NC='\033[0m' : "${CPPCHECK_DIR:=$DIR/cppcheck/}" # install cppcheck if missing -if [ -z "${SKIP_BUILD}" ]; then +if [ -z "${SKIP_CPPCHECK_INSTALL}" ]; then $DIR/install.sh fi diff --git a/tests/misra/test_mutation.py b/tests/misra/test_mutation.py index cf23cf8c65..06ce266e8f 100755 --- a/tests/misra/test_mutation.py +++ b/tests/misra/test_mutation.py @@ -21,7 +21,8 @@ 'board/flasher.h', 'board/bootstub.c', 'board/bootstub_declarations.h', - 'board/stm32f4/llflash.h' + 'board/stm32h7/llflash.h', + 'board/stm32f4/llflash.h', ) mutations = [