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: AS24940 159.69.0.0/16 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 96F381F953 for ; Thu, 28 Oct 2021 19:22:32 +0000 (UTC) Date: Thu, 28 Oct 2021 21:22:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=t-8ch.de; s=mail; t=1635448950; bh=UyjuggTVE8PkW9oyuXgWIiH192bOoxLFGndUGVwbcA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o9hCmbcYsV8Uv4P+NYLNRrOEZdFmzthCkoyrPN3KHSFfu23o35TWmsol5braIZJvo edsUEpjatYHAlVsDvMZX1ZcRheDCOY/KFUOjdN0aBBGU9jUmvrI2PACDq5flsYiJAc chHuTRaTtaeRy5yNSZsZ5JYO4mjJaInYDgPrsj90= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Eric Wong Cc: meta@public-inbox.org Subject: Re: [PATCH] test_common: clear XDG_CACHE_HOME before lei tests Message-ID: <8dcf167c-8ced-46e6-b2f0-90d7d6cd8305@t-8ch.de> References: <20211025222453.252181-1-thomas@t-8ch.de> <20211025225822.GA28875@dcvr> <20211026052815.GA13265@dcvr> <20211027211515.M84746@dcvr> <52653367-9aac-45a7-9d3d-56dacfe36905@t-8ch.de> <20211027234856.M792093@dcvr> <20211028191650.GA20567@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211028191650.GA20567@dcvr> Jabber-ID: thomas@t-8ch.de X-Accept: text/plain, text/html;q=0.2, text/*;q=0.1 X-Accept-Language: en-us, en;q=0.8, de-de;q=0.7, de;q=0.6 List-Id: On 2021-10-28 19:16+0000, Eric Wong wrote: > Thomas Weißschuh wrote: > > It turned out that in my $XDG_CONFIG_HOME/lei/all_locals_ever.git/lei_ale.state > > there were entries for the repositories in > > $PUBLIC_INBOX_SRC/t/home2/{t1,t2}. > > > > I'm not sure how those entries came to be but probably because of some > > debugging things I did before. > > The presence of t1 & t2 entries is harmless for normal lei > operation; but they shouldn't be there... > > I wonder, do you have XDG_CACHE_HOME explicitly set in your env? > If so, that would've caused problems (fixed below). Yes I have it set explicitly > > IMO it would make sense to prevent p-i to read this global state during > > unittests. > > Yes, I think this was from our failure to clobber XDG_CACHE_HOME: That works, thanks! Tested-by: Thomas Weißschuh > ------------8<------------ > Subject: [PATCH] test_common: clear XDG_CACHE_HOME before lei tests > > We don't want to read a users' > $XDG_CACHE_HOME/lei/all_locals_ever.git during tests. > > Reported-by: Thomas Weißschuh > Link: https://public-inbox.org/meta/f239abac-4aee-4573-a0d6-e533c7a32662@t-8ch.de/ > --- > lib/PublicInbox/TestCommon.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm > index c3820d3a..052d6e45 100644 > --- a/lib/PublicInbox/TestCommon.pm > +++ b/lib/PublicInbox/TestCommon.pm > @@ -556,16 +556,20 @@ SKIP: { > require_git(2.6, 1) or skip('git 2.6+ required for lei test', 2); > my $mods = $test_opt->{mods} // [ 'lei' ]; > require_mods(@$mods, 2); > + > + # set PERL_INLINE_DIRECTORY before clobbering XDG_CACHE_HOME > + require PublicInbox::Spawn; > require PublicInbox::Config; > require File::Path; > + > local %ENV = %ENV; > delete $ENV{XDG_DATA_HOME}; > delete $ENV{XDG_CONFIG_HOME}; > + delete $ENV{XDG_CACHE_HOME}; > $ENV{GIT_COMMITTER_EMAIL} = 'lei@example.com'; > $ENV{GIT_COMMITTER_NAME} = 'lei user'; > my (undef, $fn, $lineno) = caller(0); > my $t = "$fn:$lineno"; > - require PublicInbox::Spawn; > state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') || > eval { require Socket::MsgHdr; 1 }; > unless ($lei_daemon) {