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,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 A61271F454 for ; Thu, 6 Apr 2023 21:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1680818364; bh=ZgzlPw4v5+XnlvDthBbouDp5v5FjKwmViqgtik4vJlw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FtamnJH8hG/4192+TCdY0unqdh5X0hmEOBd7enrUBFD392xkjHrOxCxVPGgpbeXGw RpMXJIdDJgXIrRyp5U8UK57WQK1Q18LwZkWezFurN4umCpFQLCgi5FNr6okpXFz5m0 H1lktSoBj4Glow2gl+fBjx6erFH1NhZqFKbYzEDs= From: Eric Wong To: spew@80x24.org Subject: [PATCH 2/2] cindex check metadata Date: Thu, 6 Apr 2023 21:59:24 +0000 Message-Id: <20230406215924.2966194-2-e@80x24.org> In-Reply-To: <20230406215924.2966194-1-e@80x24.org> References: <20230406215924.2966194-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- 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') {