Page MenuHomePhabricator

Modernize PhpunitTestEngine to work with .arcunit
Needs ReviewPublic

Authored by Firehed on May 12 2016, 1:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 4:12 PM
Unknown Object (File)
Wed, Mar 27, 12:24 PM
Unknown Object (File)
Wed, Mar 27, 12:24 PM
Unknown Object (File)
Wed, Mar 27, 12:24 PM
Unknown Object (File)
Wed, Mar 20, 6:07 PM
Unknown Object (File)
Wed, Mar 20, 6:07 PM
Unknown Object (File)
Wed, Mar 20, 4:27 PM
Unknown Object (File)
Wed, Mar 20, 3:10 PM
Tokens
"Like" token, awarded by svemir.

Details

Reviewers
joshuaspence
epriestley
Group Reviewers
Blessed Reviewers
Summary

Updates the configuration process of PHPUnit test engine to support .arcunit-driven setup. Adds a bit of additional infrastructure so other Unit engines can indicate their configuration needs.

Works towards T5568, and depends on (well, technically includes) D15880.

  • Paramaterize engine configuration in .arcunit file
  • Allow PHPUnit engine to be configured with .arcunit
  • Sanity check that PHPUnit is found
  • Rework config handling in PHPUnit engine
Test Plan

other than running the unit tests on this project, I ran arc unit on two other projects: one with a unit engine configured in .arcconfig, and a second with the following .arcunit file:

{
    "engines": {
        "phpunit": {
            "type": "phpunit",
            "include": "(\\.php$)",
            "flags": {
                "--whitelist": "$ROOT/src",
                "--include-path": "~/dev"
            },
            "binary": "vendor/bin/phpunit"
        }
    }
}

I observed the desired unit test commands being run in the trace output

Diff Detail

Repository
rARC Arcanist
Branch
phpunit_config (branched from master)
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php:84XHP16TODO Comment
Advicesrc/unit/engine/PhpunitTestEngine.php:278XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 12160
Build 15341: arc lint + arc unit

Event Timeline

Firehed retitled this revision from to Modernize PhpunitTestEngine to work with .arcunit.
Firehed updated this object.
Firehed edited the test plan for this revision. (Show Details)

I'd like to get some feedback on the initial implementation, I'll go back and address the couple of TODOs. Note that the change to PhutilUnitTestEngine and one change in ArcanistConfigurationDrivenUnitEngine are actually D15880 because I branched from the wrong place.

(See T10038 - lints are very low priority now)

Noted. This is by no means an urgent thing (I have a Composer package to mostly the same effect, it just seems silly to be maintaining it twice), and all else being equal I'd rather spend time thinking about the bigger solution. But in the name of all things holy, please don't reinvent Composer as T5055 is basically getting at.