You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm upgrading to version 10 and ran across a relatively minor, but still valid issue. We're running unit tests in a Docker container, in Jenkins, which is not allocating a TTY. This causes phpUnit to revert to the default width of 80 columns, even though we can safely display >200 in our environment.
Current behavior
phpUnit assumes that a non-interactive TTY always has a width of 80 columns, even though this is rarely the case nowadays. In our case we could safely increase that number to over 200 columns and with a few thousand tests our current output is unnecessarily long.
How to reproduce
Define columns="200" in phpunit.xml and run the tests inside a non-TTY environment (e.g., docker exec container-name phpunit). You will notice that the output width is limited to just 80 characters, as Console::isInteractive() returns 80.
Expected behavior
The ability to define the maximum console width, with 80 being the default. Ideally, via a configuration setting, but it could be also a property that can be changed by an extension.
I can see a possible workaround by leveraging the loadFrom() method that does not override the values, but that's just an ugly hack, not addressing the actual issue.
The text was updated successfully, but these errors were encountered:
sebastianbergmann
changed the title
The default number of columns can't be changed
Do not limit number of columns to 80 on non-interactive TTY
Sep 27, 2023
Summary
I'm upgrading to version 10 and ran across a relatively minor, but still valid issue. We're running unit tests in a Docker container, in Jenkins, which is not allocating a TTY. This causes phpUnit to revert to the default width of 80 columns, even though we can safely display >200 in our environment.
Current behavior
phpUnit assumes that a non-interactive TTY always has a width of 80 columns, even though this is rarely the case nowadays. In our case we could safely increase that number to over 200 columns and with a few thousand tests our current output is unnecessarily long.
How to reproduce
Define
columns="200"
inphpunit.xml
and run the tests inside a non-TTY environment (e.g.,docker exec container-name phpunit
). You will notice that the output width is limited to just 80 characters, asConsole::isInteractive()
returns80
.Expected behavior
The ability to define the maximum console width, with 80 being the default. Ideally, via a configuration setting, but it could be also a property that can be changed by an extension.
I can see a possible workaround by leveraging the
loadFrom()
method that does not override the values, but that's just an ugly hack, not addressing the actual issue.The text was updated successfully, but these errors were encountered: