[PATCH 4/4] test: give unique timestamps to messages

Austin Clements amdragon at MIT.EDU
Sun Dec 8 16:28:13 PST 2013


Quoth David Bremner on Dec 08 at 11:52 pm:
> 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)))

It would be worth adding a comment here to explain that the decreasing
timestamp is a historical artifact, to save people the trouble of
digging back in the log to figure out why it goes down.

>      fi
>  
>      additional_headers=""


More information about the notmuch mailing list