Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 May 2014 at 17:19 UTC
Updated:
28 May 2015 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sunAdded required modules to MigrateDrupalTestBase.
Comment #4
sunForgot menu_link.
Comment #6
bdone commentedi believe this will still fail, but it's re-rolled for psr-4 conversion, and replaces DrupalUnitTestBase with KernelTestBase.
Comment #10
mikeryanSomewhere since the original patch MigrateDrupalTestBase already acquired a setUp(), merged this one into it (although I'm not clear why it's necessary to explicitly install migrate_drupal's config, shouldn't it be installed automatically?).
The migrate_drupal tests all fail locally for me with or without this patch ("Table system already exists" - maybe #2254157: Refactor Dump classes in migrate_drupal will fix this?), but giving the testbot a shot...
Comment #11
mikeryanComment #13
mikeryanReading the KernelTestBase docs, I see "Unlike WebTestBase::setUp(), the specified modules are loaded only, but not automatically installed. Modules need to be installed manually, if needed.". I though KernelTestBase::enableModules() would address this, but found only sadness. What works for the aggregator tests is adding $this->installEntitySchema('aggregator_feed') - some tedious work ahead to run through the failing tests and explicitly install the bits they need.
Comment #14
mikeryanCheckpoint, I'll give the testbot a shot at it but there's a lot more to do here. MigrateBookTest is as far as I got and I didn't quit work out the magic invocation for that one. Marking Novice - I think given the ones that are done, most of the remaining tests should be doable with just a bit of trial-and-error.
Comment #16
amateescu commentedI had a feeling that finishing this patch will fix the last remaining migrate test fail for SQLite, and it seems that it is indeed the case.
This was not a novice issue at all so I'm removing the tag.
Edit: removed the long test run result from the comment, it wasn't really helping with anything :)
Comment #18
amateescu commentedFixed the unit test.
Comment #19
berdirshould we also define the new call at 2 in the unit test?
I guess some modules would make more sense in the parent class, but doesn't make a big difference...
That's.. creative ;)
Maybe that's why it requires the table create change? Or it is sqlite, as you said.
simpletest? ;) we are migrating the config, it shouldn't matter if it already exists or not, or does it? I guess something from simpletest.module runs that needs its config?
needs a . at the end I think ;)
I'd suggest to explicitly use uid = 1, and document that it needs user *1*, not just any user. You can make it save with enforceIsNew().
duplicated here? shouldn't be necessary then, or actually, you create two users?
Comment #20
amateescu commentedThanks for reviewing :)
1: Why not, fixed.
2: I wanted to keep the module list as small as possible in the base class so it is more visible in the child classes what the dependencies are.
3: Thanks :P Nope, that's not the reason for the message table creation change because that's not provided by a hook_schema() imeplementation.
3, 4 & 6: The thing with
MigrateDrupal6Test::setUp()is that it needs to duplicate the work being done in the setUp() methods of *all* the migrate_drupal test classes, and one of them installs the simpletest config :)5: Fixed.
Comment #21
amateescu commentedImproved the title a bit, there's no such thing as DUTB anymore.
Comment #22
amateescu commentedAnd with this small change in
MigrateUserProfileFieldTestwe haveMigrateDrupal6Testfully passing on DrupalCI testbots. I blame it (again) on race conditions caused by the weird wayMigrateDrupal6Testchooses to run all the migrate_drupal test classes.Edit: this is the actual fail if anyone is curious:
Comment #23
dawehnerAdded an issue summary.
@amateescu, can you describe why moving it helps to fix the sqlite problem with it?
The code looks really great!
Interesting, indeed with support both.
Feel free to use
->willReturnValue()the next time.If you change things anyway, can you change this to
$this->any()it is just the way better idea here.Comment #24
amateescu commentedDo you mean the change from
assertIdentical()toassertEqual()? I can not say I understand 100% what's going on, but as I said earlier, it has to be some kind of race condition triggered by the unusual way of running test methods inMigrateDrupal6Test. You can see the actual failure in #22, it's the last two entries of a $field_storage['settings']['allowed_values'] entry that are in the wrong order.1. Yep, I had no idea :)
2. I cannot find a
willReturnValue()method anywhere in PHPUnit..3. Why not, fixed.
Comment #25
berdirI think the method is named willReturn() :)
Nice, this means the migrate_drupal_migrate test group (87 tests!) runs in 3m instead of 12m, so 4x faster. That's with concurrency 1, not going to be a huge difference on testbot with a concurrency of 14 of course, but still, very nice if you're running them locally.
@dawehner mentioned in IRC that it would make sense to document the changes that were done to fix sqlite but looking through the patch, I'm actually not sure where we could improve documentation.
I think this is ready.
(Kind of crossposted with above)
Comment #26
dawehnerUps, yeah!
+1 for the RTBC
Comment #27
alexpottThis is a lovely change. Thank you. Committed ea32974 and pushed to 8.0.x. Thanks!