-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Improve the structure of the Finder testsuite #15808
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
Conversation
I agree with you, this structure will ease with deprecating in 2.8 and removing in 3.0 |
@@ -16,7 +16,7 @@ | |||
protected function assertIterator($expected, \Traversable $iterator) | |||
{ | |||
// set iterator_to_array $use_key to false to avoid values merge | |||
// this made FinderTest::testAppendWithAnArray() failed with GnuFinderAdapter | |||
// this made AbstractFinderTest::testAppendWithAnArray() failed with GnuFinderAdapter |
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.
typo: failed vs fail
@nicolas-grekas this would run non-adapter related tests multiple times (once per adapter), making it harder to understand failures though |
Ok, 👍 (with comment + fabbot fix) |
done |
5ed55da
to
66d91ac
Compare
Thinking twice here: if we remove completely the concept of adapters, then the tests split will create some difficulties. I'd be in favor of merging for this reason, and accept running the same tests many times... |
66d91ac
to
97fbe90
Compare
@nicolas-grekas done |
Testing against different adapters is now handled by multiple subclasses of a common test case rather than using data providers. This allows tests to be marked as skipped for unsupported adapters instead of making them disappear from the testsuite.
97fbe90
to
20f2d03
Compare
Thank you @stof. |
This PR was merged into the 2.3 branch. Discussion ---------- Improve the structure of the Finder testsuite | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Testing against different adapters is now handled by multiple subclasses of a common test case rather than using data providers. This allows tests to be marked as skipped for unsupported adapters instead of making them disappear from the testsuite. This will also make it much easier to mark tests for the find-based adapters as legacy ones when deprecating them. This correspond to changes done by @nicolas-grekas in #15805, backported to 2.3 and with the data providers removed (his PR was keeping data providers for the adapter but making it return a single adapter all the time, hence the much bigger diff in my PR). All tests in AbstractFinderTest are just moved from the FinderTest (they are all the tests running against multiple adapters). FinderTest itself runs the PhpAdapter (as this is the logic we want to keep in the finder in 3.0). I also tried to have a PhpFinderTest and keeping FinderTest only with the extra tests, but this would make things harder to merge branches between 2.8 and 3.0 in the future (once we remove other adapter tests) as we could simply keep the AbstractFinderTest in 3.0 for now to ease merging PRs adding new tests for bug fixes. Commits ------- 20f2d03 Improve the structure of the Finder testsuite
Testing against different adapters is now handled by multiple subclasses of a common test case rather than using data providers. This allows tests to be marked as skipped for unsupported adapters instead of making them disappear from the testsuite.
This will also make it much easier to mark tests for the find-based adapters as legacy ones when deprecating them.
This correspond to changes done by @nicolas-grekas in #15805, backported to 2.3 and with the data providers removed (his PR was keeping data providers for the adapter but making it return a single adapter all the time, hence the much bigger diff in my PR).
All tests in AbstractFinderTest are just moved from the FinderTest (they are all the tests running against multiple adapters). FinderTest itself runs the PhpAdapter (as this is the logic we want to keep in the finder in 3.0). I also tried to have a PhpFinderTest and keeping FinderTest only with the extra tests, but this would make things harder to merge branches between 2.8 and 3.0 in the future (once we remove other adapter tests) as we could simply keep the AbstractFinderTest in 3.0 for now to ease merging PRs adding new tests for bug fixes.