WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

#41916 closed defect (bug) (fixed)

Exit early when test suite's install.php script cannot connect to the database

Reported by: danielbachhuber Owned by: dd32
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

If tests/phpunit/includes/install.php cannot connect to the database, it currently dumps HTML to STDOUT.

For scripts driving the test suite, it would be more helpful to exit early with return code 1 to designate the failure.

Related https://github.com/WordPress/phpunit-test-reporter/issues/43

Attachments (1)

41916.1.diff (2.1 KB) - added by danielbachhuber 3 months ago.

Download all attachments as: .zip

Change History (2)

#1 @dd32
2 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 41966:

Tests: Return an exit code of 1 in the event that the database server for tests is unavailable.
This allows for automated scripts & test suites to handle the failure of the test suite easier.

Props danielbachhuber
Fixes #41916

Note: See TracTickets for help on using tickets.