diff options
author | Eric Wong <e@80x24.org> | 2023-11-21 12:43:15 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-21 21:37:26 +0000 |
commit | fe3883762faf67fd6c4624ee721000e1f36bc59b (patch) | |
tree | 1fd745e8b42b6617b803ab2eac51b89e21a14768 /lib/PublicInbox/TestCommon.pm | |
parent | 0f92d4d5fc65bdec2b3cef7679480422e818f352 (diff) | |
download | public-inbox-fe3883762faf67fd6c4624ee721000e1f36bc59b.tar.gz |
The association data is just stored as deflated JSON in Xapian metadata keys of shard[0] for now. It should be reasonably compact and fit in memory for now since we'll assume sane, non-malicious git coderepo history, for now. The new cindex-join.t test requires TEST_REMOTE_JOIN=1 to be set in the environment and tests the joins against the inboxes and coderepos of two small projects with a common history. Internally, we'll use `ibx_off', `root_off' instead of `ibx_id' and `root_id' since `_id' may be mistaken for columns in an SQL database which they are not.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 0d17e6e7..361a2356 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -14,7 +14,7 @@ use Scalar::Util qw(isvstring); use Carp (); our @EXPORT; my $lei_loud = $ENV{TEST_LEI_ERR_LOUD}; -my $tail_cmd = $ENV{TAIL}; +our $tail_cmd = $ENV{TAIL}; our ($lei_opt, $lei_out, $lei_err); use autodie qw(chdir close fcntl mkdir open opendir seek unlink); @@ -364,12 +364,15 @@ sub run_script ($;$$) { my $fhref = []; my $spawn_opt = {}; my @tail_paths; + local $tail_cmd = $tail_cmd; for my $fd (0..2) { my $redir = $opt->{$fd}; my $ref = ref($redir); if ($ref eq 'SCALAR') { my $fh; - if ($tail_cmd && $ENV{TAIL_ALL} && $fd > 0) { + if ($ENV{TAIL_ALL} && $fd > 0) { + # tail -F is better, but not portable :< + $tail_cmd //= 'tail -f'; require File::Temp; $fh = File::Temp->new("fd.$fd-XXXX", TMPDIR=>1); push @tail_paths, $fh->filename; @@ -820,7 +823,7 @@ sub create_coderepo ($$;@) { $tmpdir; } -sub create_inbox ($$;@) { +sub create_inbox ($;@) { my $ident = shift; my $cb = pop; my %opt = @_; |