unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: add nontrivial test for restore --accumulate.
@ 2012-11-16 12:31 david
  2012-11-17  1:56 ` Ethan Glasser-Camp
  0 siblings, 1 reply; 7+ messages in thread
From: david @ 2012-11-16 12:31 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

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'
-
 test_expect_success 'Restore with nothing to do' \
   'notmuch restore < dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
+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'
+
 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'
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] test: add nontrivial test for restore --accumulate.
  2012-11-16 12:31 [PATCH] test: add nontrivial test for restore --accumulate david
@ 2012-11-17  1:56 ` Ethan Glasser-Camp
  2012-11-17 14:30   ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests david
  0 siblings, 1 reply; 7+ messages in thread
From: Ethan Glasser-Camp @ 2012-11-17  1:56 UTC (permalink / raw)
  To: david, notmuch; +Cc: David Bremner

david@tethera.net writes:

> From: David Bremner <bremner@debian.org>
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] test: add more informative titles to restore --accumulate tests
  2012-11-17  1:56 ` Ethan Glasser-Camp
@ 2012-11-17 14:30   ` david
  2012-11-17 14:30     ` [PATCH 2/2] test: add nontrivial test for restore --accumulate david
  2012-11-17 16:40     ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests Tomi Ollila
  0 siblings, 2 replies; 7+ messages in thread
From: david @ 2012-11-17 14:30 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

Thanks to Ethan for the suggestion.
---
 test/dump-restore |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/dump-restore b/test/dump-restore
index f25f7cf..7acf7fe 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -39,12 +39,12 @@ test_expect_success 'Restore with nothing to do' \
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
-test_expect_success 'Restore with nothing to do, II' \
+test_expect_success 'Accumulate with existing tags' \
   'notmuch restore --accumulate --input=dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
-test_expect_success 'Restore with nothing to do, III' \
+test_expect_success 'Accumulate with no tags' \
   'notmuch restore --accumulate < clear.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] test: add nontrivial test for restore --accumulate.
  2012-11-17 14:30   ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests david
@ 2012-11-17 14:30     ` david
  2012-11-17 15:49       ` Ethan Glasser-Camp
  2012-11-17 16:40     ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests Tomi Ollila
  1 sibling, 1 reply; 7+ messages in thread
From: david @ 2012-11-17 14:30 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

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.

The bracketing with "restore --input=dump.expected" are to make sure
we start in a known state, and we leave the database in a known state
for the next test.
---
 test/dump-restore |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/dump-restore b/test/dump-restore
index 7acf7fe..b05399c 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -49,6 +49,13 @@ test_expect_success 'Accumulate with no tags' \
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
+test_expect_success 'Accumulate with new tags' \
+  'notmuch restore --input=dump.expected &&
+  notmuch restore --accumulate --input=dump-ABC_DEF.expected &&
+  notmuch dump >  OUTPUT.$test_count &&
+  notmuch restore --input=dump.expected &&
+  test_cmp dump-ABC_DEF.expected OUTPUT.$test_count'
+
 # notmuch restore currently only considers the first argument.
 test_expect_success 'Invalid restore invocation' \
   'test_must_fail notmuch restore --input=dump.expected another_one'
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] test: add nontrivial test for restore --accumulate.
  2012-11-17 14:30     ` [PATCH 2/2] test: add nontrivial test for restore --accumulate david
@ 2012-11-17 15:49       ` Ethan Glasser-Camp
  0 siblings, 0 replies; 7+ messages in thread
From: Ethan Glasser-Camp @ 2012-11-17 15:49 UTC (permalink / raw)
  To: david, notmuch; +Cc: David Bremner

david@tethera.net writes:

> From: David Bremner <bremner@debian.org>
>
> 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.
>
> The bracketing with "restore --input=dump.expected" are to make sure
> we start in a known state, and we leave the database in a known state
> for the next test.

OK, these LGTM.

Ethan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] test: add more informative titles to restore --accumulate tests
  2012-11-17 14:30   ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests david
  2012-11-17 14:30     ` [PATCH 2/2] test: add nontrivial test for restore --accumulate david
@ 2012-11-17 16:40     ` Tomi Ollila
  2012-11-17 22:58       ` David Bremner
  1 sibling, 1 reply; 7+ messages in thread
From: Tomi Ollila @ 2012-11-17 16:40 UTC (permalink / raw)
  To: david, notmuch; +Cc: David Bremner

On Sat, Nov 17 2012, david@tethera.net wrote:

> From: David Bremner <bremner@debian.org>
>
> Thanks to Ethan for the suggestion.
> ---

LGTM -- with an added bonus of known misspelling gone in commit message ;)

Tomi
 
>  test/dump-restore |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/test/dump-restore b/test/dump-restore
> index f25f7cf..7acf7fe 100755
> --- a/test/dump-restore
> +++ b/test/dump-restore
> @@ -39,12 +39,12 @@ test_expect_success 'Restore with nothing to do' \
>    notmuch dump > dump.actual &&
>    test_cmp dump.expected dump.actual'
>  
> -test_expect_success 'Restore with nothing to do, II' \
> +test_expect_success 'Accumulate with existing tags' \
>    'notmuch restore --accumulate --input=dump.expected &&
>    notmuch dump > dump.actual &&
>    test_cmp dump.expected dump.actual'
>  
> -test_expect_success 'Restore with nothing to do, III' \
> +test_expect_success 'Accumulate with no tags' \
>    'notmuch restore --accumulate < clear.expected &&
>    notmuch dump > dump.actual &&
>    test_cmp dump.expected dump.actual'
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] test: add more informative titles to restore --accumulate tests
  2012-11-17 16:40     ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests Tomi Ollila
@ 2012-11-17 22:58       ` David Bremner
  0 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2012-11-17 22:58 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:
>
> LGTM -- with an added bonus of known misspelling gone in commit message ;)
>
> Tomi

pushed both.

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-17 23:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 12:31 [PATCH] test: add nontrivial test for restore --accumulate david
2012-11-17  1:56 ` Ethan Glasser-Camp
2012-11-17 14:30   ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests david
2012-11-17 14:30     ` [PATCH 2/2] test: add nontrivial test for restore --accumulate david
2012-11-17 15:49       ` Ethan Glasser-Camp
2012-11-17 16:40     ` [PATCH 1/2] test: add more informative titles to restore --accumulate tests Tomi Ollila
2012-11-17 22:58       ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).