mahmoudimus / nose-timer

A timer plugin for nosetests (how much time does every test take?)
MIT License
126 stars 33 forks source link

Report percentage time in printed report #77

Closed Carreau closed 7 years ago

Carreau commented 8 years ago

Looks like that, I think it is useful to get an idea of the time taken by a test, instead of glancing at the total time.

[success] 9.22% ipykernel.tests.test_kernel.test_subprocess_print: 3.0287s
[success] 8.99% ipykernel.tests.test_embed_kernel.test_embed_kernel_reentrant: 2.9547s
[success] 6.24% ipykernel.tests.test_embed_kernel.test_embed_kernel_basic: 2.0496s
[success] 6.17% ipykernel.tests.test_kernel.test_subprocess_error: 2.0285s
[success] 6.17% ipykernel.tests.test_kernel.test_sys_path_profile_dir: 2.0278s
[success] 6.15% ipykernel.tests.test_kernel.test_shutdown: 2.0204s
[success] 5.91% ipykernel.tests.test_embed_kernel.test_embed_kernel_namespace: 1.9406s
[success] 5.91% ipykernel.tests.test_start_kernel.test_ipython_start_kernel_userns: 1.9406s
[success] 5.88% ipykernel.tests.test_start_kernel.test_ipython_start_kernel_no_userns: 1.9328s
[success] 4.61% ipykernel.tests.test_message_spec.test_execute_stop_on_error: 1.5151s
[success] 4.16% ipykernel.tests.test_kernel.test_simple_print: 1.3669s
[success] 2.86% ipykernel.tests.test_kernel.test_help_output: 0.9386s
[success] 2.12% ipykernel.tests.test_kernel.test_subprocess_noprint: 0.6979s
skudriashev commented 8 years ago

LGTM. @mahmoudimus?

mahmoudimus commented 8 years ago

👍 lgtm

skudriashev commented 8 years ago

@mahmoudimus, @Carreau, I think this feature should be controllable via command line options. What you think?

skudriashev commented 8 years ago

@Carreau, please add your name into contributors list. Thanks.

mahmoudimus commented 8 years ago

@skudriashev @Carreau something I thought about was I mentioned this earlier in issue #13 and #57. The feedback I received was https://github.com/mahmoudimus/nose-timer/issues/13#issuecomment-49637806.

Carreau commented 8 years ago

@Carreau, please add your name into contributors list. Thanks.

Done, Sorry for the delay to respond I had a lot on my plate recently.

I think this feature should be controllable via command line options. What you think?

I can probably do that, though it might make the code much more complicated and harder to maintain as you can get 2 kinds of outputs. And then came the question of default value.

I often think this feature is useful after the fact (Which percentage was this taking 3 month ago ?) – and people are known to be bad at enabling options. If the percentage is on by default; is it worth having a way to disable it ? And in which case is it usefull ?

Anyway I'm new to this codebase so will follow your decision.

mahmoudimus commented 8 years ago

@Carreau why would this be better than using something like xunit which gives a parseable report? Did you see my comment here: https://github.com/mahmoudimus/nose-timer/pull/77#issuecomment-232498590 ?

Carreau commented 8 years ago

@Carreau why would this be better than using something like xunit which gives a parseable report? Did you see my comment here: #77 (comment) ?

Oh, sorry, because my things are autorunning on travis and using xunit output requires to upload artefacts, and then visualise them using a software. It's useful and a good route if you have the resources to put in that, but not somethings that most open-source software won't/can't invest into.

Having a "hey pip install that and add this flag" is much more likely to get accepted than a change everything to use xunit.

I might be wrong though, or misunderstood your statement about xunit.

Honestly I'd love to have my travis build and push a gh-pages (or to a service) that parse xunit (or json) and display a time report as a service without having to setup a full service, haven't found it though.

e0ne commented 7 years ago

LGTM