Opened 11 years ago
Last modified 2 months ago
#34185 new defect (bug)
Excluding certain PHPUnit test groups results in "Database is dead" notice and tests terminate
| Reported by: | netweb | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
When excluding certain PHPUnit groups from the full test suite the tests fail with a "Database is dead" notice.
Known groups thus far:
phpunit --exclude-group importphpunit --exclude-group query
$ phpunit --exclude-group import Installing... Running as single site... To run multisite, use -c tests/phpunit/multisite.xml PHPUnit 4.7.7 by Sebastian Bergmann and contributors. ............................................................. 61 / 4556 ( 1%) ...................................SS........................ 122 / 4556 ( 2%) ............................................................. 183 / 4556 ( 4%) ............................................................. 244 / 4556 ( 5%) .S........................................................... 305 / 4556 ( 6%) ............................................................. 366 / 4556 ( 8%) ............................................................. 427 / 4556 ( 9%) ............................................................. 488 / 4556 ( 10%) ............................................................. 549 / 4556 ( 12%) ............................................................. 610 / 4556 ( 13%) .....................S....S.................................. 671 / 4556 ( 14%) ................................................S............ 732 / 4556 ( 16%) ............................................................. 793 / 4556 ( 17%) ..................................Database is dead.
Change History (4)
#2
@
5 years ago
I tested this using the test:php npm script, and found that the tests abort no matter what group I name after --exclude-group. Output is:
........................................................... 59 / 12551 ( 0%) ........................................................... 118 / 12551 ( 0%) ...............................EE.......................... 177 / 12551 ( 1%) ........................................EE...............E. 236 / 12551 ( 1%) .......FF.F.E.EE.FEFFFF.................................... 295 / 12551 ( 2%) FEFF.FFFFF.EFEF.EFFFF.FFFF.FFF...EEEFEEEEEEEEEEEEEEEEEEEE.E 354 / 12551 ( 2%) EEFEEEEEEEEEEEEEEEEEEEE..FFFFFFS..FFFFF.FFFFF............-1%
Specifying a --group works as expected.
Something else I noticed is that when passing --exclude-group, groups that are excluded by default, such as external-http, are no longer excluded. Not sure if that's related as those groups work fine when run individually.
#3
@
5 years ago
I also saw this while working on #52645 and I'm pretty sure it's coming from a test in the ajax group.
This ticket was mentioned in PR #11801 on WordPress/wordpress-develop by @arkaprabhachowdhury.
2 months ago
#4
- Keywords has-patch has-unit-tests added; needs-patch removed
## Summary
Preserves the default excluded PHPUnit groups when an additional --exclude-group argument is passed.
## Testing
- Run
npm run test:php -- --filter Tests_PHPUnit_GroupFilters - Run
npm run test:php -- --exclude-group import --filter test_populate_site_meta - Run
npm run test:php -- --group ajaxand verify ajax tests are no longer skipped by default
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Adding another known case:
phpunit --exclude-group xmlrpc