There are more count() calls on non-countable objects that prevent a running test suite on PHP 7.2.
See details in https://www.drupal.org/pift-ci-job/828584
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | 2928846-25.patch | 5.59 KB | alexpott |
There are more count() calls on non-countable objects that prevent a running test suite on PHP 7.2.
See details in https://www.drupal.org/pift-ci-job/828584
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | 2928846-25.patch | 5.59 KB | alexpott |
Comments
Comment #2
martin107 commented@mondrake
when I trace the errors in
https://www.drupal.org/pift-ci-job/828584
They all seem to lead back to
./vendor/behat/mink/src/Element/Element.php
which is reasonable.
find is a common base class method for lots of things that query the DOM tree while testing
but it is not part of Drupal .. the solution involves creating a behat issue.
Comment #3
alexpottre #2 - @martin107 that's being caused by an out-of-date dependency. Being tackled here: #2929477: Update jcalderonzumba/mink-phantomjs-driver.
I suggest we use this issue to fix our own code.
Comment #4
alexpottThe countable issues are in
Drupal\Tests\big_pipe\Unit\Render\BigPipeResponseAttachmentsProcessorTestand seems to be because the test set up is not quite right.Comment #5
alexpottHere's a patch the fixes the test to set up the attachments with the correct data type.
Comment #6
jibranHere is another one https://www.drupal.org/pift-ci-job/828674
I think we should fix
\Drupal\Tests\WebAssert::optionNotExists. I don't think we can fix it upstream forbehat/mink.Comment #7
alexpott@jibran how come - which count do you think is causing the problems? I think this is exactly the same issue as #2929477: Update jcalderonzumba/mink-phantomjs-driver
Comment #8
jibranCheck
/vendor/behat/mink/src/Element/Element.php:148Comment #9
alexpott@jibran yes and that is using the return value from the web driver which in the case of javascript tests is jcalderonzumba/mink-phantomjs-driver and this is fixed by https://github.com/jcalderonzumba/MinkPhantomJSDriver/commit/9458e357b22...
Comment #10
alexpottSome more found by https://www.drupal.org/pift-ci-job/830503
Comment #11
alexpottWhoops findAll() doesn't have all those params.
Comment #14
alexpottMissed one...
Comment #15
mondrakeStraightforward changes to test code only. On the critical path to allow running D8 on PHP 7.2. Combined with other patches give a PASS on the testbot with 7.2, see #2927806-61: Use PHPUnit 6 for testing when PHP version >= 7.2.
RTBC
Comment #16
berdirwe have had problems in the past with assert null/not null on entity objects because if they get printed then it can basically bring down the test runner, also possibly when trying to run with verbose and showing it in the UI.
My recommendation would be to convert this to an entity query which allows us to actually do a count on the query result, which contains just the ID.
The test also hardcodes that the term ID is 1. Alternatively, we could do $terms and remove the [1], then the count would work.
Comment #17
alexpott@Berdir good point. Let's improve the test.
Comment #18
catchI think we should do the entity query suggestion from #16 too.
Comment #19
alexpottSure here's a version with entity query.
Comment #21
alexpottapcu pool failure.
Comment #22
amateescu commentedSince we are updating these assertions, is there any reason not to use
assertCount()directly?Comment #23
alexpott@amateescu because this is still a WebTestBase test -
class EntityReferenceAdminTest extends WebTestBase {@Berdir suggested using
\Drupal::entityQuery('taxonomy_term')for less verbosity.Comment #24
catchWhile it's in a test and we know there's no entity access going on, this could probably use an ->accessCheck(FALSE) just for clarity - especially since it's testing the absence of something that could still be there and hidden behind access.
Same here.
Comment #25
alexpottAddresses #24
Comment #26
catchCan't see anything else to complain about.
Comment #28
mondrake#27 APCU memory failure in test, relaunched, back to RTBC
Comment #30
mondrakeComment #32
mondrakeComment #33
catchCommitted 968da88 and pushed to 8.5.x. Thanks!
Comment #35
alexpottGiven all the changes are to tests and completely compatible with 8.4.x I think this might be work backporting.
Comment #37
larowlanCherry-picked as 61dc040 and pushed to 8.4.x.
Comment #38
mondrakeLikely, #2932777: Risky count() in SQLite Statement will hit once a PHP 7.2 with SQLite bot will be available.
Comment #40
delta commentedFor Drupal 7 this issue and other php 7.2 incompatibility are adressed there https://www.drupal.org/project/drupal/issues/2925449#comment-12474294