Skip to content

Commit 260a76f

Browse files
committed
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 <[email protected]>
1 parent 035b9e6 commit 260a76f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

qa/tasks/workunit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def _run_tests(ctx, refspec, role, tests, env, basedir,
427427
logger=log.getChild(role),
428428
args=args + optional_args,
429429
label="workunit test {workunit}".format(workunit=workunit),
430-
xml_path_regex=f'{testdir}/archive/gtest_xml_report-*.xml',
430+
xml_path_regex=f'{testdir}/archive/unit_test_xml_report/*.xml',
431431
output_yaml=os.path.join(ctx.archive, 'unit_test_summary.yaml'),
432432
)
433433
else:

qa/workunits/rados/test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ function cleanup() {
1212
}
1313
trap cleanup EXIT ERR HUP INT QUIT
1414

15-
GTEST_OUTPUT="xml:/home/ubuntu/cephtest/archive/gtest_xml_report"
15+
GTEST_OUTPUT_DIR=${TESTDIR:-$(mktemp -d)}/archive/unit_test_xml_report
16+
mkdir -p $GTEST_OUTPUT_DIR
1617

1718
declare -A pids
1819

@@ -39,7 +40,7 @@ do
3940
if [ $parallel -eq 1 ]; then
4041
r=`printf '%25s' $f`
4142
ff=`echo $f | awk '{print $1}'`
42-
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: /\"" &
43+
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: /\"" &
4344
pid=$!
4445
echo "test $f on pid $pid"
4546
pids[$f]=$pid

0 commit comments

Comments
 (0)