From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5D93C1F953; Wed, 27 Oct 2021 04:07:54 +0000 (UTC) Date: Wed, 27 Oct 2021 04:07:54 +0000 From: Eric Wong To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Cc: meta@public-inbox.org Subject: [PATCH] test_common: key test inboxes to init.defaultBranch Message-ID: <20211027040754.GA18609@dcvr> References: <20211025222453.252181-1-thomas@t-8ch.de> <20211025225822.GA28875@dcvr> <20211026052815.GA13265@dcvr> <5116e23a-b5de-4419-a909-0e4df787ac53@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5116e23a-b5de-4419-a909-0e4df787ac53@t-8ch.de> List-Id: Thomas Weißschuh wrote: > On 2021-10-26 05:28+0000, Eric Wong wrote: > > Thomas Weißschuh 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 --- 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