Clean up convert-trs-to-junit.py invocations

- Use absolute paths when invoking the convert-trs-to-junit.py script
    so that it also works correctly for out-of-tree and tarball-based
    test jobs.

  - Quote the variables used in convert-trs-to-junit.py invocations to
    future-proof the code.

  - Use "&&" instead of ";" in shell pipelines invoking the
    convert-trs-to-junit.py script in order to prevent "source" errors
    from being silently ignored.

  - Ensure convert-trs-to-junit.py is invoked from the correct directory
    for out-of-tree and tarball-based unit test jobs by adding
    appropriate "cd" invocations.

  - Ensure the convert-trs-to-junit.py invocations are always the last
    step in each 'after_script', in order to run that script from the
    correct directory for out-of-tree and tarball-based system test jobs
    and to ensure that any potential errors in that script do not
    prevent more important steps in the 'after_script' from being
    executed.

(cherry picked from commit 2cd20ee370)
This commit is contained in:
Michał Kępień 2022-06-22 12:59:33 +02:00
parent 024d1980dd
commit 3777b4b6c0

View file

@ -302,10 +302,10 @@ 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:
- (source bin/tests/system/conf.sh; $PYTHON bin/tests/convert-trs-to-junit.py . > junit.xml)
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- test -d bind-* && cd bind-*
- 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")
.system_test: &system_test_job
<<: *system_test_common
@ -328,7 +328,7 @@ 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 bin/tests/convert-trs-to-junit.py . > junit.xml)
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
artifacts:
expire_in: "1 day"
untracked: true
@ -344,7 +344,9 @@ stages:
script:
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
after_script:
- (source bin/tests/system/conf.sh; $PYTHON bin/tests/convert-trs-to-junit.py . > junit.xml)
- 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")
.unit_test: &unit_test_job
<<: *unit_test_common
@ -366,7 +368,7 @@ stages:
<<: *unit_test_common
after_script:
- find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
- (source bin/tests/system/conf.sh; $PYTHON bin/tests/convert-trs-to-junit.py . > junit.xml)
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
artifacts:
expire_in: "1 day"
paths: