Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 314143

Migrate Drupal integration tests should load all dump files

$
0
0

This partially blocks #2549013: Remove load plugins.

If we simply remove load plugins and their infrastructure outright, MigrateDrupal6Test breaks because it tries to test dynamic migrations (i.e., migrations which use load plugins, like d6_cck_field_values, d6_term_node, and a couple of others).

What it needs to be doing instead is running the appropriate builders when the migrations are installed to begin with. However, just running the builders in installMigrations() isn't good enough, because builders usually need to read from arbitrary database tables in order to do their thing. If the required tables haven't been loaded up first, things blow up in an inferno of PDO exceptions.

It's also not good enough to simply change the loadDumps() calls to include the tables which the builders will need. Why? Because installMigrations() ham-fistedly installs all available migrations, not just the one(s) to be tested. So all builders would end up running (and failing due to missing tables), even those which have nothing to do with the migrations under test.

There are, then, two options:

  1. Load all the dump files beforehand so that the builders have all the data they need, up front. This is relatively easy and allows us to remove over 300 lines of code, so that's why I did that in the patch.
  2. setUp() can manually install the migrations to be tested, load in the dump files required by the builders beforehand. This would take longer, add more code, add another step to the tests' setUp() methods, and be prone to breaking since it's yet another thing to remember.

Viewing all articles
Browse latest Browse all 314143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>