From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cFpuEqWFyGFT6AAAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 16:09:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WNqVD6WFyGF2OwAA9RJhRA (envelope-from ) for ; Sun, 26 Dec 2021 16:09:25 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6602E352D4 for ; Sun, 26 Dec 2021 16:09:24 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9C9C85F729; Sun, 26 Dec 2021 15:09:19 +0000 (UTC) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 987975F720 for ; Sun, 26 Dec 2021 15:09:16 +0000 (UTC) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id E9F3C1B0026B; Sun, 26 Dec 2021 17:09:14 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1640531355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=si++9jRYYQwwb1WqAR5GLLBVZVNiN2RhjWzyhHs2gck=; b=lNaXBzirVKsYLBQQ7/rWVC6xryiqLaC1baJqQGz8fs/3SMn7hh1mZ2f7OTsIUlyG5tglRg mS8+vMoMxnbQMQMxAJ7IJwim5Khqd3wfOEEuPy2bNstBDvzr892URD/lZPBNWpgLGiaQE6 e7zvx8DD4g/awgthHBjzQ97c3VAZwo5tW42Hv/bwM2pFxB3L4RCiIlhA7LXcoCfOK/Y4C5 FbBxnkqDkF99EuASL2LLeePzjs/X8nDWCaBJbNqYVNF5GsUsFALK7cRBK0HKOYcdnpxZSg XHVxH0ypF/TFJaV+bmuKqBshrcZsosg6JmMrWrfgPMXB1btINByZNKNcQo8l0A== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] test: test folder renames In-Reply-To: <20211226112142.1958395-1-david@tethera.net> References: <20211226112142.1958395-1-david@tethera.net> User-Agent: Notmuch/0.33+54~gcaf4513 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1640531355; a=rsa-sha256; cv=none; b=OnXGWJK/CkWT3ib97LJnh4xoCUKykMqvhxWbP7J43Xyr5sBIMNDkeCY7m3q8mrQf+Q5PfL UbbkhGbtWKZelrFxHh6xVJzPEgWgtkuqXkqtqEYipdCYL7Dk9iJrXojNaROSU+DgUc2qlP c2xDeqSnd1+vWEd9ru78XAEyTvFKedsWZuJ4ai5LzSXlTdfPUD/itwUa8vcS3MLRVhKqMy sAz6w67d/Zakcd5cWGiBeMmNfNOPJFgFhfbO4xHJlOJ8VI8fRTa+XmLPyDeQ6mhgRLbh/Z FSeXTeahkfJKzwSPKxZU2El9F0JCGAw+N6gVt/uIem2g0iQUX0G7SJaVlK4YFA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1640531355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=si++9jRYYQwwb1WqAR5GLLBVZVNiN2RhjWzyhHs2gck=; b=IVjtSgTLEu9Xxk8RkLvRkAmqh//gaSnKYUmW0lJY7lF9SBUCYrMyGkac3M1/f4FYxE9/UV yZBAKhtd6/kbyBhgvgBthEs3XC8RcyrodFoOBHwf0dkXX7bDA3a0ZEgVWsgoH4NnyedKTW RmEe8rVlI3gyHeBenCGirbuFB8K4UUg1QSGEUfHDd+k8O0ODMR4t6/qOY3c8Z9PKomT+PG LkoDI8N4Es2YWCJ9i/w1PTD82wqLY6vOOoxrzs7HN3RrCo7/g5FTM9k+FZ7W72JMf4Ew4g Cr1nZZJLmEq07AemhygJ4vp8eUDY4gyxMavbRzh/X8jq+UkbwRYZSDc1l6w+sw== Message-ID-Hash: ZW5ZHVPOZFS6F23W4UCTHD3JVAXGFKFI X-Message-ID-Hash: ZW5ZHVPOZFS6F23W4UCTHD3JVAXGFKFI X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640531365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZXw8fTuEkadt/nz0ZZaGOMm7VptPLHZ0g8F98OtIKPw=; b=Tw33uPQ06OKX66c/173FpBph45YY04Stn9kbtq8GbhoExuYCCFNV9FKVjHFhM9uf7FNIrG Xox+/hAHnlsET+mD3ioD5gSRD0XkcxgC0Yw+SO7UfSfknPXRTg2DFtK/JaBPUprArt9yzN J+iEInOt46xh3xWzO2P2Xbx17v/Kg3a/j7Pd7l7Oct9igeYsPvBkOqDVpl/SFgra7Que2p NZ5kY8CEgTFo2+PZ0Yf+MZJhoUlPIAaAsR3a9d/b6Bdd5506rA5MTmKnhv+AkTrxQRkG0d axRhha8Rv+Y6CsCowGeoR434w5SSWRLgZKQA7IwTpRe/jIRGpHI43KSjUONbgw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1640531365; a=rsa-sha256; cv=fail; b=eXosEsjwTvLguQzocBbKDRJjHWmDXulPHCrcUahTAKdGJfP/vKfxSmjH4pofd5zCp00v5M 3darpVrzc2uTk2/KgrTjYQzgCV9ngcTgukqR5r5c2/ND3RBnoufVhJ7U0JDiOJ368DzWNH FnALduy5HLKRy1Grd2beBJShyLiibh0Gn6t+v9V20mlZRfIj1Ru5A/2O2XuBj6IH3Mu27n mqTevo5DOAnkiftojw2b8idMeXx52SvezjmYmc4Hg4e84u1ibWJIQt+AUQIF8+hOGMxk1t CoMKRfVdzcSjxwOXE1lAhl/tj8rdTBksVlRCxv6Rhrl/W158jWHBStznna611w== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=lNaXBzir; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=lNaXBzir; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 6602E352D4 X-Spam-Score: -1.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: JJ7uMwwzOhFX On Sun, Dec 26 2021, David Bremner wrote: > From: Jani Nikula > > In [1] Mark Walters reported a problem with messages being removed > from the database when the parent directory was renamed. Jani Nikula > proposed [2] these tests but observed With that 'From:' line commit message starts to look weird... > > This test is not suitable for merging since it's not deterministic. > > After applying Jani's patch [3], the tests now pass deterministically, > and could usefully act as regression tests. > > [1]: id:87siray6th.fsf@qmul.ac.uk > [2]: id:1393191650-28333-1-git-send-email-jani@nikula.org > [3]: id:1441445731-4362-2-git-send-email-jani@nikula.org > --- > test/T051-new-renames.sh | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > create mode 100755 test/T051-new-renames.sh > > diff --git a/test/T051-new-renames.sh b/test/T051-new-renames.sh > new file mode 100755 > index 00000000..febe006f > --- /dev/null > +++ b/test/T051-new-renames.sh > @@ -0,0 +1,40 @@ > +#!/usr/bin/env bash > +test_description='"notmuch new" with directory renames' > +. ./test-lib.sh > + > +for loop in `seq 10`; do {1..10} > + > +rm -rf ${MAIL_DIR} > + > +for i in `seq 10`; do {1..10} > + generate_message '[dir]=foo' '[subject]="Message foo $i"' > +done > + > +for i in `seq 10`; do {1..10} > + generate_message '[dir]=bar' '[subject]="Message bar $i"' > +done > + > +test_begin_subtest "Index the messages, round $loop" > +output=$(NOTMUCH_NEW) > +test_expect_equal "$output" "Added 20 new messages to the database." > + > +all_files=$(notmuch search --output=files \*) > +count_foo=$(notmuch count folder:foo) > + > +test_begin_subtest "Rename folder" > +mv ${MAIL_DIR}/foo ${MAIL_DIR}/baz > +output=$(NOTMUCH_NEW) > +test_expect_equal "$output" "No new mail. Detected $count_foo file renames." > + > +test_begin_subtest "Rename folder back" > +mv ${MAIL_DIR}/baz ${MAIL_DIR}/foo > +output=$(NOTMUCH_NEW) > +test_expect_equal "$output" "No new mail. Detected $count_foo file renames." > + > +test_begin_subtest "Files remain the same" > +output=$(notmuch search --output=files \*) > +test_expect_equal "$output" "$all_files" > + > +done > + > +test_done > -- > 2.34.1