Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Aug 2014 at 07:31 UTC
Updated:
25 Aug 2014 at 14:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
benjy commentedComment #2
benjy commentedA POC attached.
Open to suggestions on how we should store the data. I keyed it by [migrate][migration_id][status] so we can add extra data later but i'm open to suggestions.
This doesn't belong in prepareIdMappings() but I put it there to test as prepareIdMappings() is called at the right time for this to happen and it saved me updating every test. Not sure if we should refactor and have this in MigrationTestBase::prepare() or whether it should just be it's own method that is called from every tests with dependencies?
Comment #3
benjy commentedComment #4
benjy commentedI was looking at ways to add a test and I couldn't decide on the best approach. Unit testing won't be easy since Migration:;checkRequirements() uses \Drupal::entityManager(). We could refactor that but we don't currently inject anything into the Migration entity.
Otherwise, a Simpletest test for this would probably be a simple migration. We don't currently have any migrations that are just for testing but that might be something we should introduce?
Comment #5
chx commentedI would think since we changed the dependency checker we finally could use dependencies for real and thus test...? Ie if a migration wasnt run a dependent one won't.
Comment #6
benjy commentedUploading patch to test this new functionality. There could be other migrations that need dependencies moving from optional to required and i'll check over them next.
Comment #8
benjy commentedFixed the tests, MigrateNodeTest needed to set d6_node_settings migration as complete since it's a new dependency.
MigrateDependenciesTest was using the comment migration to tests dependencies and comment depended on node which now depends on node_settings.
Comment #9
benjy commentedI've changed the migrations to required where applicable. The only strange one is d6_menu been required for d6_block, seems wrong? But see what the bot says.
Comment #11
benjy commentedFixed dependencies.
Comment #13
chx commentedcore/modules/migrate/config/schema/migrate.schema.ymlshould be:Comment #14
chx commentedComment #15
benjy commentedDone.
The docs aren't entirely clear on what else
type: config_entitygives us but I think it's just more flexibility from the ridged mapping structure. https://www.drupal.org/node/1905070Comment #16
chx commentedCheck core/config/schema/core.data_types.schema.yml for what type: config_entity gives us -- not much. This is a great day when so much badly marked optional migrational die and we don't need to move anything else there any more. Thanks!
Comment #17
alexpottCommitted 453a445 and pushed to 8.0.x. Thanks!
It would nice to have a comment here as to why we're marking migrations complete. Looking at the code it seems we are ensuring all the dependencies of the migration under test are met. Perhaps https://drupal.org/node/2315489 can address this because I had to think to work this out.