Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back TAP #2683

Closed
dzuelke opened this issue May 17, 2017 · 11 comments
Closed

Bring back TAP #2683

dzuelke opened this issue May 17, 2017 · 11 comments

Comments

@dzuelke
Copy link
Contributor

dzuelke commented May 17, 2017

I couldn't find the reason for the removal of TAP logging, and I hadn't seen the deprecation notice for 5.7, or I would have spoken up earlier.

I'd like to argue in favor of bringing back TAP output, simply because it's the only machine-readable output that allows for streaming of progress!

@gudmundur
Copy link

I work on Heroku CI, and I'd love to see TAP support re-introduced. Due to the fact that TAP is the only somewhat standardized test output format that can be streamed we support it for real time details about what's going on during a test run. Generally all of the JSON and JUnit formats are written after the fact, not while tests are running.

@sebastianbergmann
Copy link
Owner

In all the time that PHPUnit had out-of-the-box support for TAP I have never used it and, more importantly, never met somebody who used it. Futhermore, it causes problems due to its dependency on Symfony's YAML component at some point.

Long story short: I will not bring back TAP.

If you need a streaming logger then you should have a look at the TeamCity test listener that is used by PhpStorm, for instance.

If you really need TAP then you can implement your own test listener that emits TAP and configure it in your phpunit.xml. Feel free to use https://github.com/sebastianbergmann/phpunit/blob/5.7/src/Util/Log/TAP.php as the basis for that. There is no need for something like this to be part of the "standard PHPUnit distribution".

@rsrchboy
Copy link

rsrchboy commented Aug 3, 2017

Well, that's somewhat unfortunate :\ Has anyone created such a test listener? All google is really telling me is "call phpunit with --log-tap", but that's not available anymore.

@sebastianbergmann
Copy link
Owner

If nobody has created such a separate package then, I guess, nobody really misses the functionality enough.

@gudmundur
Copy link

@sebastianbergmann Not sure that it's necessarily a correct assumption. Another option is a matter of prioritization.

@cnizzardini
Copy link

cnizzardini commented Nov 14, 2017

@sebastianbergmann PHPCI uses it https://github.com/Block8/PHPCI/blob/master/PHPCI/Plugin/PhpUnit.php#L202

And it is causing issues now: dancryer/PHPCI#1305

@rinu
Copy link

rinu commented Apr 30, 2018

This is the top result when googling "phpunit tap" so it should include a proper solution. I'm here because Ubuntu 18.04 LTS was recently released and it upgraded to phpunit 6.

If all you need is to see which tests executed, the easiest solution is to replace --tap with --debug. The output is very similar but --debug is not as good as --tap for scripting.

I also attempted to use my own test listener but there's no obvious way to override the default (ResultPrinter) output. Also, the same listener wouldn't work on phpunit 4, 5, 6 and 7 as the function definitions have changed (to namespaces and then PHP 7 type hints). I don't think there's a way to switch listeners based on phpunit version.

gmponos added a commit to gmponos/skeleton that referenced this issue Nov 6, 2018
Hello there,

I guess there is no reason suggesting to developers to keep adding TAP adapter.

sebastianbergmann/phpunit#2683 (comment)
@davidolrik
Copy link

For all those googling and finding this sad issue, here is a solution: https://github.com/gh640/phpunit-tap

@epdenouden
Copy link
Contributor

epdenouden commented Nov 5, 2019

@davidolrik PHPUnit is getting a new event system, for which work is already underway by @localheinz and @theseer: a living doc of events to be implemented and the working branch.

The rewrite of the loggers will provide an event stream in a way that is compatible with all filtering, grouping and reordering features. This will make it very simple to implement custom loggers like TAP.

samizdam added a commit to samizdam/route that referenced this issue Mar 13, 2020
Totktonada added a commit to tarantool/tarantool-php that referenced this issue Mar 26, 2020
It is not supported by recent phpunit versions (see [1]) and is not
actually used in our testing process. So it becomes just dead code and
it worth to remove it.

We'll bring newer phpunit versions in further commits to test the
connector against more recent PHP versions (see [2]).

[1]: sebastianbergmann/phpunit#2683
[2]: https://phpunit.de/supported-versions.html
Totktonada added a commit to tarantool/tarantool-php that referenced this issue Mar 28, 2020
It is not supported by recent phpunit versions (see [1]) and is not
actually used in our testing process. So it becomes just dead code and
it worth to remove it.

We'll bring newer phpunit versions in further commits to test the
connector against more recent PHP versions (see [2]).

[1]: sebastianbergmann/phpunit#2683
[2]: https://phpunit.de/supported-versions.html
@nikeee
Copy link

nikeee commented Sep 28, 2023

The awesome extension by @gh640 stopped working in phpunit 10 due to the already mentioned event system.

I've built an new extension from scratch for phpunit 10+:
https://github.com/nikeee/phpunit-tap

It's pretty basic as of now. Contributions are always welcome!

@nikeee
Copy link

nikeee commented Oct 5, 2023

it causes problems due to its dependency on Symfony's YAML component at some point.

It just came to my mind that YAML is a superset of JSON, so you could actually just use json_encode instead of a full-blown YAML implementation. A spec-compliant consumer should be be able to parse the JSON just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants