From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH 2/2] cindex check metadata
Date: Thu, 6 Apr 2023 21:59:24 +0000 [thread overview]
Message-ID: <20230406215924.2966194-2-e@80x24.org> (raw)
In-Reply-To: <20230406215924.2966194-1-e@80x24.org>
---
t/cindex.t | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/t/cindex.t b/t/cindex.t
index 9da0ba69..f8fd05f5 100644
--- a/t/cindex.t
+++ b/t/cindex.t
@@ -72,6 +72,8 @@ ok(-e "$tmp/ext/cidx.lock", 'external dir created');
ok(!-d "$zp/.git/public-inbox-cindex", 'no cindex in original coderepo');
use_ok 'PublicInbox::CodeSearch';
+my @unused_keys = qw(last_commit has_threadid skip_docdata);
+
if ('multi-repo search') {
my $csrch = PublicInbox::CodeSearch->new("$tmp/ext");
my $mset = $csrch->mset('NUL');
@@ -86,6 +88,15 @@ if ('multi-repo search') {
$mset = $csrch->mset('NUL', { git_dir => abs_path("$zp/.git") });
@have = sort(map { $_->get_document->get_data } $mset->items);
is_xdeeply(\@have, $exp, 'got expected subjects w/ GIT_DIR filter');
+ my @xdb = $csrch->xdb_shards_flat;
+ my $i = 0;
+ for my $xdb (@xdb) {
+ for my $k (@unused_keys, 'indexlevel') {
+ is($xdb->get_metadata($k) // '', '',
+ "metadata $k unset in shard #$i");
+ }
+ ++$i;
+ }
}
if ('--update') {
prev parent reply other threads:[~2023-04-06 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 21:59 [PATCH 1/2] cindex: improve progress display Eric Wong
2023-04-06 21:59 ` Eric Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230406215924.2966194-2-e@80x24.org \
--to=e@80x24.org \
--cc=spew@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).