Skip to content
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

Print timing info on executed tests #27

Merged
merged 6 commits into from
May 23, 2022
Merged

Print timing info on executed tests #27

merged 6 commits into from
May 23, 2022

Conversation

dmitryduev
Copy link
Member

@dmitryduev dmitryduev commented May 20, 2022

In this PR:

  • Print timing info on executed tests, sorted by execution time in reversed order (from slowest to fastest tests)

image

- Pre-commit hook to lint stuff - Another +15% to codecov with a simple test!

@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #27 (2c25462) into main (469813b) will increase coverage by 15.87%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #27       +/-   ##
===========================================
+ Coverage   52.35%   68.23%   +15.87%     
===========================================
  Files          12       12               
  Lines         997     1001        +4     
===========================================
+ Hits          522      683      +161     
+ Misses        475      318      -157     
Flag Coverage Δ
unittest 68.23% <75.00%> (+15.87%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/yea/cli.py 36.23% <0.00%> (ø)
src/yea/ytest.py 67.01% <0.00%> (+30.17%) ⬆️
src/yea/runner.py 75.27% <78.57%> (+18.81%) ⬆️
src/yea/__init__.py 100.00% <100.00%> (ø)
src/yea/context.py 98.33% <100.00%> (+16.66%) ⬆️
src/yea/schema.py 86.66% <100.00%> (ø)
src/yea/testcfg.py 77.27% <100.00%> (ø)
src/yea/plugins.py 52.30% <0.00%> (+16.92%) ⬆️
... and 1 more

@dmitryduev dmitryduev marked this pull request as ready for review May 21, 2022 08:31
@dmitryduev dmitryduev requested a review from raubitsj May 21, 2022 08:31
Copy link
Contributor

@kptkin kptkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

reverse=True,
)
for tc in timing_info:
print(f" {tc[1]:<{tlen}s}: {tc[0]:.1f}")
Copy link
Member Author

@dmitryduev dmitryduev May 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, that's right, it's (tc.elapsed_sec, tc.name) (for sorting), but I here I print the name first and the duration on the right, like on the screenshot above.

Copy link
Member

@raubitsj raubitsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT

@dmitryduev dmitryduev merged commit 2c9cf4e into main May 23, 2022
@dmitryduev dmitryduev deleted the timing branch May 23, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants