Skip to content

Commit 76cdab3

Browse files
committed
Copy Tempest stestr timing data for reuse
Currently when running Tempest tests multiple times, it always starts without any information. This patch adds a possibility to reuse timing data from the first Tempest run, so it saves time the next run.
1 parent 140b9fe commit 76cdab3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

container-images/tcib/base/os/tempest/run_tempest.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ TEMPEST_ARGS=""
9797
TEMPEST_DEBUG_MODE="${TEMPEST_DEBUG_MODE:-false}"
9898
TEMPEST_CLEANUP="${TEMPEST_CLEANUP:-false}"
9999

100+
TEMPEST_STESTR="$HOMEDIR/openshift/.stestr"
101+
TEMPEST_STESTR_REUSE="$HOMEDIR/.stestr-reuse"
102+
100103
function catch_error_if_debug {
101104
echo "File run_tempest.sh has run into an error!"
102105
sleep infinity
@@ -366,6 +369,11 @@ function run_git_tempest {
366369

367370
mkdir -p ${TEMPEST_LOGS_DIR}
368371

372+
if [ "$(ls -A ${TEMPEST_STESTR_REUSE})" ]; then
373+
echo "Copying timing data for reuse."
374+
cp -rf ${TEMPEST_STESTR_REUSE}/* ${TEMPEST_STESTR}
375+
fi
376+
369377
discover_tempest_config ${TEMPESTCONF_ARGS} ${TEMPESTCONF_OVERRIDES} \
370378
&& tempest run ${TEMPEST_ARGS}
371379
RETURN_VALUE=$?
@@ -414,6 +422,11 @@ function run_rpm_tempest {
414422

415423
mkdir -p ${TEMPEST_LOGS_DIR}
416424

425+
if [ "$(ls -A ${TEMPEST_STESTR_REUSE})" ]; then
426+
echo "Copying timing data for reuse."
427+
cp -rf ${TEMPEST_STESTR_REUSE}/* ${TEMPEST_STESTR}
428+
fi
429+
417430
discover_tempest_config ${TEMPESTCONF_ARGS} ${TEMPESTCONF_OVERRIDES} \
418431
&& tempest run ${TEMPEST_ARGS}
419432
RETURN_VALUE=$?
@@ -454,6 +467,10 @@ function generate_test_results {
454467
echo Copying log files
455468
cp -rf ${TEMPEST_DIR}/* ${TEMPEST_LOGS_DIR}
456469

470+
if [ -z "$(ls -A ${TEMPEST_STESTR_REUSE})" ]; then
471+
cp -rf ${TEMPEST_STESTR}/* ${TEMPEST_STESTR_REUSE}
472+
fi
473+
457474
popd
458475
}
459476

0 commit comments

Comments
 (0)