From d3e4cd986cf24617d409eab0f011b1d4cd43036c Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 8 Dec 2013 21:06:15 +0200 Subject: [PATCH] Re: [PATCH 4/4] test: give unique timestamps to messages --- 73/511a6b285a45e9cba704963f72c75cab32d941 | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 73/511a6b285a45e9cba704963f72c75cab32d941 diff --git a/73/511a6b285a45e9cba704963f72c75cab32d941 b/73/511a6b285a45e9cba704963f72c75cab32d941 new file mode 100644 index 000000000..66d3d317a --- /dev/null +++ b/73/511a6b285a45e9cba704963f72c75cab32d941 @@ -0,0 +1,104 @@ +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 17857431FDC + for ; Sun, 8 Dec 2013 11:06:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 659z2WLykC4b for ; + Sun, 8 Dec 2013 11:06:20 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 529D2431FD6 + for ; Sun, 8 Dec 2013 11:06:20 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id DDC1110005D; + Sun, 8 Dec 2013 21:06:15 +0200 (EET) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH 4/4] test: give unique timestamps to messages +In-Reply-To: <1386517946-22054-5-git-send-email-david@tethera.net> +References: <1386517946-22054-1-git-send-email-david@tethera.net> + <1386517946-22054-5-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.17~rc1+17~ga2e1a2f (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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, 08 Dec 2013 19:06:44 -0000 + +On Sun, Dec 08 2013, David Bremner wrote: + +> The choice of decreasing timestamps is a hack which reduces the number +> of existing tests which fail. This can be changed to increasing +> if/when somebody wants update another 47 tests. +> --- +> test/excludes | 4 ++-- +> test/test-lib.sh | 2 +- +> 2 files changed, 3 insertions(+), 3 deletions(-) +> +> diff --git a/test/excludes b/test/excludes +> index f1ae9ea..8bbbc2d 100755 +> --- a/test/excludes +> +++ b/test/excludes +> @@ -67,7 +67,7 @@ thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inb +> test_begin_subtest "Search, don't exclude \"deleted\" messages when --exclude=flag specified" +> output=$(notmuch search --exclude=flag subject:deleted | notmuch_search_sanitize) +> test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) +> -thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)" +> +thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Deleted (deleted inbox unread)" +> +> test_begin_subtest "Search, don't exclude \"deleted\" messages from search if not configured" +> notmuch config set search.exclude_tags +> @@ -152,7 +152,7 @@ ${matching_message_ids[5]}" +> test_begin_subtest "Search, exclude=flag (thread summary)" +> output=$(notmuch search --exclude=flag tag:test | notmuch_search_sanitize) +> test_expect_equal "$output" "thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +> -thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 4 (deleted inbox test unread) +> +thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) +> thread:XXX 2001-01-05 [0/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread) +> thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread) +> thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" +> diff --git a/test/test-lib.sh b/test/test-lib.sh +> index d238c66..792e477 100644 +> --- a/test/test-lib.sh +> +++ b/test/test-lib.sh +> @@ -356,7 +356,7 @@ generate_message () +> fi +> +> if [ -z "${template[date]}" ]; then +> - template[date]="Fri, 05 Jan 2001 15:43:57 +0000" +> + template[date]=$(date -Ru -d@$((978709437 - gen_msg_cnt))) + +I am afraid this is not portable (although not sure). This could work: + +_s=$((3599 - gen_msg_cnt)) +template[date]="Fri, 05 Jan 2001 15:$((_s / 60)):$((_s % 60)) +0000" + +> fi +> +> additional_headers="" + +Tomi (comments in hurry, after more careful examination done earlyer :) -- 2.26.2