Running PHPunit tests on Travis at PHP7.3 at core 8.8 and 8.9 now produce:
PHPUnit\Framework\Exception: Fatal error: Class Drupal\user\Entity\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Session\AccountInterface::getUsername) in vendor/drupal/core/modules/user/src/Entity/User.php on line 67
The tests were running OK daily at the commit on 29 January, and they started failing when I pushed the the latest four commits (22 February 5:10 - 6:20 GMT) to my github repo for Travis build testing.
The tests run OK on drupal.org at PHP7.3 so there must be something else different which is causing this. The test runs OK at PHP5.6, 7.0, 7.1 and 7.2 they only start failing at 7.3.
Comments
Comment #2
jonathan1055 commented@TR I am not expecting you to look into this much, right now. Just reporting it here as a problem that has appeared. I may try to eliminate each of the four recent commits in turn and try to isolate what has caused it. Or of course it could be coincidence, and some other dependency has also been changed between yesterday and today.
Forgot to say in the issue summary, that every single test fails with this same error.
Comment #3
tr commentedThat doesn't really sound like anything that could be caused by this module ...
Comment #4
jonathan1055 commentedWell, yes I thought that at first. However, I have just created a new test branch checked out from the commit before the new four (i.e 29 January) and it runs OK at PHP7.3 for core 8.8 and 8.9, all tests pass.
So something in those four commits has caused a problem.
Comment #5
tr commentedThe only thing that touches the User object in this module is BrowserTestBase::createUser(), which is used in the TypedDataFormWidgets tests. But it was also used before the $defaultTheme patch went in ... Perhaps try the drupalCreateUser() alias of that function.
But really, if EVERY test fails (unit and functional?), that seems to be a problem with the testing environment. Likewise, the "contains 1 abstract method" error for the core User entity is not something that should differ between PHP versions - that's a pretty fundamental error, and I don't see how we could even intentionally cause it.
Comment #6
tr commentedAre you still having this problem?
Comment #7
jonathan1055 commentedJust checked and the problem has gone. There was one more failure the next day, then it was green. There have been individual days when the tests fail, the last was 11th April but they've been running green continuously since then.
Sorry for not noticing and closing this myself.
Comment #8
jonathan1055 commentedSorry for re-opening this, but I wanted to correct my statement in #7. The problem did not go away at all. I only added PHP7.3 on a test branch, which failed, but when I re-checked after your prompting in #6 and I said the problem had gone away I was looking at the main 8.x-1.x branch which does not use PHP7.3 yet.
I have re-tested at PHP7.3 and it fails consistently at core 8.8 and 8.9 with 61 errors of the type as initially reported. I may investigate, or I may just drop the PHP7.3 runs for 8.8 and 8.9.
PHP7.3 with Core 9.0 does not have this problem and the tests run OK.
Comment #9
tr commentedWell as I said, I really don't think this has anything to do with the Typed Data module. I can't reproduce this, and it works on DrupalCI with PHP 7.3 in both 8.8 and 8.9.
Comment #10
jonathan1055 commentedYes it is odd. I am going to investigate, but that can be done in my own time to satisfy my curiosity. The best solution here, to get this working on Travis and not have every job fail (which could mask a potential other fault that I'd not be alerted to) is simply not run Core 8.9 at PHP7.3, only 7.1. So here's a patch to .travis.yml which simplifies the job matrix. I have also dropped testing at core 8.7
Comment #11
jonathan1055 commentedThis is only a change to .travis.yml and will not affect testing on drupal.org. Setting to RTBC
Comment #13
tr commentedCommitted.
Comment #14
jonathan1055 commentedJust pushed this to my GitHub/Travis and the builds pass, all green. Thanks.
We still have
due to #3161000: Deprecated Symfony constraint 'min' option and when that is committed it will be zero again.