Page MenuHomePhabricator

Allow PhutilUnitTestEngine to execute tests from a single path
ClosedPublic

Authored by joshuaspence on May 4 2015, 10:38 AM.
Tags
None
Referenced Files
F13090996: D12689.diff
Thu, Apr 25, 2:41 AM
Unknown Object (File)
Sun, Mar 31, 6:13 PM
Unknown Object (File)
Fri, Mar 29, 11:03 PM
Unknown Object (File)
Mar 20 2024, 8:48 PM
Unknown Object (File)
Mar 20 2024, 6:06 PM
Unknown Object (File)
Mar 19 2024, 6:26 PM
Unknown Object (File)
Mar 17 2024, 2:32 PM
Unknown Object (File)
Feb 16 2024, 12:35 AM
Subscribers
Tokens
"Grey Medal" token, awarded by epriestley.

Details

Summary

Fixes T8042. Changes the way that PhutilUnitTestEngine discovers unit tests. In particular, if you only modify a single test case then there is no reason to run all other test cases within the same directory (which is the current behavior).

Test Plan

Added some unit tests.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Allow PhutilUnitTestEngine to execute tests from a single path.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

I think I caught an issue? At least, I don't understand the logic.

It would maybe be nice to have some kind of flag which shows which tests will be run without executing them, although maybe this is a task for another time (e.g., after T5568).

src/unit/engine/PhutilUnitTestEngine.php
189–190

I would expect && $library_path == $library_root to fail immediately in many cases and throw away most of the test we'd otherwise find.

e.g., if you touch /a/b/c/d/e, we'd previously walk up and include /a/b, but now we'll fail out at /a/b/c/d or /a/b/c/d/e or something?

This revision now requires changes to proceed.May 19 2015, 2:06 PM
epriestley edited edge metadata.

Nice!

src/unit/engine/PhutilUnitTestEngine.php
44–46

I think id() isn't necessary on newv(), only on new X(). PHP grammar lols

This revision is now accepted and ready to land.May 25 2015, 4:09 PM
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence marked an inline comment as done.

Oops

This revision was automatically updated to reflect the committed changes.