import os
import random
import string
+import datetime
+import uuid
from teuthology import misc as teuthology
from teuthology import contextutil
attrs += ['not sse_s3']
attrs += client_config.get('extra_attrs', [])
- args += ['tox', '--', '-v', '-m', ' and '.join(attrs)]
- args += client_config.get('extra_args', [])
-
- toxvenv_sh(ctx, remote, args, label="s3 tests against rgw")
+ if 'unit_test_scan' in client_config and client_config['unit_test_scan']:
+ xmlfile_id = datetime.datetime.now().strftime("%Y-%m-%d-%H:%M:%S--") + str(uuid.uuid4())
+ xmlpath= f'{testdir}/archive/s3test-{xmlfile_id}.xml'
+ args += ['tox', '--', '-v', f'--junitxml={xmlpath}', '-m', ' and '.join(attrs)]
+ args += client_config.get('extra_args', [])
+ activate = get_toxvenv_dir(ctx) + '/bin/activate'
+ remote.run_unit_test(
+ args=['source', activate, run.Raw('&&')] + args,
+ label="s3 tests against rgw",
+ xml_path_regex=f'{testdir}/archive/s3test-*.xml',
+ output_yaml=os.path.join(ctx.archive, 'unit_test_summary.yaml'),
+ )
+ else:
+ args += ['tox', '--', '-v', '-m', ' and '.join(attrs)]
+ args += client_config.get('extra_args', [])
+ toxvenv_sh(ctx, remote, args, label="s3 tests against rgw")
yield
@contextlib.contextmanager
workunit=workunit,
),
])
- remote.run(
- logger=log.getChild(role),
- args=args + optional_args,
- label="workunit test {workunit}".format(workunit=workunit)
- )
+ if 'unit_test_scan' in optional_args:
+ optional_args.remove('unit_test_scan')
+ remote.run_unit_test(
+ 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',
+ output_yaml=os.path.join(ctx.archive, 'unit_test_summary.yaml'),
+ )
+ else:
+ remote.run(
+ logger=log.getChild(role),
+ args=args + optional_args,
+ label="workunit test {workunit}".format(workunit=workunit)
+ )
if cleanup:
args=['sudo', 'rm', '-rf', '--', scratch_tmp]
remote.run(logger=log.getChild(role), args=args, timeout=(60*60))
}
trap cleanup EXIT ERR HUP INT QUIT
+GTEST_OUTPUT="xml:/home/ubuntu/cephtest/archive/gtest_xml_report"
+
declare -A pids
for f in \
if [ $parallel -eq 1 ]; then
r=`printf '%25s' $f`
ff=`echo $f | awk '{print $1}'`
- bash -o pipefail -exc "ceph_test_rados_$f $color 2>&1 | tee ceph_test_rados_$ff.log | sed \"s/^/$r: /\"" &
+ 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: /\"" &
pid=$!
echo "test $f on pid $pid"
pids[$f]=$pid