New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 733041 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

test_runner.py colored logging feedback

Project Member Reported by mikec...@chromium.org, Jun 14 2017

Issue description

This CL is adding color based on log level to logging output from test_runner.py

https://chromium-review.googlesource.com/c/534494/

Please give any feedback here! thanks
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a9c9e782357e558897aa5874214b04132c6d5ae

commit 6a9c9e782357e558897aa5874214b04132c6d5ae
Author: Mike Case <mikecase@google.com>
Date: Wed Jun 14 03:08:47 2017

Add color to test_runner.py output.

Adds color (depending on logging level) to test_runner.py output.

Change-Id: Ic4b8423ea4166d0368450b361cb07511f57962ac
Bug: 733041
Reviewed-on: https://chromium-review.googlesource.com/534494
Commit-Queue: Michael Case <mikecase@chromium.org>
Reviewed-by: John Budorick <jbudorick@google.com>
Cr-Commit-Position: refs/heads/master@{#479269}
[modify] https://crrev.com/6a9c9e782357e558897aa5874214b04132c6d5ae/build/android/pylib/utils/logging_utils.py
[modify] https://crrev.com/6a9c9e782357e558897aa5874214b04132c6d5ae/build/android/test_runner.py
[modify] https://crrev.com/6a9c9e782357e558897aa5874214b04132c6d5ae/build/android/test_runner.pydeps

Comment 2 by awdf@chromium.org, Jun 14 2017

Haven't tried this yet, but from the screenshot you sent round, looks like results are always highlighted red regardless of outcome (?)

I think it would be nice if the results could be highlighted green if all the tests pass, and red otherwise.

Comment 3 by awdf@chromium.org, Jun 14 2017

ps. Thanks for doing this, hooray for more colourful logs! :)
Yeah, currently the only thing that effects the color is logging level (DEBUG, INFO, ERROR, CRITICAL). Will look into making it not bright red in case of failure.

Comment 5 by mge...@chromium.org, Jun 15 2017

I just synced and got this change, and I'm finding the white on bright red hard to read and kind of alarming. (Screenshot attached.) I like the general idea, but can this be done in a way that avoids changing background color?
red.png
384 KB View Download
Yeah, Ill change the color for the CRITICAL logging (since all test results are logged at that level). In the future, we will probably write a most customized (smarter) log handler for our test runner.
Changing coloring so that logs are only colored if you use --verbose, -v, -vv logging. This is the most useful case imo anyway. And will save people from having to stare at bright red results logs.

Comment 8 by dgn@chromium.org, Jun 22 2017

It would also be nice if a "all pass" message was not treated like an error (e.g. soothing green instead of scary red).

It's possible that changing the log level from Critical would break some parsers, so maybe the display of the result should be made independent from the log level? 

Comment 9 by dgn@chromium.org, Jun 22 2017

Cc: dgn@chromium.org
Project Member

Comment 10 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eb709ae5b1db1b2e96d1d396b4f81c4f24fa6adf

commit eb709ae5b1db1b2e96d1d396b4f81c4f24fa6adf
Author: Mike Case <mikecase@google.com>
Date: Mon Jun 26 18:20:38 2017

Only color logging for verbose logs.

Some people do not appreciate bright red test results. Changing
to only colorize logs if -v or -vv args are passed to test runner.
This is the most useful use case.

Bug: 733041
Change-Id: I6e4c93353dddfc67cc934f7c1a98c5fefd5a4271
Reviewed-on: https://chromium-review.googlesource.com/537232
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Michael Case <mikecase@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482325}
[modify] https://crrev.com/eb709ae5b1db1b2e96d1d396b4f81c4f24fa6adf/build/android/pylib/utils/logging_utils.py
[modify] https://crrev.com/eb709ae5b1db1b2e96d1d396b4f81c4f24fa6adf/build/android/test_runner.py

Sign in to add a comment