From: Ethan Glasser-Camp Date: Sat, 17 Nov 2012 01:56:37 +0000 (+1900) Subject: Re: [PATCH] test: add nontrivial test for restore --accumulate. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=3db1d987646a1073d0594c765c3154b50df6533f;p=notmuch-archives.git Re: [PATCH] test: add nontrivial test for restore --accumulate. --- diff --git a/19/83843e568eb44a05d8a72c6f6010f5cd6f2114 b/19/83843e568eb44a05d8a72c6f6010f5cd6f2114 new file mode 100644 index 000000000..ed803944b --- /dev/null +++ b/19/83843e568eb44a05d8a72c6f6010f5cd6f2114 @@ -0,0 +1,123 @@ +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 69A17431FAF + for ; Fri, 16 Nov 2012 17:56:50 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, 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 VUvt9HKOOvx2 for ; + Fri, 16 Nov 2012 17:56:49 -0800 (PST) +Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com + [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A6D16431FAE + for ; Fri, 16 Nov 2012 17:56:49 -0800 (PST) +Received: by mail-qa0-f53.google.com with SMTP id k31so2683577qat.5 + for ; Fri, 16 Nov 2012 17:56:49 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:in-reply-to:references:user-agent:date + :message-id:mime-version:content-type; + bh=USAOoY4ZA7NJJqtATXMtOonR5K+fESYTO+z7z6vc9wI=; + b=N31Bqzib1UEFfg3KRMoN5X9SRDQKkesThTAXjWm3wDosBApy8iHo9O8TfiwLknUBYt + McXFNVNJEy8MDAENDFuJR+cXqaf73yISNWpAslihVqH+rvQZlAv09rCnQtcDzueNME/X + 7rCR06PeKgO/Ycvs956t+MCw92NG410BrObi6VjolkdLQdMvjuARe5Ty3lFb80KLFETM + fnp5DBBDq6lDDwmwAtmTKeVtoYaLTEVX2+yAK9aip80ulj3iSQK/Nh7kYXpxzAPc1RYT + SN+V5sk+FeFhd933WzBlOQW/4kH6MXJmvQHMB/BzTQABagADkEa2zKkB5v6VbP189n5n + p8Bw== +Received: by 10.224.177.74 with SMTP id bh10mr6194587qab.65.1353117408083; + Fri, 16 Nov 2012 17:56:48 -0800 (PST) +Received: from smtp.gmail.com ([66.114.71.21]) + by mx.google.com with ESMTPS id d5sm1852494qev.2.2012.11.16.17.56.46 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 16 Nov 2012 17:56:46 -0800 (PST) +From: Ethan Glasser-Camp +To: david@tethera.net, notmuch@notmuchmail.org +Subject: Re: [PATCH] test: add nontrivial test for restore --accumulate. +In-Reply-To: <1353069079-25270-1-git-send-email-david@tethera.net> +References: <1353069079-25270-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/24.1.1 + (x86_64-pc-linux-gnu) +Date: Fri, 16 Nov 2012 20:56:37 -0500 +Message-ID: <8762552dre.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain +Cc: David Bremner +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: Sat, 17 Nov 2012 01:56:50 -0000 + +david@tethera.net writes: + +> From: David Bremner +> +> It seems we have never tested the case that restore --accumulate +> actually adds tags. I noticed this when I started optimizing and no +> tests failed. +> +> I also had to modify the next test. Perhaps a seperate patch could +> make these tests more independent of the previous ones. +> --- +> test/dump-restore | 14 ++++++++------ +> 1 file changed, 8 insertions(+), 6 deletions(-) +> +> diff --git a/test/dump-restore b/test/dump-restore +> index f25f7cf..ca7a730 100755 +> --- a/test/dump-restore +> +++ b/test/dump-restore +> @@ -29,18 +29,20 @@ test_expect_success 'Accumulate original tags' \ +> notmuch dump > dump.actual && +> test_cmp dump-ABC_DEF.expected dump.actual' +> +> -test_expect_success 'Restoring original tags' \ +> - 'notmuch restore --input=dump.expected && +> - notmuch dump > dump.actual && +> - test_cmp dump.expected dump.actual' +> - + +I guess you're removing this test because it just shows that restore can +remove tags, and we already see that in earlier tests? + +> test_expect_success 'Restore with nothing to do' \ +> 'notmuch restore < dump.expected && +> notmuch dump > dump.actual && +> test_cmp dump.expected dump.actual' + +Maybe change the name of this test, as now it certainly does something? + +> +test_expect_success 'Accumulate with changes' \ +> + 'notmuch restore --input=dump.expected && +> + notmuch restore --accumulate --input=dump-ABC_DEF.expected && +> + notmuch dump > OUTPUT.$test_count && +> + test_cmp dump-ABC_DEF.expected OUTPUT.$test_count' + +Alignment? I think each line should start with two spaces. + +> + +> test_expect_success 'Restore with nothing to do, II' \ +> - 'notmuch restore --accumulate --input=dump.expected && +> + 'notmuch restore --input=dump.expected && +> + notmuch restore --accumulate --input=dump.expected && +> notmuch dump > dump.actual && +> test_cmp dump.expected dump.actual' + +Maybe change the name? "Accumulate with nothing to do", for instance? + +Ethan