From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
Jeff King [off-list ref] writes:
quoted
Good point, I forgot to check what it looked like with -v. Since this
series is already on v6, is there a more lightweight way of addressing
this tiny tweak than sending v7?
It is ultimately up to Junio, but I suspect he would be OK if you just
reposted patch 4/7 with the above squashed. Or even just said "I like
this, please squash it into patch 4 (change info messages from
yellow/brown to bold cyan).
Surely; as long as the series is not in 'next', the change to be
squashed is not too big and it is not too much work (and in this
case it certainly is not).
I actually wonder if "skipped test in bold blue" and "known breakage
in bold yellow" should also lose the boldness. Errors and warnings
in bold are good, but I would say the degree of need for attention
are more like this:
error (failed tests - you should look into it)
skip (skipped - perhaps you need more packages?)
warn (expected failure - you may want to look into fixing it someday)
info
pass
The "expected_failure" cases painted in "warn" are all long-known
failures; I do not think reminding about them in "bold" over and
over will help encouraging the developers take a look at them.
The "skipped" cases fall into two categories. Either you already
know you choose to not to care (e.g. I do not expect to use git-p4
and decided not to install p4 anywhere, so I may have t98?? on
GIT_SKIP_TESTS environment) or you haven't reached that point on a
new system and haven't realized that you didn't install a package
needed to run tests you care about (e.g. cvsserver tests would not
run without Perl interface to SQLite). For the former, the bold
output is merely distracting; for the latter, bold _might_ help in
this case.
At least, I think
GIT_SKIP_TESTS=t98?? sh t9800-git-p4-basic.sh -v
should paint "skipping test t9800 altogether" (emitted with "-v) and
the last line "1..0 # SKIP skip all tests in t9800" both in the same
"info" color.
How about going further to reduce "bold" a bit more, like this?
@@ -589,7 +589,7 @@ for skp in $GIT_SKIP_TESTSdocase"$this_test"in$skp)-say_colorskip>&3"skipping test $this_test altogether"+say_colorinfo>&3"skipping test $this_test altogether"skip_all="skip all tests in $this_test"test_doneesac
From: Jeff King <hidden> Date: 2016-06-15 22:55:34
On Thu, Dec 20, 2012 at 11:21:09AM -0800, Junio C Hamano wrote:
The "expected_failure" cases painted in "warn" are all long-known
failures; I do not think reminding about them in "bold" over and
over will help encouraging the developers take a look at them.
The "skipped" cases fall into two categories. Either you already
know you choose to not to care (e.g. I do not expect to use git-p4
and decided not to install p4 anywhere, so I may have t98?? on
GIT_SKIP_TESTS environment) or you haven't reached that point on a
new system and haven't realized that you didn't install a package
needed to run tests you care about (e.g. cvsserver tests would not
run without Perl interface to SQLite). For the former, the bold
output is merely distracting; for the latter, bold _might_ help in
this case.
At least, I think
GIT_SKIP_TESTS=t98?? sh t9800-git-p4-basic.sh -v
should paint "skipping test t9800 altogether" (emitted with "-v) and
the last line "1..0 # SKIP skip all tests in t9800" both in the same
"info" color.
How about going further to reduce "bold" a bit more, like this?
Yeah, I think it is a little easier on the eyes while maintaining the
intended color scheme.
On my xterm, at least, this is actually the difference between light
blue" and dark blue, not bold and not-bold. I think it is OK, though to
be honest, having seen the "skip all" messages in cyan (e.g., running
t9800), I think just printing skip messages in cyan looks best. But it
is not that big a deal to me, and we are well into bikeshed territory, I
think, so that will be my last word on the subject.
-Peff
From: Adam Spiers <hidden> Date: 2016-06-15 22:55:34
On Thu, Dec 20, 2012 at 7:21 PM, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:
quoted
quoted
Good point, I forgot to check what it looked like with -v. Since this
series is already on v6, is there a more lightweight way of addressing
this tiny tweak than sending v7?
It is ultimately up to Junio, but I suspect he would be OK if you just
reposted patch 4/7 with the above squashed. Or even just said "I like
this, please squash it into patch 4 (change info messages from
yellow/brown to bold cyan).
Surely; as long as the series is not in 'next', the change to be
squashed is not too big and it is not too much work (and in this
case it certainly is not).
OK.
I actually wonder if "skipped test in bold blue" and "known breakage
in bold yellow" should also lose the boldness. Errors and warnings
in bold are good, but I would say the degree of need for attention
are more like this:
error (failed tests - you should look into it)
skip (skipped - perhaps you need more packages?)
warn (expected failure - you may want to look into fixing it someday)
info
pass
The "expected_failure" cases painted in "warn" are all long-known
failures; I do not think reminding about them in "bold" over and
over will help encouraging the developers take a look at them.
As Peff already noted, on many (most?) X terminals "bold" colours are
just brighter colours, rather than a heavier typeface. How bold they
look is therefore dependent on the colour scheme used by that
terminal.
The "skipped" cases fall into two categories. Either you already
know you choose to not to care (e.g. I do not expect to use git-p4
and decided not to install p4 anywhere, so I may have t98?? on
GIT_SKIP_TESTS environment) or you haven't reached that point on a
new system and haven't realized that you didn't install a package
needed to run tests you care about (e.g. cvsserver tests would not
run without Perl interface to SQLite). For the former, the bold
output is merely distracting; for the latter, bold _might_ help in
this case.
Very good point.
quoted hunk
At least, I think
GIT_SKIP_TESTS=t98?? sh t9800-git-p4-basic.sh -v
should paint "skipping test t9800 altogether" (emitted with "-v) and
the last line "1..0 # SKIP skip all tests in t9800" both in the same
"info" color.
How about going further to reduce "bold" a bit more, like this?
@@ -589,7 +589,7 @@ for skp in $GIT_SKIP_TESTS do case "$this_test" in $skp)- say_color skip >&3 "skipping test $this_test altogether"+ say_color info >&3 "skipping test $this_test altogether" skip_all="skip all tests in $this_test" test_done esac
Yes, I like this last hunk especially.
I have no objection in principle to a reduction in boldness.
However, I am beginning to get disheartened that at this rate, this
series will never land. I already submitted v4 of the series which
already had non-bold blue. I then received feedback indicating that
bold blue would be more suitable, so despite alarm bells beginning to
ring in my head, I submitted v5 with bold blue, declaring that that
would be my last version:
http://article.gmane.org/gmane.comp.version-control.git/206042
A further concern about "info" messages not being blue prompted me
to attempt to canvass more opinions:
http://article.gmane.org/gmane.comp.version-control.git/209321
I received none, so submitted v6 based on my best judgement. Now we
are talking about a potential v7 going *back* to non-bold blue. I can
submit v7 if you think it's worth it, but would that really be the end
of the discussion? It's clear from the above that colour scheme
design by committee is about as good an idea as asking a bunch of kids
to reach consensus on their favourite colour ;-)
So if possible I'd be very happy for Junio to simply make an executive
decision (I don't care which way, as long as it fits the traffic
lights scheme and uses distinct hues of blue/cyan for the different
categories of skip/info messages), tweak the latest v6 series
accordingly, and then push so that we can all go back to more pressing
things ;-)
Hopefully that is a reasonable way forward?
Thanks,
Adam
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
The old output to say "not ok - 1 messsage" was working by accident
only because the test numbers are optional in TAP.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/t0000-basic.sh | 4 ++--
t/test-lib.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
To conclude the bikeshedding discussion we had today, here is what I
queued by squashing stuff into relevant patches, so that people can
eyeball the result for the last time.
Adam Spiers (7):
tests: test number comes first in 'not ok $count - $message'
tests: paint known breakages in yellow
tests: paint skipped tests in blue
tests: change info messages from yellow/brown to cyan
tests: refactor mechanics of testing in a sub test-lib
tests: test the test framework more thoroughly
tests: paint unexpectedly fixed known breakages in bold red
t/t0000-basic.sh | 214 ++++++++++++++++++++++++++++++++++++++++++-------------
t/test-lib.sh | 29 +++++---
2 files changed, 184 insertions(+), 59 deletions(-)
--
1.8.1.rc2.225.g8d36ab4
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
Yellow seems a more appropriate color than bold green when
considering the universal traffic lights coloring scheme, where
green conveys the impression that everything's OK, and amber that
something's not quite right.
Likewise, change the color of the summarized total number of known
breakages from bold red to the same yellow to be less alarmist and
more consistent with the above.
An earlier version of this patch used bold yellow but because these
are all long-known failures, reminding them to developers in bold
over and over does not help encouraging them to take a look at them
very much. This iteration paints them in plain yellow instead to
make them less distracting.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/test-lib.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -281,7 +283,7 @@ test_known_broken_ok_ () { test_known_broken_failure_(){test_broken=$(($test_broken+1))-say_colorskip"not ok $test_count - $@ # TODO known breakage"+say_colorwarn"not ok $test_count - $@ # TODO known breakage"} test_debug(){
@@ -375,7 +377,7 @@ test_done () {fiiftest"$test_broken"!=0then-say_colorerror"# still have $test_broken known breakage(s)"+say_colorwarn"# still have $test_broken known breakage(s)"msg="remaining $(($test_count-$test_broken)) test(s)"elsemsg="$test_count test(s)"
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
This will allow us to test the test framework more thoroughly
without disrupting the top-level test metrics.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/t0000-basic.sh | 85 ++++++++++++++++++++++++++------------------------------
1 file changed, 40 insertions(+), 45 deletions(-)
@@ -55,39 +55,53 @@ test_expect_failure 'pretend we have a known breakage' 'false'-test_expect_success'pretend we have fixed a known breakage (run in sub test-lib)'"-mkdirpassing-todo&&-(cdpassing-todo&&-cat>passing-todo.sh<<-EOF&&-#!$SHELL_PATH--test_description='ApassingTODOtest--Thisisruninasubtest-libsothatwedonotgetincorrect-passingmetrics-'--# Point to the t/test-lib.sh, which isn't in ../ as usual-TEST_DIRECTORY=\"$TEST_DIRECTORY\"-.\"\$TEST_DIRECTORY\"/test-lib.sh+run_sub_test_lib_test(){+name="$1"descr="$2"# stdin is the body of the test code+mkdir"$name"&&+(+cd"$name"&&+cat>"$name.sh"<<-EOF&&+#!$SHELL_PATH++test_description='$descr(runinsubtest-lib)++Thisisruninasubtest-libsothatwedonotgetincorrect+passingmetrics+'++# Point to the t/test-lib.sh, which isn't in ../ as usual+."\$TEST_DIRECTORY"/test-lib.sh+EOF+cat>>"$name.sh"&&+chmod+x"$name.sh"&&+exportTEST_DIRECTORY&&+./"$name.sh">out2>err+)+}-test_expect_failure'pretend we have fixed a known breakage''-:-'+check_sub_test_lib_test(){+name="$1"# stdin is the expected output from the test+(+cd"$name"&&+!test-serr&&+sed-e's/^> //'-e's/Z$//'>expect&&+test_cmpexpectout+)+}+test_expect_success'pretend we have fixed a known breakage'"+run_sub_test_lib_testpassing-todo'A passing TODO test'<<-\\EOF&&+test_expect_failure'pretend we have fixed a known breakage''true'test_doneEOF-chmod+xpassing-todo.sh&&-./passing-todo.sh>out2>err&&-!test-serr&&-sed-e's/^> //'>expect<<-\\EOF&&+check_sub_test_lib_testpassing-todo<<-\\EOF>ok1-pretendwehavefixedaknownbreakage# TODO known breakage># fixed 1 known breakage(s)># passed all 1 test(s)>1..1EOF-test_cmpexpectout)"+ test_set_prereqHAVEIThaveit=no test_expect_successHAVEIT'test runs if prerequisite is satisfied''
@@ -137,19 +151,8 @@ thenfi test_expect_success'tests clean up even on failures'"-mkdirfailing-cleanup&&-(-cdfailing-cleanup&&--cat>failing-cleanup.sh<<-EOF&&-#!$SHELL_PATH--test_description='Failing tests with cleanup commands'--# Point to the t/test-lib.sh, which isn't in ../ as usual-TEST_DIRECTORY=\"$TEST_DIRECTORY\"-.\"\$TEST_DIRECTORY\"/test-lib.sh-+test_must_failrun_sub_test_lib_test\+failing-cleanup'Failing tests with cleanup commands'<<-\\EOF&&test_expect_success'tests clean up even after a failure''touchclean-after-failure&&test_when_finishedrmclean-after-failure&&
@@ -159,14 +162,8 @@ test_expect_success 'tests clean up even on failures' "test_when_finished\"(exit2)\"'test_done-EOF--chmod+xfailing-cleanup.sh&&-test_must_fail./failing-cleanup.sh>out2>err&&-!test-serr&&-!test-f\"trashdirectory.failing-cleanup/clean-after-failure\"&&-sed-e's/Z$//'-e's/^> //'>expect<<-\\EOF&&+check_sub_test_lib_testfailing-cleanup<<-\\EOF>notok1-testscleanupevenafterafailure># Z># touch clean-after-failure &&
@@ -180,8 +177,6 @@ test_expect_success 'tests clean up even on failures' "># failed 2 among 2 test(s)>1..2EOF-test_cmpexpectout-)"################################################################
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
Skipped tests indicate incomplete test coverage. Whilst this is not a
test failure or other error, it's still not a complete success.
Other testsuite related software like automake, autotest and prove
seem to use blue for skipped tests, so let's follow suit.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/test-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
Now that we've adopted a "traffic lights" coloring scheme, yellow is
used for warning messages, so we need to re-color info messages to
something less alarmist. Blue is a universal color for informational
messages; however we are using that for skipped tests in order to
align with the color schemes of other test suites. Therefore we use
cyan which is also blue-ish, but visually distinct from blue.
This was suggested on the list a while ago and no-one raised any
objections:
http://thread.gmane.org/gmane.comp.version-control.git/205675/focus=205966
An earlier iteration of this patch used bold cyan, but the point of
this change is to make them less alarming; let's drop the boldness.
Also paint the message to report skipping the whole thing via
GIT_SKIP_TESTS mechanism in the same color as the "info" color
that is used on the final summary line for the entire script.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/test-lib.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -584,7 +584,7 @@ for skp in $GIT_SKIP_TESTSdocase"$this_test"in$skp)-say_colorskip>&3"skipping test $this_test altogether"+say_colorinfo>&3"skipping test $this_test altogether"skip_all="skip all tests in $this_test"test_doneesac
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
Change color of unexpectedly fixed known breakages to bold red. An
unexpectedly passing test indicates that the test code is somehow
broken or out of sync with the code it is testing. Either way this is
an error which is potentially as bad as a failing test, and as such is
no longer portrayed as a pass in the output.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/t0000-basic.sh | 30 ++++++++++++++++++++++++------
t/test-lib.sh | 13 +++++++++----
2 files changed, 33 insertions(+), 10 deletions(-)
@@ -145,13 +145,31 @@ test_expect_success 'pretend we have fixed a known breakage' "test_doneEOFcheck_sub_test_lib_testpassing-todo<<-\\EOF->ok1-pretendwehavefixedaknownbreakage# TODO known breakage-># fixed 1 known breakage(s)-># passed all 1 test(s)+>ok1-pretendwehavefixedaknownbreakage# TODO known breakage vanished+># 1 known breakage(s) vanished; please update test(s)>1..1EOF"+test_expect_success'pretend we have fixed one of two known breakages (run in sub test-lib)'"+run_sub_test_lib_testpartially-passing-todos\+'2 TODO tests, one passing'<<-\\EOF&&+test_expect_failure'pretend we have a known breakage''false'+test_expect_success'pretend we have a passing test''true'+test_expect_failure'pretend we have fixed another known breakage''true'+test_done+EOF+check_sub_test_lib_testpartially-passing-todos<<-\\EOF+>notok1-pretendwehaveaknownbreakage# TODO known breakage+>ok2-pretendwehaveapassingtest+>ok3-pretendwehavefixedanotherknownbreakage# TODO known breakage vanished+># 1 known breakage(s) vanished; please update test(s)+># still have 1 known breakage(s)+># passed all remaining 1 test(s)+>1..3+EOF+"+ test_expect_success'pretend we have a pass, fail, and known breakage'"test_must_failrun_sub_test_lib_test\mixed-results1'mixed results #1'<<-\\EOF&&
@@ -199,10 +217,10 @@ test_expect_success 'pretend we have a mix of all possible results' "># false>notok8-pretendwehaveaknownbreakage# TODO known breakage>notok9-pretendwehaveaknownbreakage# TODO known breakage->ok10-pretendwehavefixedaknownbreakage# TODO known breakage-># fixed 1 known breakage(s)+>ok10-pretendwehavefixedaknownbreakage# TODO known breakage vanished+># 1 known breakage(s) vanished; please update test(s)># still have 2 known breakage(s)-># failed 3 among remaining 8 test(s)+># failed 3 among remaining 7 test(s)>1..10EOF"
From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:34
From: Adam Spiers <redacted>
Add 5 new full test suite runs each with a different number of
passing/failing/broken/fixed tests, in order to ensure that the
correct exit code and output are generated in each case. As before,
these are run in a subdirectory to avoid disrupting the metrics for
the parent tests.
Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
t/t0000-basic.sh | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
@@ -89,6 +89,56 @@ check_sub_test_lib_test () {)}+test_expect_success'pretend we have a fully passing test suite'"+run_sub_test_lib_testfull-pass'3 passing tests'<<-\\EOF&&+foriin123+do+test_expect_success\"passingtest#\$i\" 'true'+done+test_done+EOF+check_sub_test_lib_testfull-pass<<-\\EOF+>ok1-passingtest#1+>ok2-passingtest#2+>ok3-passingtest#3+># passed all 3 test(s)+>1..3+EOF+"++test_expect_success'pretend we have a partially passing test suite'"+test_must_failrun_sub_test_lib_test\+partial-pass'2/3 tests passing'<<-\\EOF&&+test_expect_success'passing test #1''true'+test_expect_success'failing test #2''false'+test_expect_success'passing test #3''true'+test_done+EOF+check_sub_test_lib_testpartial-pass<<-\\EOF+>ok1-passingtest#1+>notok2-failingtest#2+# false+>ok3-passingtest#3+># failed 1 among 3 test(s)+>1..3+EOF+"++test_expect_success'pretend we have a known breakage'"+run_sub_test_lib_testfailing-todo'A failing TODO test'<<-\\EOF&&+test_expect_success'passing test''true'+test_expect_failure'pretend we have a known breakage''false'+test_done+EOF+check_sub_test_lib_testfailing-todo<<-\\EOF+>ok1-passingtest+>notok2-pretendwehaveaknownbreakage# TODO known breakage+># still have 1 known breakage(s)+># passed all remaining 1 test(s)+>1..2+EOF+"+ test_expect_success'pretend we have fixed a known breakage'"run_sub_test_lib_testpassing-todo'A passing TODO test'<<-\\EOF&&test_expect_failure'pretend we have fixed a known breakage''true'
@@ -102,6 +152,61 @@ test_expect_success 'pretend we have fixed a known breakage' "EOF"+test_expect_success'pretend we have a pass, fail, and known breakage'"+test_must_failrun_sub_test_lib_test\+mixed-results1'mixed results #1'<<-\\EOF&&+test_expect_success'passing test''true'+test_expect_success'failing test''false'+test_expect_failure'pretend we have a known breakage''false'+test_done+EOF+check_sub_test_lib_testmixed-results1<<-\\EOF+>ok1-passingtest+>notok2-failingtest+># false+>notok3-pretendwehaveaknownbreakage# TODO known breakage+># still have 1 known breakage(s)+># failed 1 among remaining 2 test(s)+>1..3+EOF+"++test_expect_success'pretend we have a mix of all possible results'"+test_must_failrun_sub_test_lib_test\+mixed-results2'mixed results #2'<<-\\EOF&&+test_expect_success'passing test''true'+test_expect_success'passing test''true'+test_expect_success'passing test''true'+test_expect_success'passing test''true'+test_expect_success'failing test''false'+test_expect_success'failing test''false'+test_expect_success'failing test''false'+test_expect_failure'pretend we have a known breakage''false'+test_expect_failure'pretend we have a known breakage''false'+test_expect_failure'pretend we have fixed a known breakage''true'+test_done+EOF+check_sub_test_lib_testmixed-results2<<-\\EOF+>ok1-passingtest+>ok2-passingtest+>ok3-passingtest+>ok4-passingtest+>notok5-failingtest+># false+>notok6-failingtest+># false+>notok7-failingtest+># false+>notok8-pretendwehaveaknownbreakage# TODO known breakage+>notok9-pretendwehaveaknownbreakage# TODO known breakage+>ok10-pretendwehavefixedaknownbreakage# TODO known breakage+># fixed 1 known breakage(s)+># still have 2 known breakage(s)+># failed 3 among remaining 8 test(s)+>1..10+EOF+"+ test_set_prereqHAVEIThaveit=no test_expect_successHAVEIT'test runs if prerequisite is satisfied''
From: Jeff King <hidden> Date: 2016-06-15 22:55:34
On Thu, Dec 20, 2012 at 07:12:31PM -0800, Junio C Hamano wrote:
To conclude the bikeshedding discussion we had today, here is what I
queued by squashing stuff into relevant patches, so that people can
eyeball the result for the last time.
Thanks, this looks OK to me.
And thank you, Adam, for your patience. Seven iterations of color
bikeshedding is more than should be asked of anyone. :)
-Peff
From: Adam Spiers <redacted>
Yellow seems a more appropriate color than bold green when
considering the universal traffic lights coloring scheme, where
green conveys the impression that everything's OK, and amber that
something's not quite right.
Here are few more details about the behaviour of other testing
tools, in case you want to squash them in the commit message for
future references:
1. Automake (at least up to 1.13) and Autotest (at least up to the
2.69 Autoconf release) use "bold" green for reporting expected
failures.
2. On the other hand, the 'prove' utility (as of TAP::Harness v3.23
and Perl v5.14.2) use yellow (not bold) for the same purpose.
Regards,
Stefano
From: Adam Spiers <hidden> Date: 2016-06-15 22:55:34
On Fri, Dec 21, 2012 at 8:15 AM, Jeff King [off-list ref] wrote:
On Thu, Dec 20, 2012 at 07:12:31PM -0800, Junio C Hamano wrote:
quoted
To conclude the bikeshedding discussion we had today, here is what I
queued by squashing stuff into relevant patches, so that people can
eyeball the result for the last time.
Great, thanks a lot Junio.
Thanks, this looks OK to me.
To me too.
And thank you, Adam, for your patience. Seven iterations of color
bikeshedding is more than should be asked of anyone. :)