-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make integration tests work with both PHP 7.3 and 7.4 #24895
Merged
rullzer
merged 1 commit into
master
from
make-integration-tests-work-with-both-php-7.3-and-7.4
Dec 30, 2020
Merged
Make integration tests work with both PHP 7.3 and 7.4 #24895
rullzer
merged 1 commit into
master
from
make-integration-tests-work-with-both-php-7.3-and-7.4
Dec 30, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The "Trashbin" and "WebDav" traits were using each other in a circular dependency ("WebDav" -> "Sharing" -> "Provisioning" -> "BasicStructure" -> "Trashbin" -> "WebDav"). In PHP 7.3 this worked fine, but in PHP 7.4 the fatal error "Trait 'WebDav' not found in .../Trashbin.php" was thrown. To solve this now the "TrashBin" trait no longer explicitly uses "WebDav". However, due to this change, the class using "TrashBin" is now expected to also use "WebDav". As the "Trashbin" trait was not needed by most contexts using the "BasicStructure" trait "Trashbin" was removed from it and added only to those contexts that actually need it. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
danxuliu
force-pushed
the
make-integration-tests-work-with-both-php-7.3-and-7.4
branch
from
December 30, 2020 05:02
1a23006
to
28f2d0e
Compare
danxuliu
added
3. to review
Waiting for reviews
and removed
2. developing
Work in progress
labels
Dec 30, 2020
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 833: failureacceptance-app-files-sharing
Show full log
|
juliusknorr
approved these changes
Dec 30, 2020
rullzer
approved these changes
Dec 30, 2020
rullzer
deleted the
make-integration-tests-work-with-both-php-7.3-and-7.4
branch
December 30, 2020 09:52
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found by @juliushaertl in #24551
The
Trashbin
andWebDav
traits were using each other in a circular dependency (WebDav -> Sharing -> Provisioning -> BasicStructure -> Trashbin -> WebDav
). In PHP 7.3 this worked fine, but in PHP 7.4 the fatal errorTrait 'WebDav' not found in .../Trashbin.php
was thrown. To solve this now theTrashBin
trait no longer explicitly usesWebDav
.However, due to this change, the class using
TrashBin
is now expected to also useWebDav
. As theTrashbin
trait was not needed by most contexts using theBasicStructure
traitTrashbin
was removed from it and added only to those contexts that actually need it.I will keep this indeveloping
state until CI has finished just in case there is some other context that needs to use theTrashbin
trait too (it helps not to forget to commit the changes to check them... 🤦).Unfortunately I do not know if the issue is in PHP 7.4 itself, Behat, its autoloader... But I have distilled the issue to the following test case:
integration-tests-recursive-traits.patch.txt
After applying the patch,
./run-docker.sh --image nextcloudci/php7.3:php7.3-5 features/traittest.feature
👍 works./run-docker.sh --image nextcloudci/php7.4:php7.4-3 features/traittest.feature
💥 showsPHP Fatal error: Trait 'TraitTestA' not found in /nextcloud/build/integration/features/bootstrap/TraitTestB.php on line 5
Therefore it seems that the problem is in the circular dependency between the traits.