Message ID | 20220627222256.14175-7-ddiss@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | check: add option to rerun failed tests | expand |
On Tue, Jun 28, 2022 at 12:22:56AM +0200, David Disseldorp wrote: > These files would otherwise be overwritten. > > Signed-off-by: David Disseldorp <ddiss@suse.de> Why not fold this into the previous patch? --D > --- > check | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/check b/check > index 726c83d9..baf336da 100755 > --- a/check > +++ b/check > @@ -570,8 +570,17 @@ _stash_test_status() { > "$report_msg" > fi > > - # only stash result for first failure (triggering loop) > - ((loop_num > 1)) && return > + if ((loop_num > 0)); then > + # retain files which would be overwritten in subsequent reruns > + for i in "${REPORT_DIR}/${test_seq}.full" \ > + "${REPORT_DIR}/${test_seq}.dmesg" \ > + "${REPORT_DIR}/${test_seq}.out.bad"; do > + [ -f "$i" ] || continue > + cp "$i" "${i}.rerun$((loop_num - 1))" > + done > + # only stash result for first failure (triggering loop) > + ((loop_num != 1)) && return > + fi > > case "$test_status" in > fail) > -- > 2.35.3 >
On Tue, 28 Jun 2022 08:16:08 -0700, Darrick J. Wong wrote: > On Tue, Jun 28, 2022 at 12:22:56AM +0200, David Disseldorp wrote: > > These files would otherwise be overwritten. > > > > Signed-off-by: David Disseldorp <ddiss@suse.de> > > Why not fold this into the previous patch? Gladly. Will do so in a subsequent round. Cheers, David
diff --git a/check b/check index 726c83d9..baf336da 100755 --- a/check +++ b/check @@ -570,8 +570,17 @@ _stash_test_status() { "$report_msg" fi - # only stash result for first failure (triggering loop) - ((loop_num > 1)) && return + if ((loop_num > 0)); then + # retain files which would be overwritten in subsequent reruns + for i in "${REPORT_DIR}/${test_seq}.full" \ + "${REPORT_DIR}/${test_seq}.dmesg" \ + "${REPORT_DIR}/${test_seq}.out.bad"; do + [ -f "$i" ] || continue + cp "$i" "${i}.rerun$((loop_num - 1))" + done + # only stash result for first failure (triggering loop) + ((loop_num != 1)) && return + fi case "$test_status" in fail)
These files would otherwise be overwritten. Signed-off-by: David Disseldorp <ddiss@suse.de> --- check | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)