Page MenuHomePhabricator

When running XHPAST unit tests, include the "syntax error" lint rule
ClosedPublic

Authored by epriestley on Apr 29 2016, 1:02 PM.
Tags
None
Referenced Files
F13243816: D15819.diff
Thu, May 23, 4:15 AM
F13222269: D15819.diff
Sun, May 19, 3:27 AM
F13205536: D15819.diff
Wed, May 15, 2:06 AM
F13204844: D15819.diff
Wed, May 15, 1:10 AM
F13188018: D15819.diff
Sat, May 11, 4:54 AM
Unknown Object (File)
Tue, May 7, 8:11 AM
Unknown Object (File)
Sun, May 5, 6:43 PM
Unknown Object (File)
Fri, May 3, 7:53 AM
Subscribers
None

Details

Summary

See rARC3ffed59bd7. Currently, when a unit test includes a syntax error, it is raised in an unclear way ("error at line 10, char 1: XHP1 Unknown lint message!").

This is because each test case only activates rules it wants to test, so we lose the ID/name for the syntax message. However, we always want to test this and the lint engine can always raise it.

To get a better error message, include it unconditionally. So a test for rule X really tests two rules: syntax, and X.

Test Plan

Ran arc unit at HEAD, got a better test failure:

   FAIL  ArcanistCallTimePassByReferenceXHPASTLinterRuleTestCase::testLinter
In 'call-time-pass-by-reference.lint-test', expected lint to raise error on line 10 at char 8, but no error was raised. Actually raised:
  error at line 10, char 1: XHP1 PHP Syntax Error!
NOTE: This doesn't pass tests yet, it just makes the test failure easier to understand. I'll see about fixing the test in the next change.

Diff Detail

Repository
rARC Arcanist
Branch
xhpast1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11980
Build 15069: Run Core Tests
Build 15068: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to When running XHPAST unit tests, include the "syntax error" lint rule.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, richardvanvelzen.
This revision is now accepted and ready to land.Apr 29 2016, 1:03 PM
This revision was automatically updated to reflect the committed changes.