git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v3 2/3] perf: make the tests work in worktrees
Date: Tue, 21 Jun 2016 15:25:57 -0400	[thread overview]
Message-ID: <20160621192557.GA2311@sigill.intra.peff.net> (raw)
In-Reply-To: <0f0bc7ac7b6eebed22b05c277cf7352122d164d2.1463145936.git.johannes.schindelin@gmx.de>

On Fri, May 13, 2016 at 03:25:58PM +0200, Johannes Schindelin wrote:

> This patch makes perf-lib.sh more robust so that it can run correctly
> even inside a worktree. For example, it assumed that $GIT_DIR/objects is
> the objects directory (which is not the case for worktrees) and it used
> the commondir file verbatim, even if it contained a relative path.
> 
> Furthermore, the setup code expected `git rev-parse --git-dir` to spit
> out a relative path, which is also not true for worktrees. Let's just
> change the code to accept both relative and absolute paths, by avoiding
> the `cd` into the copied working directory.

I was trying to run the perf scripts today and got bit by this patch.
The problem is this line:

> +	objects_dir="$(git -C "$source" rev-parse --git-path objects)"

When the perf script is running, the "git" in its PATH is the version of
git being perf-tested, not the most recent one. And --git-path wasn't
introduced until v2.5.0. So if you try to compare results against an
older git, it fails:

  $ cd t/perf
  $ ./run v2.4.0 v2.9.0 -- p0000-perf-lib-sanity.sh
  [...]

  === Running 1 tests in build/67308bd628c6235dbc1bad60c9ad1f2d27d576cc/bin-wrappers ===
  fatal: ambiguous argument 'objects': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
  cp: unrecognized option '--git-path
  objects'
  Try 'cp --help' for more information.
  error: failed to copy repository '/home/peff/compile/git/t/..' to '/var/ram/git-tests/trash directory.p0000-perf-lib-sanity'

  [...]
  Test                                                       v2.4.0      v2.9.0         
  --------------------------------------------------------------------------------------
  0000.1: test_perf_default_repo works                       <missing>   0.00(0.00+0.00)
  0000.2: test_checkout_worktree works                       <missing>   0.01(0.00+0.00)
  0000.4: export a weird var                                 <missing>   0.00(0.00+0.00)
  0000.6: important variables available in subshells         <missing>   0.00(0.00+0.00)
  0000.7: test-lib-functions correctly loaded in subshells   <missing>   0.00(0.00+0.00)

I know that running modern perf tests against older versions isn't
guaranteed to work (the tests might rely on newer options, for example),
but it at least generally worked up until this point.

IMHO the problem is in the design of t/perf, though. It should always
use your modern git for the harness setup, and only use the git-to-test
inside test_expect and test_perf blocks.

-Peff

  parent reply	other threads:[~2016-06-21 19:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 15:36 [PATCH 0/3] Introduce a perf test for interactive rebase Johannes Schindelin
2016-05-10 15:41 ` [PATCH 1/3] perf: let's disable symlinks on Windows Johannes Schindelin
2016-05-10 19:51   ` Junio C Hamano
2016-05-11  8:09     ` Johannes Schindelin
2016-05-10 15:42 ` [PATCH 2/3] perf: make the tests work in worktrees Johannes Schindelin
2016-05-10 20:28   ` Junio C Hamano
2016-05-11  8:08     ` Johannes Schindelin
2016-05-10 15:45 ` [PATCH 3/3] Add a perf test for rebase -i Johannes Schindelin
2016-05-11  8:31 ` [PATCH v2 0/3] Introduce a perf test for interactive rebase Johannes Schindelin
2016-05-11  8:42   ` [PATCH v2 3/3] Add a perf test for rebase -i Johannes Schindelin
2016-05-11 21:17     ` Junio C Hamano
2016-05-13 13:16       ` Johannes Schindelin
2016-05-11  8:42   ` [PATCH v2 2/3] perf: make the tests work in worktrees Johannes Schindelin
2016-05-11 17:40     ` Eric Sunshine
2016-05-13 13:14       ` Johannes Schindelin
2016-05-11  8:42   ` [PATCH v2 1/3] perf: let's disable symlinks when they are not available Johannes Schindelin
2016-05-13 13:25   ` [PATCH v3 0/3] Introduce a perf test for interactive rebase Johannes Schindelin
2016-05-13 13:25     ` [PATCH v3 1/3] perf: let's disable symlinks when they are not available Johannes Schindelin
2016-05-13 13:25     ` [PATCH v3 2/3] perf: make the tests work in worktrees Johannes Schindelin
2016-05-29 16:43       ` René Scharfe
2016-05-30  8:28         ` Johannes Schindelin
2016-05-30 18:03           ` Junio C Hamano
2016-05-30 18:24             ` René Scharfe
2016-05-31 21:24               ` Junio C Hamano
2016-06-21 19:25       ` Jeff King [this message]
2016-05-13 13:26     ` [PATCH v3 3/3] Add a perf test for rebase -i Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160621192557.GA2311@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).