Details
- Used code to identify violations.
- Hit exception under arc unit --everything.
Diff Detail
- Repository
- rPHU libphutil
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Changing this file is also not triggering the test itself, which is a bug, but I'm just going to ignore that for the moment.
Interesting... one issue that I noticed with this is that it fails if any of the loaded libraries violate the method visibility rule. For example, I just hit this in rP:
> arc unit -- src/ FAIL PhabricatorLibraryTestCase::testMethodVisibility Assertion failed, expected values to be equal (at PhutilLibraryTestCase.php:88): Class "ArcanistPhpcsLinter" implements method "getMandatoryFlags" with the wrong visibility. The method has visibility "public", but it is defined in parent "ArcanistExternalLinter" with visibility "protected". In Phabricator, a method which overrides another must always have the same visibility. Expected: 'protected' Actual: 'public'
I think testing the depends-on libraries implicitly is fine, the testEverythingImplemented() test effectively does this too. Getting multiple test failures from one root cause isn't great in either case, but we could have the subclasses coordinate if we ever care to fix that. Doesn't seem like a big deal.
The immediate fixes I can come up (some static "this has run" flag) with would incorrectly break if something tried to run the test twice, which seems sort-of worse than just reporting the failure twice.
I guess you could clear the flag in willRunTests() and then set it in the first test to run? If that's not too much of a mess, maybe worthwhile, but I haven't looked at that code too recently. Either way seems fine to me.