git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] perf-lib: remove old result files before running tests

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Nov 20, 2019, 08:00 UTC
Message-ID
<20191120080003.GA38901@cat>
In-Reply-To
<xmqq5zjfchix.fsf@gitster-ct.c.googlers.com>
On 11/20, Junio C Hamano wrote:
Show 25 quoted lines
> Thomas Gummerer <t.gummerer@gmail.com> writes:
> 
> > @@ -178,10 +178,11 @@ test_wrapper_ () {
> >  	export test_prereq
> >  	if ! test_skip "$@"
> >  	then
> 
> > -		base=$(basename "$0" .sh)
> 
> So we used to use $base to hold the number and the filename here
> 
> > -		echo "$test_count" >>"$perf_results_dir"/$base.subtests
> > -		echo "$1" >"$perf_results_dir"/$base.$test_count.descr
> >  		base="$perf_results_dir"/"$PERF_RESULTS_PREFIX$(basename "$0" .sh)"."$test_count"
> 
> and then redefined it to be the results-prefix specific one.
> 
> 
> > +		rm -f "$base".*
> 
> you now remove those results-prefix specific one for the $test_count
> (I guess that is as specific you can go) before writing the count
> and the description.  
> 
> So this "rm -f" is a no-op when perf-results-prefix is not empty?

No, not quite. It is a no-op the first time a particular test runs for a specific prefix. The prefix is usually set by the 't/perf/run' script, and indicates the revision that is tested.

So if we were running for example
    ./run deadbeef... p0001-rev-list.sh

we'd have a file 'test-results/build_deadbeef....p0001-rev-list.1.times' in the t/perf directory.

Now we add a 'test_size' test before the first 'test_perf' test, and run the tests again. After this run we'd still have that original file from the test results from the previous run, as well as a 'test-results/build_deadbeef....p0001-rev-list.1.size'.

This duplicate file at the matching "$base" is what we want to avoid. The "rm -f" above would remove 'test-results/build_deadbeef....p0001-rev-list.1.times' so we now only have the '.size' file left, and 'aggregate.perl' gives us the right result.

Show 5 quoted lines
> > +		no_prefix_base="$perf_results_dir"/$(basename "$0" .sh)
> > +		echo "$test_count" >>$no_prefix_base.subtests
> > +		echo "$1" >$no_prefix_base.$test_count.descr
> >  		"$test_wrapper_func_" "$@"
> >  	fi
Previous: Junio C HamanoNext: Jeff King
Message 3 of 7 in “perf-lib: remove old result files before running tests”
  1. perf-lib: remove old result files before running testsThomas Gummerer, Nov 19, 2019
  2. Junio C HamanoNov 20, 2019
  3. Thomas GummererNov 20, 2019
  4. Jeff KingNov 21, 2019
  5. Thomas GummererNov 22, 2019
  6. Jeff KingNov 25, 2019
  7. Thomas GummererNov 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.