unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: meta@public-inbox.org
Subject: [PATCH] test_common: key test inboxes to init.defaultBranch
Date: Wed, 27 Oct 2021 04:07:54 +0000	[thread overview]
Message-ID: <20211027040754.GA18609@dcvr> (raw)
In-Reply-To: <5116e23a-b5de-4419-a909-0e4df787ac53@t-8ch.de>

Thomas Weißschuh <thomas@t-8ch.de> wrote:
> On 2021-10-26 05:28+0000, Eric Wong wrote:
> > Thomas Weißschuh <thomas@t-8ch.de> wrote:
> > > On 2021-10-25 16:58-0600, Eric Wong wrote:
> > > > Thanks, pushed as 9f3fb207.   It looks like there's several
> > > > other tests broken with non-master being the default.  Can we
> > > > expect fixes for those, too?  Thanks again.
> > > 
> > > Which tests are failing for you?
> > 
> > 	t/edit.t
> > 	t/indexlevels-mirror.t
> > 	t/indexlevels-mirror-v1.t
> > 	t/convert-compact.t
> > 	t/multi-mid.t
> > 	t/feed.t
> 
> I think these are because of stale data in t/data-gen/ that was generated when
> you still had the master branch configured.
> Try to clean out these files and rerun the tests.

Ah, thanks for spotting that.  I think it's better if the
cache-invalidation is transparent:
-----------8<----------
Subject: [PATCH] test_common: key test inboxes to init.defaultBranch

This lets users change their global init.defaultBranch config
knob in ~/.gitconfig or similar without breaking tests.

Reported-by: Thomas Weißschuh <thomas@t-8ch.de>
---
 lib/PublicInbox/TestCommon.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index fb0d5a4e..c3820d3a 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -674,8 +674,10 @@ sub create_inbox ($$;@) {
 	my %opt = @_;
 	require PublicInbox::Lock;
 	require PublicInbox::InboxWritable;
+	require PublicInbox::Import;
 	my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!);
-	my $dir = "t/data-gen/$base.$ident";
+	my ($db) = (PublicInbox::Import::default_branch() =~ m!([^/]+)\z!);
+	my $dir = "t/data-gen/$base.$ident-$db";
 	my $new = !-d $dir;
 	if ($new) {
 		mkdir $dir; # may race

  reply	other threads:[~2021-10-27  4:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 22:24 [PATCH] t/index-git-times: support non-master default branch Thomas Weißschuh
2021-10-25 22:58 ` Eric Wong
2021-10-26  5:05   ` Thomas Weißschuh
2021-10-26  5:28     ` Eric Wong
2021-10-26 18:43       ` Thomas Weißschuh
2021-10-27 21:15         ` lei-q-remote-import failures [was: [PATCH] t/index-git-times: support non-master default branch] Eric Wong
2021-10-27 21:24           ` Thomas Weißschuh
2021-10-27 23:48             ` Eric Wong
2021-10-28 14:03               ` Thomas Weißschuh
2021-10-28 19:16                 ` [PATCH] test_common: clear XDG_CACHE_HOME before lei tests Eric Wong
2021-10-28 19:22                   ` Thomas Weißschuh
2021-10-26 21:24       ` [PATCH] t/index-git-times: support non-master default branch Thomas Weißschuh
2021-10-27  4:07         ` Eric Wong [this message]
2021-10-27  5:04           ` [PATCH] test_common: key test inboxes to init.defaultBranch Thomas Weißschuh

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

  List information: https://public-inbox.org/README

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

  git send-email \
    --in-reply-to=20211027040754.GA18609@dcvr \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    --cc=thomas@t-8ch.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).