All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX
@ 2018-05-10 13:58 SZEDER Gábor
  2018-05-10 14:34 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: SZEDER Gábor @ 2018-05-10 13:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our
bitmaps' in 't5310-pack-bitmaps.sh' fail when run with
GIT_TEST_SPLIT_INDEX=YesPlease.  Both tests create a clone of the test
repository to check bitmap interoperability with JGit.  With split
indexes enabled the index in the clone repositories contains the
'link' extension, which JGit doesn't support and, consequently, an
exception aborts it:

  <...>
  org.eclipse.jgit.api.errors.JGitInternalException: DIRC extension 'link' not supported by this version.
          at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:562)
  <...>

Since testing bitmaps doesn't need a worktree in the first place,
let's just create bare clones for the two JGit tests, so the cloned
won't have an index, and these two tests can be executed even with
split index enabled.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 t/t5310-pack-bitmaps.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index f6d600fd82..423c0a475f 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -264,9 +264,9 @@ test_expect_success 'pack with missing parent' '
 '
 
 test_expect_success JGIT 'we can read jgit bitmaps' '
-	git clone . compat-jgit &&
+	git clone --bare . compat-jgit.git &&
 	(
-		cd compat-jgit &&
+		cd compat-jgit.git &&
 		rm -f .git/objects/pack/*.bitmap &&
 		jgit gc &&
 		git rev-list --test-bitmap HEAD
@@ -274,9 +274,9 @@ test_expect_success JGIT 'we can read jgit bitmaps' '
 '
 
 test_expect_success JGIT 'jgit can read our bitmaps' '
-	git clone . compat-us &&
+	git clone --bare . compat-us.git &&
 	(
-		cd compat-us &&
+		cd compat-us.git &&
 		git repack -adb &&
 		# jgit gc will barf if it does not like our bitmaps
 		jgit gc
-- 
2.17.0.756.gcf614c5aff


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX
  2018-05-10 13:58 [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX SZEDER Gábor
@ 2018-05-10 14:34 ` Jeff King
  2018-05-10 14:55   ` SZEDER Gábor
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2018-05-10 14:34 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Junio C Hamano, git

On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote:

> The two JGit tests 'we can read jgit bitmaps' and 'jgit can read our
> bitmaps' in 't5310-pack-bitmaps.sh' fail when run with
> GIT_TEST_SPLIT_INDEX=YesPlease.  Both tests create a clone of the test
> repository to check bitmap interoperability with JGit.  With split
> indexes enabled the index in the clone repositories contains the
> 'link' extension, which JGit doesn't support and, consequently, an
> exception aborts it:
> 
>   <...>
>   org.eclipse.jgit.api.errors.JGitInternalException: DIRC extension 'link' not supported by this version.
>           at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:562)
>   <...>
> 
> Since testing bitmaps doesn't need a worktree in the first place,
> let's just create bare clones for the two JGit tests, so the cloned
> won't have an index, and these two tests can be executed even with
> split index enabled.

Nice, this seems like a clever workaround.

Reviewed-by: Jeff King <peff@peff.net>

The more heavy-handed approach would be to just disable the JGIT prereq
when GIT_TEST_SPLIT_INDEX is in use, which would cover this and
potentially any other cases. This is nicer because it lets us continue
using the test. And it's not like we have a ton of jgit dependencies,
such that dealing with each individually would be a burden.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX
  2018-05-10 14:34 ` Jeff King
@ 2018-05-10 14:55   ` SZEDER Gábor
  0 siblings, 0 replies; 3+ messages in thread
From: SZEDER Gábor @ 2018-05-10 14:55 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Git mailing list

On Thu, May 10, 2018 at 4:34 PM, Jeff King <peff@peff.net> wrote:
> On Thu, May 10, 2018 at 03:58:52PM +0200, SZEDER Gábor wrote:
>> Since testing bitmaps doesn't need a worktree in the first place,
>> let's just create bare clones for the two JGit tests, so the cloned
>> won't have an index, and these two tests can be executed even with
>> split index enabled.
>
> Nice, this seems like a clever workaround.
>
> Reviewed-by: Jeff King <peff@peff.net>
>
> The more heavy-handed approach would be to just disable the JGIT prereq
> when GIT_TEST_SPLIT_INDEX is in use, which would cover this and
> potentially any other cases. This is nicer because it lets us continue
> using the test. And it's not like we have a ton of jgit dependencies,
> such that dealing with each individually would be a burden.

We could also 'sane_unset GIT_TEST_SPLIT_INDEX' in these two tests,
but I think that we should do that only in tests that specifically
check split index behavior (i.e. t1700).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-10 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 13:58 [PATCH] t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX SZEDER Gábor
2018-05-10 14:34 ` Jeff King
2018-05-10 14:55   ` SZEDER Gábor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.