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
F14076210: D15819.id38107.diff
Thu, Nov 21, 3:56 PM
Unknown Object (File)
Wed, Nov 20, 11:10 AM
Unknown Object (File)
Wed, Nov 20, 10:49 AM
Unknown Object (File)
Mon, Nov 18, 11:49 PM
Unknown Object (File)
Tue, Nov 12, 10:12 AM
Unknown Object (File)
Tue, Nov 12, 8:15 AM
Unknown Object (File)
Fri, Nov 1, 11:30 AM
Unknown Object (File)
Sat, Oct 26, 5:12 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.