Page MenuHomePhorge

Update PhpunitTestEngine to not call phpunit with --log-json option
Closed, ResolvedPublic

Description

The PhpunitTestEngine arcanist test engine, which you would assume to be the default test engine for any new PHP project is broken as it calls phpunit with the '--log-json' option.

--log-json was deprecated in PHPUnit 5.7, and removed in PHPUnit 6.0.0 (2017-02-03)

Event Timeline

6 year old in-your-face unreported bugs like these make me wonder how many people use Phabricator/Phorge :-(

In T15667#14211, @Sten wrote:

how many people use Phabricator/Phorge :-(

How many people use Arcanist* :)

On my laptop I have PHPUnit 8.5.2 and I never met any crash related to this. How do you suggest to reproduce this?

(I mean, I trust you, and I see it's deprecated, but I would like to see how to trigger this feature, so to see crash and a stack trace and usages)

More complete test case added to D25472 which demonstrates the following error:

LOAD  Loaded "arcanist" from "/Users/me/arcanist/src".
Config: Reading user configuration file "/Users/me/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Volumes/Projects/example-phorge-php-project/.arcconfig".
Working Copy: Path "/Volumes/Projects/example-phorge-php-project" is part of `git` working copy "/Volumes/Projects/example-phorge-php-project".
Working Copy: Project root is at "/Volumes/Projects/example-phorge-php-project".
Config: Did not find local configuration at "/Volumes/Projects/example-phorge-php-project/.git/arc/config".
>>> [1] (+0) <exec> $ git rev-parse --verify HEAD^
<<< [1] (+12) <exec> 12,233 us
>>> [2] (+12) <exec> $ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
<<< [2] (+23) <exec> 10,941 us
>>> [3] (+23) <exec> $ git cat-file -t origin/master
<<< [3] (+34) <exec> 10,769 us
>>> [4] (+34) <exec> $ git merge-base -- origin/master HEAD
<<< [4] (+47) <exec> 12,635 us
>>> [5] (+47) <exec> $ git diff --no-ext-diff --no-textconv --submodule=short --raw eb3ed33652c8e5a8f40abbfdf9393b3f10a7d319 HEAD --
<<< [5] (+58) <exec> 11,286 us
>>> [6] (+58) <exec> $ git --version
<<< [6] (+69) <exec> 10,709 us
>>> [7] (+69) <exec> $ git status --porcelain=2 -z
<<< [7] (+80) <exec> 11,547 us
>>> [8] (+82) <exec> $ phpunit -c /Volumes/Projects/example-phorge-php-project/phpunit.xml -d display_errors=stderr --log-json /private/var/folders/m3/rln12jbn4wj3m22zhq06r93r0000gp/T/1p3d7xxj05no80gk/78239-O2EVep --coverage-clover /private/var/folders/m3/rln12jbn4wj3m22zhq06r93r0000gp/T/1y7jkbjuy45c80gs/78239-qXs3Ji /Volumes/Projects/example-phorge-php-project/tests/ServiceTest.php
<<< [8] (+125) <exec> 42,762 us
   BROKEN  /Volumes/Projects/example-phorge-php-project/tests/ServiceTest.php
<<< [1] (+219) <exec> 219,396 us

Running that final command manually shows:

example-phorge-php-project $ phpunit -c /Volumes/Projects/example-phorge-php-project/phpunit.xml -d display_errors=stderr --log-json /private/var/folders/m3/rln12jbn4wj3m22zhq06r93r0000gp/T/1p3d7xxj05no80gk/78239-O2EVep --coverage-clover /private/var/folders/m3/rln12jbn4wj3m22zhq06r93r0000gp/T/1y7jkbjuy45c80gs/78239-qXs3Ji /Volumes/Projects/example-phorge-php-project/tests/ServiceTest.php
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

Unknown option "--log-json"

As an aside, what do you think of https://github.com/campbsb/example-phorge-php-project - should we put a selection of example projects on https://we.phorge.it, either as individual repos, or one repo containing a bunch of examples, or somewhere in the arcanist repo ?

6 year old in-your-face unreported bugs like these make me wonder how many people use Phabricator/Phorge :-(

It's not many, but this issue would be specific to anyone using Phabricator/Phorge for PHP development, which is likely Phab/Phorge itself is close to 100% of that market. And Phab/Phorge also itself has its own unit testing framework instead of PHPUnit.