Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unit tests against WordPress 5.9+ #12608

Merged
merged 5 commits into from
Nov 3, 2022
Merged

Run unit tests against WordPress 5.9+ #12608

merged 5 commits into from
Nov 3, 2022

Conversation

spacedmonkey
Copy link
Contributor

Context

Summary

Relevant Technical Choices

To-do

User-facing changes

Testing Instructions

  • This is a non-user-facing change and requires no QA

This PR can be tested by following these steps:

Reviews

Does this PR have a security-related impact?

Does this PR change what data or activity we track or use?

Does this PR have a legal-related impact?

Checklist

  • This PR addresses an existing issue and I have linked this PR to it in ZenHub
  • I have tested this code to the best of my abilities
  • I have verified accessibility to the best of my abilities (docs)
  • I have verified i18n and l10n (translation, right-to-left layout) to the best of my abilities
  • This code is covered by automated tests (unit, integration, and/or e2e) to verify it works as intended (docs)
  • I have added documentation where necessary
  • I have added a matching Type: XYZ label to the PR

Fixes #12573

@spacedmonkey spacedmonkey added Type: Infrastructure Changes impacting testing infrastructure or build tooling Pod: WP labels Nov 2, 2022
@spacedmonkey spacedmonkey self-assigned this Nov 2, 2022
Comment on lines 125 to 139
# Installs a different PHPUnit version depending on the WP/PHP version combo we're testing against.
#
# | WP / PHP | PHPUnit |
# |-----------|---------|
# | 5.7 / 7.4 | 7 |
# | 5.9 / 7.4 | 8 |
# | 5.9 / 7.4 | 9 |
# | * / 8 | 9 |
#
# See https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/
- name: Update PHPUnit
run: |
if [[ $WP_VERSION == "5.7" && $PHP_VERSION == "7.4" ]]; then
echo "Installing PHPUnit 7.5.x"
composer require --no-interaction --no-scripts phpunit/phpunit:^7.5 --with-dependencies
elif [[ $WP_VERSION == "latest" || $WP_VERSION == "trunk" || $PHP_VERSION == "7.4" ]]; then
echo "Installing latest version of PHPUnit"
composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies
fi
env:
WP_VERSION: ${{ matrix.wp }}
PHP_VERSION: ${{ matrix.php }}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, with removing this, all tests are running with PHPUnit 8.5 as can be seen here:

https://github.com/GoogleForCreators/web-stories-wp/actions/runs/3378530306/jobs/5608853638#step:16:16

We still need the composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies line to update to PHPUnit 9.5.

Once we actually bump the minimum PHP version requirement in #12583, we can remove this and update the dependency permanently in composer.json via composer update

Co-authored-by: Pascal Birchler <pascalb@google.com>
@swissspidy swissspidy merged commit f8899b6 into main Nov 3, 2022
@swissspidy swissspidy deleted the fix/5.9 branch November 3, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Infrastructure Changes impacting testing infrastructure or build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run unit tests against WordPress 5.9+
2 participants