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
Unknown Object (File)
Sun, May 5, 6:43 PM
Unknown Object (File)
Fri, May 3, 7:53 AM
Unknown Object (File)
Sat, Apr 27, 8:46 AM
Unknown Object (File)
Thu, Apr 25, 1:50 AM
Unknown Object (File)
Wed, Apr 24, 3:36 AM
Unknown Object (File)
Wed, Apr 24, 3:36 AM
Unknown Object (File)
Wed, Apr 24, 3:36 AM
Unknown Object (File)
Wed, Apr 24, 3:35 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.