mahmoudimus / nose-timer

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

Added the possibility to set float values for the timer_ok and timer_warning options #24

Closed cmdelatorre closed 10 years ago

cmdelatorre commented 10 years ago

Changed the cast to int for _timerok and _timerwarning options. Now float values are accepted.

e0ne commented 10 years ago

Hi @cmdelatorre. Thanks for contribution. I'm not sure that we need such feature. Could you explain your use-case, please? May be it would be better to use milliseconds and add one more param: to use seconds or milliseconds.

cmdelatorre commented 10 years ago

Hi there,

I need this feature because we have a suite of +1000 unit tests, most of which run in under 1 second. Around 20% of the tests take longer than 1 second. The slower test runs in less than 4 seconds.

Unit-tests are supposed to be really small, so I consider this to be a very normal situation. For example, this is a typical situation if you do TDD, XD, etc.

Actually, I don't really think I should be explaining this: doing some quick search shows that there's consensus on the fact that a unit test should run in under 1/10th of a second.

With that being said, the current options of your plugin are only useful for non-unit-test suites. I suppose whole-system-level functional or integration testing are normally such cases. Could you explain to me what kind of testing do you perform?

Please, let me know what do you think. I'll be glad to continue with this discussion.

Kind regards,

Carlos de la Torre

On Fri, Jan 10, 2014 at 8:01 PM, Ivan Kolodyazhny notifications@github.comwrote:

Hi @cmdelatorre https://github.com/cmdelatorre. Thanks for contribution. I'm not sure that we need such feature. Could you explain your use-case, please? I and @mahmoudimus https://github.com/mahmoudimus will be happy to merge this PR, it it is needed for somebody else.

— Reply to this email directly or view it on GitHubhttps://github.com/mahmoudimus/nose-timer/pull/24#issuecomment-32075635 .

Carlos Matías

e0ne commented 10 years ago

Thanks for detailed answer. You are absolutely right about unit and functional/integration tests timings. I have more experience functional tests using nose than unit tests.

What do you think about using milliseconds instead seconds if needed? Something like nosetests --with-timer --timer-ok 2s and nosetests --with-timer --timer-ok 20ms

mahmoudimus commented 10 years ago

I agree with @e0ne's approach of ms instead of @cmdelatorre's float. We should tend to avoid floating point whenever unless we absolutely have to.

mahmoudimus commented 10 years ago

Closing in favor of #30