Last modified: 2013-11-13 09:10:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31226, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29226 - PHPUnit should use color if OS supports ANSI
PHPUnit should use color if OS supports ANSI
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: upstream
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-01 05:28 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-11-13 09:10 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2011-06-01 05:28:56 UTC
PHPUnit, on user request, can emits colored output using ANSI escape sequences. It seems they are no more supported by modern Windows OSes ...

Two way to fix this issue:

- using our bootstrapper disable the color options for Windows platform
- fix up PHPUnit to detect Windows.
Comment 1 Brion Vibber 2011-06-01 18:48:50 UTC
Is the problem that it *should* output colors on Windows but doesn't (fails to detect support -> false negative) or that it *should not* output colors on Windows but does (fails to detect lack of support -> false positive)?
Comment 2 Max Semenik 2011-06-01 19:14:25 UTC
It should not, but does, resultting in PASSED or FAILED being surrounded by garbage obfuscating the result.
Comment 3 Brion Vibber 2011-06-01 21:41:37 UTC
Here's an upstream bug requesting that phpunit check for tty output at least, which was closed out apparently unfixed on the basis that color has to be explicitly turned on (so someone turning it on and then redirecting to a file must want it in the file, right?): https://github.com/sebastianbergmann/phpunit/issues/234

Sounds like either our runner needs to detect things and pass in the option, or PHPUnit upstream needs modification to allow a '--color=auto' or colors="auto" option or something to let it autodetect terminal availability.

Offhand I forget whether posix_isatty() will be present and returning true on Windows, might also need to just short-circuit with an OS check there.
Comment 4 Chad H. 2011-06-04 00:08:27 UTC
(In reply to comment #3)
> Offhand I forget whether posix_isatty() will be present and returning true on
> Windows, might also need to just short-circuit with an OS check there.

posix_isatty() will always be present, since we have a fallback in Maintenance.php :)
Comment 5 Antoine "hashar" Musso (WMF) 2011-08-16 18:24:05 UTC
I have redone my patch to take care of wfIsWindows(). See r94673.
Comment 6 Antoine "hashar" Musso (WMF) 2011-10-17 12:41:48 UTC
This bug is upstream, PHPUnit needs to detect an ANSI.SYS driver is loaded to eventually output color. My workaround unconditionally disable color output, so it should no more be an issue for windows user.

I think this bug should be closed now.
Comment 7 Antoine "hashar" Musso (WMF) 2011-11-10 10:01:57 UTC
Marking as WONTFIX. We have a workaround to disable color output if running under windows.
Comment 8 Antoine "hashar" Musso (WMF) 2011-11-10 10:02:25 UTC
I meant FIXED by r94673 sorry.
Comment 9 Antoine "hashar" Musso (WMF) 2013-10-11 09:55:54 UTC
Might be an issue again since Jeroen proposed to disable color by default with https://gerrit.wikimedia.org/r/#/c/88984/

Reopening.
Comment 10 Antoine "hashar" Musso (WMF) 2013-11-13 09:10:47 UTC
Moving bug back in the pool.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links