unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line
@ 2017-02-26 17:36 Jani Nikula
  2017-02-26 17:36 ` [PATCH 2/3] test: print test description also for failing known broken tests Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jani Nikula @ 2017-02-26 17:36 UTC (permalink / raw)
  To: notmuch

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

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

* [PATCH 2/3] test: print test description also for failing known broken tests
  2017-02-26 17:36 [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line Jani Nikula
@ 2017-02-26 17:36 ` Jani Nikula
  2017-02-26 17:36 ` [PATCH 3/3] test: suppress diff for broken test without V=1 Jani Nikula
  2017-03-05  2:12 ` [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line David Bremner
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2017-02-26 17:36 UTC (permalink / raw)
  To: notmuch

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

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

* [PATCH 3/3] test: suppress diff for broken test without V=1
  2017-02-26 17:36 [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line Jani Nikula
  2017-02-26 17:36 ` [PATCH 2/3] test: print test description also for failing known broken tests Jani Nikula
@ 2017-02-26 17:36 ` Jani Nikula
  2017-03-10 11:45   ` David Bremner
  2017-03-05  2:12 ` [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line David Bremner
  2 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2017-02-26 17:36 UTC (permalink / raw)
  To: notmuch

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

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

* Re: [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line
  2017-02-26 17:36 [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line Jani Nikula
  2017-02-26 17:36 ` [PATCH 2/3] test: print test description also for failing known broken tests Jani Nikula
  2017-02-26 17:36 ` [PATCH 3/3] test: suppress diff for broken test without V=1 Jani Nikula
@ 2017-03-05  2:12 ` David Bremner
  2 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2017-03-05  2:12 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> 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

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

* Re: [PATCH 3/3] test: suppress diff for broken test without V=1
  2017-02-26 17:36 ` [PATCH 3/3] test: suppress diff for broken test without V=1 Jani Nikula
@ 2017-03-10 11:45   ` David Bremner
  0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2017-03-10 11:45 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> 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

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

end of thread, other threads:[~2017-03-10 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-26 17:36 [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line Jani Nikula
2017-02-26 17:36 ` [PATCH 2/3] test: print test description also for failing known broken tests Jani Nikula
2017-02-26 17:36 ` [PATCH 3/3] test: suppress diff for broken test without V=1 Jani Nikula
2017-03-10 11:45   ` David Bremner
2017-03-05  2:12 ` [PATCH 1/3] test: shrink T590-thread-breakage test decription to one line 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).