-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add PHP 8.2 to Unit Tests GHA #6172
Conversation
There are too many dynamic properties!
|
Rector can be used to transform AllowDynamicProperties if needed |
I think |
Yes, probably |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow we passed! Very nice. How about adding to the PHPStan Action as well so we can catch deprecations?
Oh haha we didn't pass at all 🤦♂️ Result was ignored. Digging through these now... |
Okay this isn't so bad. Lots of the same culprits over and over. Some specifics...
This is a good opportunity to improve code quality/smells - I wish we already had some dynamic property rules in place beforehand! |
I don't know why Configs (or Registrars) need dynamic properties. |
Maybe |
I'm not convinced. In the Shield validation case, it seems property overriding is enough. |
I just went through all the Config files and I think the two I mentioned ( |
I don't understand the need to add dynamic properties to Database config. Like Validation config, I don't understand the need for it at all. |
I'm fine skipping it and then revisiting if the need arises. I certainly have never needed it before. My opinion was based on how these Config files work, which is different than other files. |
About 200 errors were reduced.
|
The vfsStream issue has been fixed but not released (bovigo/vfsStream@4928328). I'm not sure about Predis, that one still surprises me. |
Predis constructor straight up sets it's own property that doesn't exist 🤦♂️ https://github.com/predis/predis/blob/main/src/Connection/Parameters.php |
Patched in |
By our very own @paulbalandan! predis/predis#781 Thanks Paul; glad to see their quick response too. |
Since the 8.2 tests are exempt should we go ahead and merge this? It would make tracking the errors easier instead of rebasing this branch over and over. |
But there are still 133 errors. |
Right but because of this line: continue-on-error: ${{ matrix.php-versions == '8.2' }} # remove when PHP 8.2 is generally available The errors won't cause the pipeline to fail, so they are only there as information if you open up the job logs. Merging this PR will let us keep an eye on those errors, since many of them are issues upstream that we cannot control. It will also let us send PRs to fix those errors that will actually run the GitHub Actions (beneficial for me since I don't have an 8.2 environment yet). |
It seems that the deprecations a caused by an older structure of Faker factories; we may be able to identify those and replace them with different faked content (if you look at Chris' linked PR s/he did the same). |
c3fabd0
to
7976a07
Compare
I used a temporary patch for Faker's troubled file. 7976a07 |
The last error is
|
@paulbalandan Applying patch on GA is not enough. |
I have never used Faker so I'm not confident my patch will cover all edge cases for faker tests. I'm not sure what you mean by "all users tests". If that would mean all consumers of Faker aside from us, then that is the least of my concern. Faker itself should provide the official patch. As I said, this addition is just a temporary hack. |
I mean all CI4 devs that use Faker. |
I'm fine with this to pass the framework. We don't actually offer any deprecated Faker usage directly: the Generator is available to users and may or may not be called. I am fine with this workaround (also: very cool use of |
This is the test result of Shield. Most of the errors caused by Faker. bash-3.2$ composer test
> phpunit
PHPUnit 9.5.25 #StandWithUkraine
Runtime: PHP 8.2.0-dev
Configuration: /Users/kenji/work/codeigniter/official/codeigniter-shield/phpunit.xml
Random Seed: 1666576446
.................................................E....E.E...... 63 / 251 ( 25%)
E.E.EE...E.........EE...EEE..............EE.............E.E...E 126 / 251 ( 50%)
...EE.E..E......E.E......................E.E.....E.....EE.E...E 189 / 251 ( 75%)
...........EE..........EE.E....................E..EEE.E.EEE... 251 / 251 (100%)
Time: 00:10.122, Memory: 38.00 MB
There were 44 errors: |
|
I merged #6757 |
Looks like one more dynamic property issue in each of the driver-specific Result classes. E.g.: /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/OCI8/Result.php:109 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! We did it!
Side note: scrolling through these test results over and over with all the "skips"... maybe we should tag database-specific tests as their own suites and run them per driver? Or maybe that is what Paul was already working on? |
🚀 |
I didn't know but it seems
https://github.com/codeigniter4/CodeIgniter4/actions/runs/3368104698/jobs/5586268619 |
That's odd. Also: why don't we have Xdebug available? I thought setup-php added it. Edit: Oh right, we just made it conditional 🤪 |
See #6170
Checklist: