From ec50fa730fd1c848b567572f9397b8c0655abb8a Mon Sep 17 00:00:00 2001 From: Pieter Praet Date: Sun, 19 Feb 2012 21:43:56 +0100 Subject: [PATCH] Re: [PATCH] test: add tests wrt ignoring user-specified files and directories --- 0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 | 148 ++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 diff --git a/0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 b/0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 new file mode 100644 index 000000000..7b7fdf65d --- /dev/null +++ b/0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 @@ -0,0 +1,148 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 7C3BC431FAF + for ; Sun, 19 Feb 2012 12:46:17 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 76eFsLdjf3pg for ; + Sun, 19 Feb 2012 12:46:16 -0800 (PST) +Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + ADF76431FAE for ; Sun, 19 Feb 2012 12:46:16 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so4006676wgb.2 + for ; Sun, 19 Feb 2012 12:46:15 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.180.80.35 as permitted sender) client-ip=10.180.80.35; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.180.80.35 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.180.80.35]) + by 10.180.80.35 with SMTP id o3mr12084970wix.5.1329684375468 (num_hops + = 1); Sun, 19 Feb 2012 12:46:15 -0800 (PST) +Received: by 10.180.80.35 with SMTP id o3mr10080859wix.5.1329684372425; + Sun, 19 Feb 2012 12:46:12 -0800 (PST) +Received: from localhost (104.218-242-81.adsl-dyn.isp.belgacom.be. + [81.242.218.104]) + by mx.google.com with ESMTPS id dw7sm11421772wib.4.2012.02.19.12.46.11 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 19 Feb 2012 12:46:11 -0800 (PST) +From: Pieter Praet +To: Austin Clements , David Edmondson , + Tomi Ollila , David Bremner +Subject: Re: [PATCH] test: add tests wrt ignoring user-specified files and + directories +In-Reply-To: <874nv7wn88.fsf@awakening.csail.mit.edu> +References: + <1328105573-4626-1-git-send-email-pieter@praet.org> + <874nv7wn88.fsf@awakening.csail.mit.edu> +User-Agent: Notmuch/0.11.1+210~g6afc43e (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-unknown-linux-gnu) +Date: Sun, 19 Feb 2012 21:43:56 +0100 +Message-ID: <87linysgdv.fsf@praet.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Gm-Message-State: + ALoCoQnZbiN+ML5alp2ubiMs57AJpRleKM6aW+6YzauYVpfpgy1TI+Eh+xE8uv+ZBaypQq2gwy+1 +Cc: Notmuch Mail +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 19 Feb 2012 20:46:17 -0000 + +On Fri, 03 Feb 2012 17:44:55 -0500, Austin Clements wrote: +> On Wed, 1 Feb 2012 15:12:53 +0100, Pieter Praet wrote: +> > Files and directories which are specified in 'new.ignore' in the +> > config file shouldn't be indexed nor reported by `notmuch new'. +> > +> > --- +> > test/new | 23 +++++++++++++++++++++++ +> > 1 files changed, 23 insertions(+), 0 deletions(-) +> > +> > diff --git a/test/new b/test/new +> > index 49f390d..740ba05 100755 +> > --- a/test/new +> > +++ b/test/new +> > @@ -153,4 +153,27 @@ rm -rf "${MAIL_DIR}"/two +> > output=$(NOTMUCH_NEW) +> > test_expect_equal "$output" "No new mail. Removed 3 messages." +> > +> > +test_begin_subtest "Skip and report non-mail files" +> > +generate_message +> > +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config +> > +touch "${MAIL_DIR}"/ignored_file +> > +touch "${MAIL_DIR}"/.ignored_hidden_file +> > +output=$(NOTMUCH_NEW 2>&1) +> > +test_expect_equal "$output" \ +> > +"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config +> > +Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file +> > +Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file +> > +Added 1 new message to the database." +> > + +> > +test_begin_subtest "Ignore files and directories specified in new.ignore" +> > +test_subtest_known_broken +> > +generate_message +> > +notmuch config set new.ignore .git ignored_file .ignored_hidden_file +> > +mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config +> +> This doesn't change .git's mtime, so notmuch new may not scan it (*may* +> not because it's possible/likely notmuch refused to record the mtime in +> the above test on account of lack of granularity). Probably you should +> just touch "${MAIL_DIR}"/.git. Or maybe touch a new file under it. +> + +Good point. + + +> > +touch "${MAIL_DIR}"/ignored_file +> > +touch "${MAIL_DIR}"/.ignored_hidden_file +> +> These aren't necessary since these files already exist and they won't +> touch the directory's mtime (though the generate_message will). +> + +Those are/were intended to keep the test self-contained (i.e. +independent of the previous one). Probably should've added a +comment about that. + + +> > +output=$(NOTMUCH_NEW 2>&1) +> > +test_expect_equal "$output" "Added 1 new message to the database." +> > + +> > + +> > test_done +> > -- +> > 1.7.8.1 +> > +> > _______________________________________________ +> > notmuch mailing list +> > notmuch@notmuchmail.org +> > http://notmuchmail.org/mailman/listinfo/notmuch +> > + +Thanks for reviewing! + +Peace + + +-- +Pieter -- 2.26.2