Opened 6 years ago
Closed 5 years ago
#50042 closed task (blessed) (fixed)
Update Docker environment to allow specific versions of PHPUnit to be loaded
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.6 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
To help with tackling #48301, new PHPUnit images now being created for all combinations of supported PHPUnit versions on each PHP version.
To make loading specific versions of PHPUnit possible, Core's Docker file needs to be updated.
See the GitHub PR and PHPUnit version compatibility page in the handbook.
Related: #47767.
Attachments (5)
Change History (22)
#3
@
6 years ago
- Keywords 2nd-opinion added
This implementation has one issue though.
Currently, the LOCAL_PHP value is used to load PHPUnit. However, now that it has it's own independent variable, committing 50042.diff would cause all PHP 5.6 jobs using trunk would fail unless LOCAL_PHPUNIT is set correctly because PHPUnit 5 is required. In 50042.diff, latest would be used, which would load 7.
#4
@
5 years ago
- Milestone changed from 5.5 to Future Release
I'm going to punt this for now with beta 1 tomorrow. It's a build tooling ticket, so it can be committed later if someone has a chance to work on it.
#5
@
5 years ago
- Keywords 2nd-opinion removed
- Milestone changed from Future Release to 5.6
50042.2.2.diff makes use of dotenv-expand to allow LOCAL_PHP to be referenced as a default within the .env file.
#6
@
5 years ago
Chatted a bit with Jonathan about this. I'm in favour of using these Docker images to serve an appropriate PHPUnit version for any given PHP+WP combo, but I'd like the docblock in .env to be a bit clearer about the supported versions because the images for PHP<=5.5 use a different naming pattern. A link to https://hub.docker.com/r/wordpressdevelop/phpunit/tags would be helpful.
#7
@
5 years ago
- Keywords commit added
50042.3.diff updates the documentation in the .env file based on the discussions @johnbillion and I had.
#10
@
5 years ago
- Keywords commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
I tested this pretty thoroughly locally, but for some reason it does not work as expected within Travis. Going to investigate further.
This ticket was mentioned in Slack in #core by sergey. View the logs.
5 years ago
#12
@
5 years ago
Did some investigating into the reasons why [49358] works locally but fails on Travis.
It seems that using dotenv-expand to change the value assigned to the LOCAL_PHPUNIT environment variable is only a problem for Travis as the GitHub Action workflow for PHPUnit testing also ran successfully.
Defining the variable within the matrix for the jobs that utilize the Docker environment fixes the issue.
Besides using this and changing the version of PHPUnit locally in the
.envfile, Travis jobs can be updated as such:For older branches (4.7-5.0), PHPUnit 6 is required for PHP 7.0. This would ensure the required version is installed.