Opened 9 years ago
Closed 6 years ago
#40532 closed defect (bug) (fixed)
Find a workaround for unit tests that have a dependency on XDebug
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.3 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | needs-patch needs-unit-tests |
| Focuses: | Cc: |
Description
In #39978, XDebug was disabled when running the test suite on Travis. This resulted in a 40% increase in build speed and a 40% decrease in developer frustration.
Unfortunately it was overlooked that two tests in core have a dependency on XDebug:
Tests_Ajax_Response::test_response_charset_in_header()(ref)Tests_oEmbed_HTTP_Headers::test_rest_pre_serve_request_headers()(ref)
Both of these tests are skipped when XDebug isn't available, so they're no longer tested on Travis.
A workaround needs to be found for these tests so they no longer rely on XDebug.
Change History (5)
#2
@
8 years ago
Thanks for looking into this, @jmichaelward. I believe that the mere presence of Xdebug impacts the performance, but this assumption would benefit from some testing.
#3
@
8 years ago
The other option I'd thought of was to create a new PHPUnit test group, similar to the ajax, ms-files, external-http etc groups specifically for Xdebug, tests that require it are moved into that group and that group only is tested with Xdebug enabled, again, this would need some testing for feasibility.
I spent some time digging around the web for answers to this issue and have come up mostly empty. One question I do have is whether the speed in which tests run in Travis are related to the mere presence of Xdebug, or rather that Xdebug is enabled for the duration of the test process.
Xdebug does have two methods -
xdebug_enableandxdebug_disablewhich, I would think, could be triggered within particular tests that require thexdebug_get_headersmethod. This would require Xdebug to be included in the Travis PHP ini file, but with thedefault_enableflag set tofalseand, I believe,remote_enableset to true. Outside of that, I haven't found a definitive way to get headers while PHP is running in the CLI.