]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test.sh: fix GTEST_OUTPUT path 55297/head
authorVallari Agrawal <val.agl002@gmail.com>
Wed, 24 Jan 2024 09:03:45 +0000 (14:33 +0530)
committerVallari Agrawal <val.agl002@gmail.com>
Wed, 24 Jan 2024 09:35:52 +0000 (15:05 +0530)
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 <val.agl002@gmail.com>
qa/tasks/workunit.py
qa/workunits/rados/test.sh

index 1876b7842192143be3128483fc289acaa4248635..f6e55c48cd674e53ac1903073f4c5796ba037fdc 100644 (file)
@@ -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:
index 8d5f40088950d31fda2acf286ffef76c31cef511..2fbb2124d658fa8c2dd2d9db89068119d8f1249b 100755 (executable)
@@ -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