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>
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:
}
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
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