Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Solr backend contained a copy of the IntegrationTest that has been adjusted to the Solr backend.
Since #2753815: Port Simpletest web tests to BrowserTestBase tests is committed. the required base class doesn't exists anymore.
The review discovered that the old IntegartionTest in the search_api_solr was outdated anyway. From my point of view it makes sense to remove the clone from the search_api_solr backend and to apply some small changes to the the implementation in search_api to prepare it to be runable on different backends.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2828848-12--integration_test_flexible_backend.patch | 35.66 KB | drunken monkey |
|
Comments
Comment #2
mkalkbrennerComment #3
mkalkbrennerA small fix where a string must not be replaced by a variable. That just fails on different backends.
Comment #4
borisson_I have some nits to pick, because that's how I roll - sorry markus.
Overall though, I think it's a great idea to only have to override two methods (configureBackendAndSave + indexItems) for other backends to also be able to run the same tests on those backends.
Let's typehint on array here as well, because why not.
/s/condigure/configure/
No need to wrap this in a t, see https://www.drupal.org/node/2783189#t
Comment #5
mkalkbrenner@borisson_: I addressed all your concerns. I thought that removing string translation is out of scope for this patch, but here we go.
But I think we should open a dedicated issue to remove the StringTranslationTrait from the SearchApiBrowserTestBase and to adjust all other tests.
Comment #6
borisson_@mkalkbrenner oh yeah, it's definitly out of scope to do that for the entire file, but there was only 1 line (the one I quoted) added with a t.
We also need a new issue for all other tests, that's true.
No need to change it back. RTBC from my point of view. Let's see what @drunken_monkey has to say.
Comment #7
mkalkbrennerWorks with Solr!
https://travis-ci.org/mkalkbrenner/search_api_solr
The PHP 5 Drupal\Core\StringTranslation\StringTranslationTrait issue will be gone if we remove all the translations from the tests ;-)
Comment #8
drunken monkeyThe
t()
removal is indeed very much out of scope for this issue, but I agree with Joris, no need to revert that now. Anyways, great that there is now definitive information that we shouldn't uset()
even for button labels in tests – I remember a discussion some time ago about this. Can't find the issue anymore, though – so probably we do need a new one. In any case, thanks for posting this, Joris!If we're doing the removal for that class, we should just be thorough and also eliminate
FormattableMarkup
(which is nothing more than an inlining of thet()
call).Apart from that, only minor nit-picks – the largest one being that you also replaced the
search_api_test
data type with the new property, which probably wouldn't fly with any other backend plugin ID.Comment #10
mkalkbrennerThat was just an accident due to the identical name, just like in 2-3-interdiff.txt. I guess you're right :-)
Comment #11
mkalkbrennerThat's not true. FormattableMarkup::__toString() calls FormattableMarkup::placeholderFormat() which doesn't do anything else than escaping and formating the placeholders. The translation system is not triggered. I think you should go back to my patch and it will pass again.
Comment #12
drunken monkeyAh, of course, sorry! Confused that with
TranslatableMarkup
… The name should have been a hint.Comment #13
borisson_Woo
Comment #14
mkalkbrennerThe derived tests are passing on the Solr backend :-)
RTBC from my site as well.
Comment #16
drunken monkeyOK, great to hear.
Committed.
Thanks again, both of you!