- Issue created by @dww
Follow-up from π Reduce time of Migrate Upgrade tests by not outputting the logs by default RTBC . When I was reviewing that, I noted:
Took me a moment to understand why we're moving
assertLogError()
outside the check for if we've written anything to the logs. But then with grep and looking at more context outside of the MR diff, I see that that function relies on$this->expectedLoggedErrors
, which is only set in the two functions where assertLogError() is now found.At the risk of slowing down this important fix, I have to ask: should that method really be something like:
assertLogErrorCount(int $expected): void
Why bother with the
expectedLoggedErrors
property at all? It's only set exactly twice with hard-coded ints each time:./core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php: $this->expectedLoggedErrors = 27; ./core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php: $this->expectedLoggedErrors = 39;
We never increment or anything. It's basically just a constant. Why not pass it directly where we need it?
@catch replied "I think #8's a good idea for follow-up." so here we are. π
MigrateUpgradeExecuteTestBase::assertLogError()
to assertLogErrorCount(int $expected)
.expectedLoggedErrors
property.Active
11.0 π₯