πŸ’¦ FULL SET: WordPress/performance/pull/ - High Quality

Skip to content

Conversation

@mukeshpanchal27

Summary

Fixes #399

Relevant technical choices

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@mukeshpanchal27 mukeshpanchal27 added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release Needs Review labels Sep 23, 2022
@mukeshpanchal27 mukeshpanchal27 self-assigned this Sep 23, 2022
@felixarntz felixarntz mentioned this pull request May 30, 2023
3 tasks
swissspidy
@swissspidy

I thought I'd pick this one up, but a couple of SVG upload tests (test_get_dominant_color_none_images) are failing on various PHP versions 🀷

@mukeshpanchal27

Thanks @swissspidy for picking. I also don't understood why it going fails πŸ€”

@swissspidy

So the failures makes sense, because WP doesn't handle/support SVG uploads, so wp_check_filetype fails. And unfiltered uploads are not enabled either. The weird part is that the test is passing on PHP 7.4...

We don't really need to test SVG upload here anyway, so we can just remove it.

@swissspidy

Tests on PHP < 7.3 are failing because the PHPUnit version (v9.6) is too new for those PHP versions, causing syntax errors.

We probably don't need something as complex as WordPress/plugin-check#321, but definitely something in that direction.

@mukeshpanchal27

All the unit test pass βœ… now. Looking into integration tests setup.

@swissspidy

There is no error output for failing runs, see e.g. https://github.com/WordPress/performance/actions/runs/7650368243/job/20846313421?pr=544

Do we need to log command.stderr?

@swissspidy swissspidy changed the title Run PHP unit tests in different versions of PHP Run tests in different versions of PHP Jan 25, 2024
@mukeshpanchal27

@swissspidy Added log in script. In local i got below error for PHP 7.2.

β„Ή Starting 'vendor/bin/phpunit -c phpunit.xml --verbose --testdox' on the tests-cli container. 
This version of PHPUnit requires PHP >= 7.3.
You are using PHP 7.2.34 (/usr/local/bin/php).

@swissspidy

@swissspidy Added log in script. In local i got below error for PHP 7.2.

β„Ή Starting 'vendor/bin/phpunit -c phpunit.xml --verbose --testdox' on the tests-cli container. 
This version of PHPUnit requires PHP >= 7.3.
You are using PHP 7.2.34 (/usr/local/bin/php).

Aah πŸ’‘

Now it makes sense. We need to downgrade PHPUnit in this case using composer update, just like we do for unit tests.

Maybe 7d560ae works 🀞

@swissspidy

Or maybe not 🀷

swissspidy

Choose a reason for hiding this comment

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

Yay 🀩πŸ₯³

westonruter
westonruter
@swissspidy swissspidy merged commit fc9ddfb into trunk Jan 29, 2024
@swissspidy swissspidy deleted the fix/399-unit-tests-in-php-versions branch January 29, 2024 21:05
@westonruter westonruter mentioned this pull request Jan 30, 2024
3 tasks
westonruter
Comment on lines +23 to +34
"phpstan": [
"composer --working-dir=build-cs update --no-interaction",
"build-cs/vendor/bin/phpstan analyse --memory-limit=2048M -c phpstan.neon.dist"
],
"format": [
"composer --working-dir=build-cs update --no-interaction",
"build-cs/vendor/bin/phpcbf --standard=phpcs.xml.dist --report-summary --report-source"
],
"lint": [
"composer --working-dir=build-cs update --no-interaction",
"build-cs/vendor/bin/phpcs --standard=phpcs.xml.dist"
],

Choose a reason for hiding this comment

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

I found that calling composer update here causes problems: #961

Proposed fix: #962

@mukeshpanchal27 mukeshpanchal27 mentioned this pull request Feb 13, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run PHP unit tests in different versions of PHP

6 participants