Page MenuHomePhabricator

Further improvements to test discovery
ClosedPublic

Authored by joshuaspence on Jun 7 2015, 8:58 AM.
Tags
None
Referenced Files
F13126439: D13185.diff
Tue, Apr 30, 4:31 PM
Unknown Object (File)
Thu, Apr 25, 12:58 AM
Unknown Object (File)
Mon, Apr 22, 2:12 AM
Unknown Object (File)
Thu, Apr 11, 8:44 AM
Unknown Object (File)
Sat, Apr 6, 2:44 AM
Unknown Object (File)
Tue, Apr 2, 3:10 AM
Unknown Object (File)
Mar 30 2024, 6:01 PM
Unknown Object (File)
Mar 24 2024, 2:28 PM
Subscribers

Details

Summary

I found another issue with T8042... it seems that tests from the root directory (i.e. src/__tests__ are not being discovered properly). The handling of this case ($library_path being the library root directory) can probably be improved, and I am open to suggestions. Depends on D13202.

Test Plan

Added to existing test cases.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningsrc/unit/engine/PhutilUnitTestEngine.php:211TXT3Line Too Long
Unit
Test Failures
Build Status
Buildable 6734
Build 6756: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
5 msPhpunitTestEngineTestCase::testSearchLocations
0 msArcanistLibraryTestCase::testEverythingImplemented
28 msArcanistLibraryTestCase::testLibraryMap
50 msArcanistLibraryTestCase::testMethodVisibility
0 msPhutilUnitTestEngineTestCase::testFailSkip
View Full Test Results (1 Failed · 8 Passed)

Event Timeline

joshuaspence retitled this revision from to Further improvements to test discovery.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Since the complexity mostly arises out of dirname()'s behavior being a bit of a mess, maybe this would be cleaner:

  • Update PhabricatorFilesystem::walkToRoot() to take a second parameter (like $root) which specifies a parent directory where iteration should stop.
  • Get some test coverage on that, since it'll be easy to test properly outside of need to do a bunch of unit test stuff (e.g., path same as root, path outside root, path a symlink into root).
  • Replace the manual directory fiddling here with walkToRoot().

I think that would make this a bit simpler and less error prone.

src/unit/engine/PhutilUnitTestEngine.php
201

Do we now sometimes end up with the key libname:. and sometimes with the key libname: for root tests?

211

The unlikely path 0 will do the wrong thing here (output will be __tests__/, should be 0/__tests__/).

This revision is now accepted and ready to land.Jun 7 2015, 2:02 PM

Ah, it looks like the failing unit test was caused by D13202.

joshuaspence marked 2 inline comments as done.

Fix a few minor issues

joshuaspence edited edge metadata.

Wanted to make sure this is still okay

epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 14 2015, 1:06 PM
This revision was automatically updated to reflect the committed changes.