-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add confval console_output_style
option times
#13126
base: main
Are you sure you want to change the base?
Conversation
@afcmrp can you add a sample output using the new option to the PR description? |
@nicoddemus Yes of course. Non-verbose:
Verbose:
|
I like the output, thanks! I will review the code ASAP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this all looks great!
Playing around with it with xdist:
[gw0]101.1ms PASSED .tmp/test_bar.py::test_bar[0]
.tmp/test_bar.py::test_bar[1]
[gw0]541.1ms PASSED .tmp/test_bar.py::test_bar[1]
.tmp/test_bar.py::test_bar[6]
[gw2]179.7us PASSED .tmp/test_bar.py::test_bar[4]
.tmp/test_bar.py::test_bar[5]
[gw1]188.4us PASSED .tmp/test_bar.py::test_bar[2]
And without the option:
[gw2] [ 6%] PASSED .tmp/test_bar.py::test_bar[4]
.tmp/test_bar.py::test_bar[5]
[gw0] [ 12%] PASSED .tmp/test_bar.py::test_bar[0]
.tmp/test_bar.py::test_bar[1]
[gw2] [ 18%] PASSED .tmp/test_bar.py::test_bar[5]
.tmp/test_bar.py::test_bar[6]
[gw1] [ 25%] PASSED .tmp/test_bar.py::test_bar[2]
The timing is "glued" to the gateway name ([gw0]101.1ms PASSED
), I think it would look better if it was separated by a space ([gw0] 101.1ms PASSED
).
Can you fix that and add a test for it?
Some final bikeshedding: perhaps the option should be |
Yes, agreed. Of those two I prefer |
To me |
console_output_style
option timer
console_output_style
option times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks, excellent contribution!
I will leave this open for a few more days to give others a chance to chime in.
Adds an additional confval
times
toconsole_output_style
.Design decisions
Duration format
The duration format should be as short, detailed and human readable as possible. It also needs to predictable in terms of character length to know how much space to allocate to the right in the console output.
I landed on this:
30m 59s
10.124s
9.124s
123.6ms
12.36ms
This maintains relatively high resolution for all duration lengths, keeps the string maximum 7 characters long (for durations below 100 hours) and is pleasant to look at.
Verbose vs non-verbose
For the non-verbose case I decided to sum up the durations for all tests per file to keep things as consistent with the other
console_output_style
's as possible. Additionally, teardown is currently only counted for the non-verbose case.Example output
Non-verbose
Verbose
Closes #13125