From: Vallari Agrawal Date: Wed, 24 Jan 2024 09:03:45 +0000 (+0530) Subject: qa/workunits/rados/test.sh: fix GTEST_OUTPUT path X-Git-Tag: v19.3.0~17^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55297%2Fhead;p=ceph.git qa/workunits/rados/test.sh: fix GTEST_OUTPUT path Currently, GTEST_OUTPUT is hardcoded to '/home/ubuntu/cephtest/archive/gtest_xml_report'. It causes errors on non-ubuntu OS. This PR changes that to instead save all xml outputs to TESTDIR or new tmp directory. This still saves xml files in teuthology archive and fixes potential errors for local test runs on non-ubuntu based OS. Signed-off-by: Vallari Agrawal --- diff --git a/qa/tasks/workunit.py b/qa/tasks/workunit.py index 1876b7842192..f6e55c48cd67 100644 --- a/qa/tasks/workunit.py +++ b/qa/tasks/workunit.py @@ -427,7 +427,7 @@ def _run_tests(ctx, refspec, role, tests, env, basedir, logger=log.getChild(role), args=args + optional_args, label="workunit test {workunit}".format(workunit=workunit), - xml_path_regex=f'{testdir}/archive/gtest_xml_report-*.xml', + xml_path_regex=f'{testdir}/archive/unit_test_xml_report/*.xml', output_yaml=os.path.join(ctx.archive, 'unit_test_summary.yaml'), ) else: diff --git a/qa/workunits/rados/test.sh b/qa/workunits/rados/test.sh index 8d5f40088950..2fbb2124d658 100755 --- a/qa/workunits/rados/test.sh +++ b/qa/workunits/rados/test.sh @@ -12,7 +12,8 @@ function cleanup() { } trap cleanup EXIT ERR HUP INT QUIT -GTEST_OUTPUT="xml:/home/ubuntu/cephtest/archive/gtest_xml_report" +GTEST_OUTPUT_DIR=${TESTDIR:-$(mktemp -d)}/archive/unit_test_xml_report +mkdir -p $GTEST_OUTPUT_DIR declare -A pids @@ -39,7 +40,7 @@ do if [ $parallel -eq 1 ]; then r=`printf '%25s' $f` ff=`echo $f | awk '{print $1}'` - bash -o pipefail -exc "ceph_test_rados_$f --gtest_output=$GTEST_OUTPUT-$f.xml $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" & + bash -o pipefail -exc "ceph_test_rados_$f --gtest_output=xml:$GTEST_OUTPUT_DIR/$f.xml $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" & pid=$! echo "test $f on pid $pid" pids[$f]=$pid