]> khamidou — GitHub mirrors - arcanist.git/commit
Have Arcanist record how much of my life was spent running each unit test
authorJames Ide <ide+github@jameside.com>
Mon, 4 Jul 2011 06:31:14 +0000 (23:31 -0700)
committerJames Ide <ide+github@jameside.com>
Mon, 4 Jul 2011 06:32:27 +0000 (23:32 -0700)
commit2892c6ef1a2a9f7354342093ac4f30871b7d3b6f
tree905bd742dc184b6b9c1e4f53e5440a34a1e1f914
parent304a2c73aa5d0c6a39229c23e431241d7d76723d
Have Arcanist record how much of my life was spent running each unit test

Summary:
Keeping unit tests speedy keeps them useful since people actually won't mind
running them. This diff records the time taken by each test and displays it nice
and colorized. Really, I just want to discourage non-unit tests from making
their way into ##__tests__##.

Some thoughts:

 - The "acceptableness" times are subjective but if dependencies are properly
mocked the times seem to be ok. Integration tests that make network requests to
third-party endpoints and pull in megabytes of data will not survive. This is a
good thing.
 - Fast tests get a gold star, encouraging small tests. I am sorry that the star
does not sparkle.
 - There is no way for a programmer to admit that their test is going to be slow
in some cases. They will be shamed with red text for the life of their test.
 - It might be confusing that fast but failing tests get green text and maybe a
gold star.

Test Plan: Ran some of the unit tests within Arcanist and libphutil. See
https://secure.phabricator.com/file/view/PHID-FILE-cdd3c94c219e0fd7470b/ for
sample output.
Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley
Differential Revision: 588
src/unit/engine/phutil/testcase/ArcanistPhutilTestCase.php
src/unit/result/ArcanistUnitTestResult.php
src/workflow/unit/ArcanistUnitWorkflow.php