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

GH Actions/tests: prevent warning about outdated configuration being used #108

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Oct 1, 2024

The configuration file specification has undergone changes in PHPUnit 9.3 and 10.0.

Most notably:

  • In PHPUnit 9.3, the manner of specifying the code coverage configuration has changed.
  • In PHPUnit 10.0, a significant number of attributes of the <phpunit> element were removed or renamed.

When running PHPUnit 10 with a PHPUnit 9 style configuration file, PHPUnit 10 can show a warning:

There was 1 PHPUnit test runner deprecation:

1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!

The --migrate-configuration command can upgrade a configuration for the changes in the format made in PHPUnit 9.3 and 10.0/10.1, but some of the changes in the configuration format in PHPUnit 10 don't have one-on-one replacements and/or are not taken into account.

This commit is a way to "future proof" the test workflow a little by preventing that PHPUnit warning from potentially failing a build in the future.

Notes:

  • If/when PHPUnit 11 starts to be supported, the bash condition will need updating to also recognize PHPUnit 11.
  • The --migrate-configuration script will fail (exit code 1) if no update is needed, like if one of the repos would have a PHPUnit 10-style config file.
    To prevent this from failing the test job, I'm explicitly setting continue-on-error: true.

…used

The configuration file specification has undergone changes in PHPUnit 9.3 and 10.0.

Most notably:
* In PHPUnit 9.3, the manner of specifying the code coverage configuration has changed.
* In PHPUnit 10.0, a significant number of attributes of the `<phpunit>` element were removed or renamed.

When running PHPUnit 10 with  a PHPUnit 9 style configuration file, PHPUnit 10 can show a warning:
```
There was 1 PHPUnit test runner deprecation:

1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
```

The `--migrate-configuration` command can upgrade a configuration for the changes in the format made in PHPUnit 9.3 and 10.0/10.1, but some of the changes in the configuration format in PHPUnit 10 don't have one-on-one replacements and/or are not taken into account.

This commit is a way to "future proof" the test workflow a little by preventing that PHPUnit warning from potentially failing a build in the future.

Notes:
* If/when PHPUnit 11 starts to be supported, the bash condition will need updating to also recognize PHPUnit 11.
* The `--migrate-configuration` script will fail (exit code `1`) if no update is needed, like if one of the repos would have a PHPUnit 10-style config file.
    To prevent this from failing the test job, I'm explicitly setting `continue-on-error: true`.
@jrfnl jrfnl requested a review from a team as a code owner October 1, 2024 11:19
@swissspidy swissspidy merged commit 0ca5afc into wp-cli:main Oct 1, 2024
7 checks passed
@jrfnl jrfnl deleted the feature/tests-migrate-configuration branch October 1, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants