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.
Problem/Motivation
I'm trying to do stuff that involves having tests passing, such as #2030633: Expand FieldStorageConfig with methods
I can't do those things because migrate always fails tests, both on the testbot and locally.
Repro:
Using: MAMP 3.0.3, with PHP 5.4.25, MySQL 5.5.34.
- Make a fresh install Drupal 8. I'm looking at bd0e53f429f13988199aaa603783f225d86965c5, but this has been going on for a while. (Still failing as of efc0e2e41df7be095b954e8cc9648b0ad3f3e8b9.)
- Enable simpletest/Testing.
- Run the
MigrateDrupal6Test
test. - Behold the red divs of doom.
Running MigrateDrupal6Test
apparently triggers runs of a series of tests. The failing tests for : MigrateCommentTest
, MigrateDateFormatTest
, MigrateForumConfigsTest
, and MigrateMenuLinkTest
.
As of efc0e2e41df7be095b954e8cc9648b0ad3f3e8b9:
- MigrateAggregatorItemTest fails with a fatal error:
Call to a member function id() on a non-object PHP Fatal error MigrateAggregatorItemTest.php 63 Unknown
- MigrateDrupal6Test fails with a fatal error:
The test did not complete due to a fatal error. Completion check MigrateFullDrupalTestBase.php 52 Drupal\migrate_drupal\Tests\d6\MigrateDrupal6Test->testDrupal()
with no stack trace.
Proposed resolution
- Figure out what the problem is.
- Fix it.
Comments
Comment #1
Mile23Well as of 03f372f3f7dadac50e04ad81bd88ce4e11a682a1 we're down to only failing in
MigrateAggregatorItemTest
andMigrateFullDrupalTestBase
.Yay progress.
Comment #2
BerdirThose tests work on testbot and they work for me, if you have fails, then we will need some more information on what exactly is failing.
That said, the errors in the last patch in #2030633: Expand FieldStorageConfig with methods points at a very specific problem that can easily be fixed without having to run those tests locally? It also hints at code that has no test coverage except in the context of migrations.
Comment #3
BerdirPlease post what test failures you have exactly, and what OS/PHP version you have. I've run those tests before, they worked and they also pass on testbot.
Comment #4
Mile23Comment #5
BerdirThanks. I'm not sure I can parse that description correctly. You are saying that the fatal error is in MigrateAggregatorItemTest while running MigrateDrupal6Test? Does MigrateAggregatorItemTest also fail if you run just that, directly? A screenshot might make it clearer...
Are you running the tests in the UI? does it also happen if you run them with run-tests.sh?
A fatal is often preceded by other exceptions/errors, is it just the fatal error, or do you see other errors too?
Looking at the test, that tries to load something that
My guess is that the migration itself aborts early, and then data is not there and the assertions start to fatal.
Comment #6
Mile23Thanks for taking the time. I'm not going to work at this too hard on this, because when it comes to migrate, I have no desire to investigate further for personal reasons you can ask me about sometime.
Yes.
Yes, IIRC.
UI.
There are fatals and test fails. I assume the fails are related to the fatals.
It would be nice to not have to guess, wouldn't it? :-)
Comment #7
ultimikeComment #8
mikeryanWell, it's been a long time, and there've been a lot of changes to the migration system and its tests since then. I have no trouble running the tests through the UI now - if any test failures are found (UI or command-line), they should be opened as distinct issues.