From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8177F1F560 for ; Fri, 8 Sep 2023 13:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1694178548; bh=GkeaGOxbsuBZJr7o92/kyzkHpGKMK5AL6xfh0gVeNuU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YsbPjQ/Iw0Porx8v7hiiIQOUZfVMMkEle63viKuBAq6ivtKzVlkgy7ygCMoj00Gd3 YM4MiKIMIB+1lSUClffhAtupEvpzJjD/BxRiimQaciCxddKUY6pGCcSO/PBe9VuN2q mWsSbZvhBsXUKMWCyBakqK3t9YClqu0uuRXPPyTw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/4] update docs + tests for xapian-delve use Date: Fri, 8 Sep 2023 13:09:05 +0000 Message-ID: <20230908130908.2263772-2-e@80x24.org> In-Reply-To: <20230908130908.2263772-1-e@80x24.org> References: <20230908130908.2263772-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Since -cindex uses the xapian-delve(1) command for `--prune' functionality, we'll rename our `xapian-compact' dependency to the Debian package name (xapian-tools) since `xapian-delve' is in the same package. --- Documentation/txt2pre | 2 ++ INSTALL | 5 +++-- ci/deps.perl | 12 ++++++------ t/cindex.t | 14 ++++++++++---- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Documentation/txt2pre b/Documentation/txt2pre index 62175f34..c258a90e 100755 --- a/Documentation/txt2pre +++ b/Documentation/txt2pre @@ -147,6 +147,8 @@ $xurls{'copydatabase(1)'} = 'https://manpages.debian.org/stable/xapian-tools/copydatabase.1.en.html'; $xurls{'xapian-compact(1)'} = 'https://manpages.debian.org/stable/xapian-tools/xapian-compact.1.en.html'; +$xurls{'xapian-delve(1)'} = + 'https://manpages.debian.org/stable/xapian-tools/xapian-delve.1.en.html'; $xurls{'gzip(1)'} = 'https://manpages.debian.org/stable/gzip/gzip.1.en.html'; $xurls{'chmod(1)'} = 'https://manpages.debian.org/stable/coreutils/chmod.1.en.html'; diff --git a/INSTALL b/INSTALL index 2e1c7ef7..617801cc 100644 --- a/INSTALL +++ b/INSTALL @@ -111,10 +111,11 @@ Numerous optional modules are likely to be useful as well: * highlight deb: libhighlight-perl (for syntax highlighting with coderepo) -* xapian-compact (tool) deb: xapian-tools +* xapian-tools deb: xapian-tools pkg: xapian-core rpm: xapian-core - (only for public-inbox-compact(1)) + (for public-inbox-compact(1) and + public-inbox-cindex(1)) * curl (tool) deb, pkg, rpm: curl (for HTTP(S) externals with curl) diff --git a/ci/deps.perl b/ci/deps.perl index ae85986d..94266029 100755 --- a/ci/deps.perl +++ b/ci/deps.perl @@ -1,10 +1,10 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # Helper script for installing/uninstalling packages for CI use # Intended for use on non-production chroots or VMs since it # changes installed packages -use strict; +use v5.12; my $usage = "$0 PKG_FMT PROFILE [PROFILE_MOD]"; my $pkg_fmt = shift; @ARGV or die $usage, "\n"; @@ -38,7 +38,7 @@ my $profiles = { Search::Xapian Socket6 highlight.pm - xapian-compact + xapian-tools ) ], # optional developer stuff @@ -119,9 +119,9 @@ my $non_auto = { rpm => [], }, - # we call xapian-compact(1) in public-inbox-compact(1) - 'xapian-compact' => { - deb => 'xapian-tools', + # we call xapian-compact(1) in public-inbox-compact(1) and + # xapian-delve(1) in public-inbox-cindex(1) + 'xapian-tools' => { pkg => 'xapian-core', rpm => 'xapian-core', # ??? }, diff --git a/t/cindex.t b/t/cindex.t index eca6cda2..9f57bd83 100644 --- a/t/cindex.t +++ b/t/cindex.t @@ -79,7 +79,7 @@ ok(run_script([qw(-cindex -L medium --dangerous -q -d), SKIP: { - have_xapian_compact; + have_xapian_compact 2; ok(run_script([qw(-compact -q), "$tmp/ext"]), 'compact on full'); ok(run_script([qw(-compact -q), "$tmp/med"]), 'compact on medium'); } @@ -159,7 +159,8 @@ EOM is(scalar($mset->items), 1, 'same result after reindex'); } -if ('--prune') { +SKIP: { # --prune + require_cmd($ENV{XAPIAN_DELVE} || 'xapian-delve', 1); my $csrch = PublicInbox::CodeSearch->new("$tmp/ext"); is(scalar($csrch->mset('s:hi')->items), 1, 'got hit'); @@ -188,7 +189,12 @@ ok(run_script([qw(-cindex --dangerous -q -d), "$tmp/ext", $zp]), ok(run_script([qw(-xcpdb), "$tmp/ext"]), 'xcpdb upgrade'); ok(run_script([qw(-xcpdb -R4), "$tmp/ext"]), 'xcpdb reshard'); -ok(run_script([qw(-xcpdb -R2 --compact), "$tmp/ext"]), 'xcpdb reshard+compact'); -ok(run_script([qw(-xcpdb --compact), "$tmp/ext"]), 'xcpdb compact'); + +SKIP: { + have_xapian_compact 2; + ok(run_script([qw(-xcpdb -R2 --compact), "$tmp/ext"]), + 'xcpdb reshard+compact'); + ok(run_script([qw(-xcpdb --compact), "$tmp/ext"]), 'xcpdb compact'); +}; done_testing;