* [PATCH 02/14] tests: account for missing git-http-backend
2023-12-13 0:50 5% [PATCH 00/14] Alpine Linux support Eric Wong
@ 2023-12-13 0:50 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-12-13 0:50 UTC (permalink / raw)
To: meta
Alpine Linux ships git-http-backend in the `git-daemon'
package separately from `git', so we must test for its
existence before attempting to test functionality which
depends on it.
---
lib/PublicInbox/TestCommon.pm | 19 ++++++++++++++++++-
t/clone-coderepo.t | 1 +
t/httpd.t | 1 +
t/lei-mirror.t | 1 +
t/www_listing.t | 1 +
5 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index d587bf10..27a758e4 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -25,7 +25,7 @@ BEGIN {
run_script start_script key2sub xsys xsys_e xqx eml_load tick
have_xapian_compact json_utf8 setup_public_inboxes create_inbox
create_coderepo require_bsd kernel_version check_broken_tmpfs
- quit_waiter_pipe wait_for_eof
+ quit_waiter_pipe wait_for_eof require_git_http_backend
tcp_host_port test_lei lei lei_ok $lei_out $lei_err $lei_opt
test_httpd xbail require_cmd is_xdeeply tail_f
ignore_inline_c_missing no_pollerfd no_coredump cfg_new
@@ -163,6 +163,23 @@ sub require_git ($;$) {
skip("git $req+ required (have $cur_ver), skipping $nr tests")
}
+sub require_git_http_backend (;$) {
+ my ($nr) = @_;
+ state $ok = do {
+ require PublicInbox::Git;
+ my $git = PublicInbox::Git::check_git_exe() or plan
+ skip_all => 'nothing in public-inbox works w/o git';
+ my $rdr = { 1 => \my $out, 2 => \my $err };
+ xsys([$git, qw(http-backend)], undef, $rdr);
+ $out =~ /^Status:/ism;
+ };
+ if (!$ok) {
+ my $msg = "`git http-backend' not available";
+ defined($nr) ? skip $msg, $nr : plan skip_all => $msg;
+ }
+ $ok;
+}
+
my %IPv6_VERSION = (
'Net::NNTP' => 3.00,
'Mail::IMAPClient' => 3.40,
diff --git a/t/clone-coderepo.t b/t/clone-coderepo.t
index 0e6b4ac7..c0951941 100644
--- a/t/clone-coderepo.t
+++ b/t/clone-coderepo.t
@@ -8,6 +8,7 @@ use File::Temp;
use File::Path qw(remove_tree);
use PublicInbox::SHA qw(sha1_hex);
require_mods(qw(json Plack::Builder HTTP::Date HTTP::Status));
+require_git_http_backend;
require_git '1.8.5';
require_cmd 'curl';
require_ok 'PublicInbox::LeiMirror';
diff --git a/t/httpd.t b/t/httpd.t
index 0421c7ea..c0fbaa22 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -7,6 +7,7 @@ use PublicInbox::TestCommon;
use PublicInbox::Eml;
use Socket qw(IPPROTO_TCP SOL_SOCKET);
require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status));
+require_git_http_backend;
# FIXME: too much setup
my ($tmpdir, $for_destroy) = tmpdir();
diff --git a/t/lei-mirror.t b/t/lei-mirror.t
index 37c9751b..76041b73 100644
--- a/t/lei-mirror.t
+++ b/t/lei-mirror.t
@@ -5,6 +5,7 @@ use v5.12; use PublicInbox::TestCommon;
use PublicInbox::Inbox;
require_mods(qw(-httpd lei DBD::SQLite));
require_cmd('curl');
+require_git_http_backend;
use PublicInbox::Spawn qw(which);
require PublicInbox::Msgmap;
my $sock = tcp_server();
diff --git a/t/www_listing.t b/t/www_listing.t
index 709dbd05..0a4c79e8 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -77,6 +77,7 @@ sub tiny_test {
my $td;
SKIP: {
+ require_git_http_backend 1;
my $err = "$tmpdir/stderr.log";
my $out = "$tmpdir/stdout.log";
my $alt = "$tmpdir/alt.git";
^ permalink raw reply related [relevance 7%]
* [PATCH 00/14] Alpine Linux support
@ 2023-12-13 0:50 5% Eric Wong
2023-12-13 0:50 7% ` [PATCH 02/14] tests: account for missing git-http-backend Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-12-13 0:50 UTC (permalink / raw)
To: meta
I haven't tested every single possible package combination, but
I think this is enough to get started.
Patch 3 was a WTF moment for me.
Some of these are relevant for other platforms, as well, and
patch 7 decoupling from Inline::C is a good step towards making
our codebase more modular.
Patch 12 is a good fix regardless.
Eric Wong (14):
t/io: strace is optional on Linux
tests: account for missing git-http-backend
t/cindex*: skip --join when join(1) is missing
tests: attempt compatibility w/ busybox lsof
lei inspect: drop unneeded strftime import
treewide: avoid strftime %k for portability
xap_helper_cxx: decouple from Inline::C
xap_helper_cxx: support clang w/o `c++' executable
install: updates for Alpine Linux and apk
test_common: extract oct_is from search.t
t/convert-compact: allow S_ISGID bit
www_coderepo: fix read buffering
gzip_filter: use OO ->zflush dispatch
t/lei-import: relax EIO regexp
install/deps.perl | 38 +++++++++++++++++++++----
install/os.perl | 12 ++++++--
lib/PublicInbox/Admin.pm | 10 ++++++-
lib/PublicInbox/ExtSearchIdx.pm | 4 +--
lib/PublicInbox/GzipFilter.pm | 2 +-
lib/PublicInbox/Hval.pm | 6 +++-
lib/PublicInbox/LeiInspect.pm | 1 -
lib/PublicInbox/LeiMirror.pm | 4 +--
lib/PublicInbox/LeiXSearch.pm | 3 +-
lib/PublicInbox/RepoAtom.pm | 4 +--
lib/PublicInbox/TestCommon.pm | 50 +++++++++++++++++++++++++++++++--
lib/PublicInbox/WwwCoderepo.pm | 6 ++--
lib/PublicInbox/WwwStatic.pm | 5 ++--
lib/PublicInbox/XapHelperCxx.pm | 26 +++++++++++------
t/cindex-join.t | 1 +
t/cindex.t | 11 ++++----
t/clone-coderepo.t | 1 +
t/convert-compact.t | 20 ++++++-------
t/ds-leak.t | 5 +---
t/httpd-corner.t | 31 ++++++++------------
t/httpd.t | 1 +
t/lei-import.t | 5 ++--
t/lei-mirror.t | 1 +
t/nntpd.t | 16 +++++------
t/search.t | 5 ----
t/solver_git.t | 8 ++++--
t/v2reindex.t | 5 ++--
t/www_listing.t | 1 +
t/xap_helper.t | 6 ++--
xt/msgtime_cmp.t | 2 +-
30 files changed, 190 insertions(+), 100 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-12-13 0:50 5% [PATCH 00/14] Alpine Linux support Eric Wong
2023-12-13 0:50 7% ` [PATCH 02/14] tests: account for missing git-http-backend Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).