* [PATCH] perf-lib: fix missing test titles in output
@ 2022-06-16 7:09 Jeff King
2022-06-16 13:03 ` Derrick Stolee
0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2022-06-16 7:09 UTC (permalink / raw)
To: git; +Cc: Neeraj Singh
Commit 5dccd9155f (t/perf: add iteration setup mechanism to perf-lib,
2022-04-04) modified the parameter parsing of test_wrapper() such that
the test title was no longer in $1, and is instead in $test_title_.
We correctly pass the new variable to the code which outputs the title
to the log, but missed the spot in test_wrapper() where the title is
written to the ".descr" file which is used to produce the final output
table. As a result, all of the titles are missing from that table (or
worse, using whatever was left in $1):
$ ./p0000-perf-lib-sanity.sh
[...]
Test this tree
------------------------------
0000.1: 0.01(0.01+0.00)
0000.2: 0.01(0.00+0.01)
0000.4: 0.00(0.00+0.00)
0000.5: true 0.00(0.00+0.00)
0000.7: 0.00(0.00+0.00)
0000.8: 0.00(0.00+0.00)
After this patch, we get the pre-5dccd9155f output:
Test this tree
--------------------------------------------------------------------------
0000.1: test_perf_default_repo works 0.00(0.00+0.00)
0000.2: test_checkout_worktree works 0.01(0.00+0.01)
0000.4: export a weird var 0.00(0.00+0.00)
0000.5: éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś 0.00(0.00+0.00)
0000.7: important variables available in subshells 0.00(0.00+0.00)
0000.8: test-lib-functions correctly loaded in subshells 0.00(0.00+0.00)
Signed-off-by: Jeff King <peff@peff.net>
---
t/perf/perf-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index ab3687c28d..27c2801792 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -219,7 +219,7 @@ test_wrapper_ () {
then
base=$(basename "$0" .sh)
echo "$test_count" >>"$perf_results_dir"/$base.subtests
- echo "$1" >"$perf_results_dir"/$base.$test_count.descr
+ echo "$test_title_" >"$perf_results_dir"/$base.$test_count.descr
base="$perf_results_dir"/"$PERF_RESULTS_PREFIX$(basename "$0" .sh)"."$test_count"
"$test_wrapper_func_" "$test_title_" "$@"
fi
--
2.37.0.rc0.352.g10876ef154
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf-lib: fix missing test titles in output
2022-06-16 7:09 [PATCH] perf-lib: fix missing test titles in output Jeff King
@ 2022-06-16 13:03 ` Derrick Stolee
2022-06-16 19:51 ` Neeraj Singh (WINDOWS-SFS)
0 siblings, 1 reply; 3+ messages in thread
From: Derrick Stolee @ 2022-06-16 13:03 UTC (permalink / raw)
To: Jeff King, git; +Cc: Neeraj Singh
On 6/16/2022 3:09 AM, Jeff King wrote:
> Commit 5dccd9155f (t/perf: add iteration setup mechanism to perf-lib,
> 2022-04-04) modified the parameter parsing of test_wrapper() such that
> the test title was no longer in $1, and is instead in $test_title_.
>
> We correctly pass the new variable to the code which outputs the title
> to the log, but missed the spot in test_wrapper() where the title is
> written to the ".descr" file which is used to produce the final output
> table. As a result, all of the titles are missing from that table (or
> worse, using whatever was left in $1):
>
> $ ./p0000-perf-lib-sanity.sh
> [...]
> Test this tree
> ------------------------------
> 0000.1: 0.01(0.01+0.00)
> 0000.2: 0.01(0.00+0.01)
> 0000.4: 0.00(0.00+0.00)
> 0000.5: true 0.00(0.00+0.00)
> 0000.7: 0.00(0.00+0.00)
> 0000.8: 0.00(0.00+0.00)
Yikes!
> After this patch, we get the pre-5dccd9155f output:
>
> Test this tree
> --------------------------------------------------------------------------
> 0000.1: test_perf_default_repo works 0.00(0.00+0.00)
> 0000.2: test_checkout_worktree works 0.01(0.00+0.01)
> 0000.4: export a weird var 0.00(0.00+0.00)
> 0000.5: éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś 0.00(0.00+0.00)
> 0000.7: important variables available in subshells 0.00(0.00+0.00)
> 0000.8: test-lib-functions correctly loaded in subshells 0.00(0.00+0.00)
Good catch. LGTM.
-Stolee
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] perf-lib: fix missing test titles in output
2022-06-16 13:03 ` Derrick Stolee
@ 2022-06-16 19:51 ` Neeraj Singh (WINDOWS-SFS)
0 siblings, 0 replies; 3+ messages in thread
From: Neeraj Singh (WINDOWS-SFS) @ 2022-06-16 19:51 UTC (permalink / raw)
To: Derrick Stolee, Jeff King, git
Apologies for the breakage and thanks for the fix.
It looks good to me!
-Neeraj
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-16 20:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 7:09 [PATCH] perf-lib: fix missing test titles in output Jeff King
2022-06-16 13:03 ` Derrick Stolee
2022-06-16 19:51 ` Neeraj Singh (WINDOWS-SFS)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).