-
Notifications
You must be signed in to change notification settings - Fork 874
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
Fix for PHPUnit 10 #5790 #5853
Fix for PHPUnit 10 #5790 #5853
Conversation
- apache#5790 - Add `PhpUnitVersion` - Don't use `NetBeansSuite.php` with PHPUnit 10 because `suite()` method is invoked no longer and we have to extend `TestCase` - See: sebastianbergmann/phpunit@36354a9
The suite class file is checked whether it is a subclass of |
@tmysik What do you think? Any ideas? |
php/php.phpunit/src/org/netbeans/modules/php/phpunit/ui/customizer/CustomizerPhpUnit.java
Show resolved
Hide resolved
Overall looks good to me. Here are my notes:
Thanks! |
php/php.phpunit/src/org/netbeans/modules/php/phpunit/commands/PhpUnit.java
Outdated
Show resolved
Hide resolved
php/php.phpunit/src/org/netbeans/modules/php/phpunit/commands/PhpUnit.java
Show resolved
Hide resolved
Maybe, PHPUnit 9 works the same way (for a single file and directory). However, I'm not sure about the others...
I'll try thinking whether we can run unit test without selecting the version :) |
@tmysik We can detect the version via I have no ideas about multiple files yet... |
01a07db
to
72e8d5b
Compare
@junichi11 The ideal solution, of course 👍 |
72e8d5b
to
bcfb8f7
Compare
php/php.phpunit/src/org/netbeans/modules/php/phpunit/PhpUnitVersion.java
Show resolved
Hide resolved
@junichi11 Looks good to me. However, we still need to solve situation when several files should be tested (e.g. user selects more files, or re-run the failed tests). |
Yes. I'll submit that problem as a new issue after this is merged. (I have no ideas although I investigated a bit...) |
@junichi11 You are welcome! |
bcfb8f7
to
6ac8eac
Compare
I'll click the "Ready for review" button to merge this after CI passes. (This PR is merged by the release team.) |
I tried to find way how to pass multiple files to PHPUnit, but there is no easy way. Possible solution could be inspired by https://github.com/infection/infection.
Proposal
What do you think? |
Thanks for looking into it! I was thinking about this solution also for the original solution (instead of cc @junichi11 |
Let me improve my comment - I meant, can we always "extend" properly any existing configuration provided by the user? I am not so sure... |
Existing configuration file must be copied to temporary file and modified - add test suite and update relative paths. Configuration file can be configured in NetBeans or PHPUnit is looking for |
Cannot the existing configuration contain some suite already? I mean, can we always update it? Sorry if it is clear and my questions are unnecessary 🙈 |
@tmysik No need to apologize. Name of the suite could be something like "NetBeansTempSuite" with MD5 hash created from pathnames passed from Netbeans to prevent name collision with already existing suite. |
Ha, if we can add a suite, then it seems to me to be the best way to go. Thanks for clarification! |
Thanks for investigating it. I'll submit that problem as a new issue later. |
I can see 2 files were run, no? |
@tmysik I should have written what I ran about that image, sorry. I selected the directory to show failed results for 2 files. I'm not sure how to run the selected 2 files actually. So, I've looked into it a bit. netbeans/php/php.project/src/org/netbeans/modules/php/project/ui/actions/support/CommandUtils.java Lines 299 to 309 in e65310a
It seems that the first item is returned when we select several files. Lines 172 to 179 in e65310a
|
Uff :) Sorry, it has been a long time... Cannot we call |
We should be able to do it. Then, we have to fix
Yes, I also think so :)
I'm not sure... but maybe, usage is the following via CLI, so users didn't report anything about running several test files, I guess.
It doesn't seem a big problem for users (I think we need not hurry) because there is no report from users for a long time. |
I totally agree, not a big problem definitely. BTW one more use-case is, if I remember it correctly 🙂, to rerun only failed tests. But that cannot work even now so all fine 👍 Let's create a ticket for it and merge this PR if there are no objections. Thanks! |
@tmysik I'll do that later :) This PR will be merged by the release team because I would like to include this in NB18. (We must not do it.) : https://lists.apache.org/thread/s3hnjtmr6t7dkyq1ofn4hdqmd0qh2d11 |
Don't worry, I've been following the conversation! 😄 I know it's been moved out of draft, but wasn't 100% sure from the ongoing conversation if it is ready to merge. Please confirm, and I'll merge by tomorrow in time for 18-rc2. |
@neilcsmith-net Thank you! |
Created the issue: #5880 |
PhpUnitVersion
NetBeansSuite.php
with PHPUnit 10 becausesuite()
method is invoked no longer and we have to extendTestCase