From 260a76fd9a31b268044cbd84aa09a87c5e776f38 Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Wed, 24 Jan 2024 14:33:45 +0530 Subject: [PATCH] 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 --- qa/tasks/workunit.py | 2 +- qa/workunits/rados/test.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 -- 2.47.3