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

Configuration changes in patch versions #5970

Closed
boesing opened this issue Sep 26, 2024 · 4 comments
Closed

Configuration changes in patch versions #5970

boesing opened this issue Sep 26, 2024 · 4 comments
Labels
type/bug Something is broken

Comments

@boesing
Copy link

boesing commented Sep 26, 2024

Q A
PHPUnit version 11.3.6
PHP version 8.2
Installation Method Composer

Summary

Hey there, I do experience issues with a (for me) very generic setup.

Current behavior

I receive XMLLint issues due to the fact that it seems that there were new options added in 11.3.1+:

phpunit.xml.dist:15: element phpunit: Schemas validity error : Element 'phpunit', attribute 'displayDetailsOnPhpunitDeprecations': The attribute 'displayDetailsOnPhpunitDeprecations' is not allowed.
phpunit.xml.dist:15: element phpunit: Schemas validity error : Element 'phpunit', attribute 'failOnPhpunitDeprecation': The attribute 'failOnPhpunitDeprecation' is not allowed.

How to reproduce

Use composer to require phpunit:

composer require --dev phpunit/phpunit:^11.3

NOTE: I've added the version on purpose as composer is falling back to minor versions by default_
This actually installs phpunit (as of now) v11.3.6 which seems to have both attributes listed above and XMLLint is properly validating the config file.

Setup phpunit by running vendor/bin/phpunit --generate-configuration.
This generates the config with the attributes included.

Since we want to verify that our dependencies do work with upper and lower bounds of constraints, we usually run:

composer update --prefer-lowest

This installs 11.3.0 (as per composer constraints) which does not have the attributes listed above and thus.

If we now executed XMLLint, the validation is actually failing.

Expected behavior

Staying in the same minor range (esp. when not switching between majors in the upper bound) should validate the XML config.
I'd expect that nothing would be dropped in minors and nothing would be added in patches. Is that reasonable?

I would expect this a bug but happy to discuss this further.

@boesing boesing added the type/bug Something is broken label Sep 26, 2024
@boesing
Copy link
Author

boesing commented Sep 26, 2024

I am totally aware that if the config is generated with 11.6 and the constraint is set to 11.5, that failing validation would be reasonable but I do not get how it can fail in patches. But maybe I'm missing something (probably added schema in a patch as it was forgotten in the initial minor release?).

@sebastianbergmann
Copy link
Owner

config is generated with 11.6 and the constraint is set to 11.5

You probably mean 11.3.6 and 11.3.5 here.

@sebastianbergmann
Copy link
Owner

As you can see in the ChangeLog, these configuration setting were introduced in PHPUnit 11.3.3 in order to address #5937.

@boesing
Copy link
Author

boesing commented Sep 27, 2024

You probably mean 11.3.6 and 11.3.5 here.

Nah, actuall was referring to 11.2 and 11.3 as downgrading to a lower minor could actually break stuff regarding config.

I can see that, the question I have is: why wasn't that 11.4 then? I mean, that is a whole new feature which did not exist beforehand. 🤔
So it is absolutely valid that adding new config stuff along with schema validation is added in patch versions from your PoV?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants