From c46ad4aec293b14dc109f4b3a9c83243ca42cc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Fri, 22 Apr 2022 17:35:56 +0200 Subject: [PATCH 1/2] Fix JUnit test status generator for out-of-tree system tests - Use separate paths for tests results and test script - For tarball tests include the conversion script in the `make dist` --- .gitlab-ci.yml | 27 +++++++++++++++++++++------ bin/tests/Makefile.am | 2 ++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9874ff4ed0..a795362092 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -241,6 +241,11 @@ stages: $EXTRA_CONFIGURE || (test -s config.log && cat config.log; exit 1) +# change directory to the workspace before including this +.find_python: &find_python + - PYTHON="$(source bin/tests/system/conf.sh; echo $PYTHON)" + - test -x "$PYTHON" + .check_readline_setup: &check_readline_setup - if [[ -n "${WITHOUT_READLINE}" ]]; then ! grep "^#define HAVE_READLINE" config.h; @@ -305,10 +310,13 @@ stages: - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 - if git rev-parse > /dev/null 2>&1; then ( ! grep "^I:.*:file.*not removed$" *.log ); fi after_script: - - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - test -d bind-* && cd bind-* + - REALSOURCEDIR="$PWD" + - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - cat bin/tests/system/test-suite.log - - (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml") + - *find_python + - > + "$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml .system_test: &system_test_job <<: *system_test_common @@ -331,7 +339,9 @@ stages: after_script: - cat bin/tests/system/test-suite.log - find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \; - - (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml") + - *find_python + - > + "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: expire_in: "1 day" untracked: true @@ -347,9 +357,12 @@ stages: script: - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 after_script: - - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" - test -d bind-* && cd bind-* - - (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml") + - REALSOURCEDIR="$PWD" + - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}" + - *find_python + - > + "$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml .unit_test: &unit_test_job <<: *unit_test_common @@ -371,7 +384,9 @@ stages: <<: *unit_test_common after_script: - find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \; - - (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml") + - *find_python + - > + "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: expire_in: "1 day" paths: diff --git a/bin/tests/Makefile.am b/bin/tests/Makefile.am index cde8467e55..56e81b118a 100644 --- a/bin/tests/Makefile.am +++ b/bin/tests/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/Makefile.top +EXTRA_DIST = convert-trs-to-junit.py + SUBDIRS = system noinst_PROGRAMS = \ From 8d095550a8ebf70cc33953a2dd2f7bf150c900dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Wed, 1 Jun 2022 13:46:02 +0200 Subject: [PATCH 2/2] Unify Python interpreter used by TSAN and JUnit helpers Reportedly we don't have python2-enabled TSAN builds, so we can remove one more hardcoded python3 call from .gitlab-ci.yaml. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a795362092..6c14c941b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -338,8 +338,8 @@ stages: <<: *system_test_common after_script: - cat bin/tests/system/test-suite.log - - find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \; - *find_python + - find bin -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \; - > "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: @@ -383,8 +383,8 @@ stages: .unit_test_tsan: &unit_test_tsan_job <<: *unit_test_common after_script: - - find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \; - *find_python + - find lib -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \; - > "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml artifacts: