[PATCH 1/3] test: shrink T590-thread-breakage test decription to one line

classic Classic list List threaded Threaded
5 messages Options
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/3] test: shrink T590-thread-breakage test decription to one line

The test description is used for log output, I think the intention is
to keep it as a one-liner. Leave the rest of the long description as a
comment.
---
 test/T590-thread-breakage.sh | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh
index 6e4031af46bb..38abc2113c26 100755
--- a/test/T590-thread-breakage.sh
+++ b/test/T590-thread-breakage.sh
@@ -3,21 +3,21 @@
 # Copyright (c) 2016 Daniel Kahn Gillmor
 #
 
-test_description='thread breakage during reindexing
+test_description='thread breakage during reindexing'
 
-notmuch uses ghost documents to track messages we have seen references
-to but have never seen.  Regardless of the order of delivery, message
-deletion, and reindexing, the list of ghost messages for a given
-stored corpus should not vary, so that threads can be reassmebled
-cleanly.
-
-In practice, we accept a small amount of variation (and therefore
-traffic pattern metadata leakage to be stored in the index) for the
-sake of efficiency.
-
-This test also embeds some subtests to ensure that indexing actually
-works properly and attempted fixes to threading issues do not break
-the expected contents of the index.'
+# notmuch uses ghost documents to track messages we have seen references
+# to but have never seen.  Regardless of the order of delivery, message
+# deletion, and reindexing, the list of ghost messages for a given
+# stored corpus should not vary, so that threads can be reassmebled
+# cleanly.
+#
+# In practice, we accept a small amount of variation (and therefore
+# traffic pattern metadata leakage to be stored in the index) for the
+# sake of efficiency.
+#
+# This test also embeds some subtests to ensure that indexing actually
+# works properly and attempted fixes to threading issues do not break
+# the expected contents of the index.
 
 . ./test-lib.sh || exit 1
 
--
2.11.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] test: print test description also for failing known broken tests

With the test description, the user can see the test script name, and
debug with that alone.
---
 test/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index d8e159437ca9..2d9efa0ba799 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -858,12 +858,12 @@ test_ok_ () {
 }
 
 test_failure_ () {
+ print_test_description
  if test "$test_subtest_known_broken_" = "t"; then
  test_known_broken_failure_ "$@"
  return
  fi
  test_failure=$(($test_failure + 1))
- print_test_description
  test_failure_message_ "FAIL" "$test_subtest_name" "$@"
  test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
  return 1
--
2.11.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Jani Nikula Jani Nikula
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/3] test: suppress diff for broken test without V=1

In reply to this post by Jani Nikula
Known broken tests are, well, known broken. Do not print the result
diff for them unless V=1 is specified. Now that the test description
is printed also when known broken tests fail, the user can also skip
to running the individual failing tests.
---
 test/Makefile.local |  2 +-
 test/test-lib.sh    | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/test/Makefile.local b/test/Makefile.local
index f8cf90d07e2d..4680597292cf 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -61,7 +61,7 @@ test-binaries: $(TEST_BINARIES)
 
 test: all test-binaries
 ifeq ($V,)
- @echo 'Use "$(MAKE) V=1" to print test headings and PASSing results.'
+ @echo 'Use "$(MAKE) V=1" to see the details for passing and known broken tests.'
  @env NOTMUCH_TEST_QUIET=1 ${test_src_dir}/notmuch-test $(OPTIONS)
 else
 # The user has explicitly enabled quiet execution.
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2d9efa0ba799..eadfa31f850e 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -873,7 +873,9 @@ test_failure_message_ () {
  say_color error "%-6s" "$1"
  echo " $2"
  shift 2
- echo "$@" | sed -e 's/^/ /'
+ if [ "$#" != "0" ]; then
+ echo "$@" | sed -e 's/^/ /'
+ fi
  if test "$verbose" != "t"; then cat test.output; fi
 }
 
@@ -887,7 +889,11 @@ test_known_broken_ok_ () {
 test_known_broken_failure_ () {
  test_reset_state_
  test_broken=$(($test_broken+1))
- test_failure_message_ "BROKEN" "$test_subtest_name" "$@"
+ if [ -z "$NOTMUCH_TEST_QUIET" ]; then
+ test_failure_message_ "BROKEN" "$test_subtest_name" "$@"
+ else
+ test_failure_message_ "BROKEN" "$test_subtest_name"
+ fi
  return 1
 }
 
--
2.11.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line

In reply to this post by Jani Nikula
Jani Nikula <[hidden email]> writes:

> The test description is used for log output, I think the intention is
> to keep it as a one-liner. Leave the rest of the long description as a
> comment.

pushed this one patch to master
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 3/3] test: suppress diff for broken test without V=1

In reply to this post by Jani Nikula
Jani Nikula <[hidden email]> writes:

> Known broken tests are, well, known broken. Do not print the result
> diff for them unless V=1 is specified. Now that the test description
> is printed also when known broken tests fail, the user can also skip
> to running the individual failing tests.

pushed remained of series to master

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch