From cd88ccd37f98b02917784d24e7c9174e1f93e24f Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 30 Mar 2022 14:57:30 +0200 Subject: [PATCH] `build-logger` tests should not depend on the 'all' target If someone runs `make -j16 test_unit test_analyzer test_web_sqlite`, then the command would spuriously fail due to a filesystem race-condition. The `cp ldlogger build/bin` would basically try to copy a not-yet-existing file, causing a failure immediately, or later in the test pipeline, when it exercises the logger. Causing an error similar to this: ``` make[1]: Leaving directory `codechecker/analyzer' make: *** [test_analyzer] Error 2 make: *** Waiting for unfinished jobs.... ``` Let's work around the issue by omitting the `all` target from the `test*` targets. This way if it's already built, tests should just pass. --- .github/workflows/test.yml | 1 + analyzer/tools/build-logger/tests/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0f80bdb06..240b0e2bf1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: working-directory: analyzer/tools/build-logger run: | pip install -r requirements_py/dev/requirements.txt + make all make test - name: Run merge-clang-extdef-mappings tests diff --git a/analyzer/tools/build-logger/tests/Makefile b/analyzer/tools/build-logger/tests/Makefile index aa93f24117..e9e8ac5580 100644 --- a/analyzer/tools/build-logger/tests/Makefile +++ b/analyzer/tools/build-logger/tests/Makefile @@ -5,9 +5,9 @@ REPO_ROOT ?= REPO_ROOT=$(ROOT) # Nose test runner configuration options. NOSECFG = --config .noserc -test: all pycodestyle pylint test_unit +test: pycodestyle pylint test_unit -test_in_env: all pycodestyle_in_env pylint_in_env test_unit_in_env +test_in_env: pycodestyle_in_env pylint_in_env test_unit_in_env PYCODESTYLE_TEST_CMD = pycodestyle tests/unit