Commit 8aee36fd authored by webchick's avatar webchick

Issue #2557253 by phenaproxima, neclimdul: MigrateFullDrupalTestBase test...

Issue #2557253 by phenaproxima, neclimdul: MigrateFullDrupalTestBase test discovery gobbles all the memory
parent c17a82f9
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to action.settings.yml. * Upgrade variables to action.settings.yml.
* *
* @group action * @group migrate_drupal_6
*/ */
class MigrateActionConfigsTest extends MigrateDrupal6TestBase { class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to aggregator.settings.yml. * Upgrade variables to aggregator.settings.yml.
* *
* @group aggregator * @group migrate_drupal_6
*/ */
class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase { class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to aggregator_feed entities. * Upgrade variables to aggregator_feed entities.
* *
* @group aggregator * @group migrate_drupal_6
*/ */
class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase { class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade aggregator items. * Upgrade aggregator items.
* *
* @group aggregator * @group migrate_drupal_6
*/ */
class MigrateAggregatorItemTest extends MigrateDrupal6TestBase { class MigrateAggregatorItemTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade block settings to block.block.*.yml. * Upgrade block settings to block.block.*.yml.
* *
* @group block * @group migrate_drupal_6
*/ */
class MigrateBlockTest extends MigrateDrupal6TestBase { class MigrateBlockTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade custom blocks. * Upgrade custom blocks.
* *
* @group block_content * @group migrate_drupal_6
*/ */
class MigrateBlockContentTest extends MigrateDrupal6TestBase { class MigrateBlockContentTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to book.settings.yml. * Upgrade variables to book.settings.yml.
* *
* @group book * @group migrate_drupal_6
*/ */
class MigrateBookConfigsTest extends MigrateDrupal6TestBase { class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade book structure. * Upgrade book structure.
* *
* @group book * @group migrate_drupal_6
*/ */
class MigrateBookTest extends MigrateDrupal6TestBase { class MigrateBookTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade comments. * Upgrade comments.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentTest extends MigrateDrupal6TestBase { class MigrateCommentTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade comment type. * Upgrade comment type.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentTypeTest extends MigrateDrupal6TestBase { class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
/** /**
* Upgrade comment variables to entity.display.node.*.default.yml. * Upgrade comment variables to entity.display.node.*.default.yml.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase { class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Upgrade comment subject variable to core.entity_form_display.comment.*.default.yml * Upgrade comment subject variable to core.entity_form_display.comment.*.default.yml
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentVariableEntityFormDisplaySubjectTest extends MigrateDrupal6TestBase { class MigrateCommentVariableEntityFormDisplaySubjectTest extends MigrateDrupal6TestBase {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
/** /**
* Upgrade comment variables to core.entity_form_display.node.*.default.yml. * Upgrade comment variables to core.entity_form_display.node.*.default.yml.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase { class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade comment variables to field.storage.node.comment.yml. * Upgrade comment variables to field.storage.node.comment.yml.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentVariableFieldTest extends MigrateDrupal6TestBase { class MigrateCommentVariableFieldTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Upgrade comment variables to field.instance.node.*.comment.yml. * Upgrade comment variables to field.instance.node.*.comment.yml.
* *
* @group comment * @group migrate_drupal_6
*/ */
class MigrateCommentVariableInstanceTest extends MigrateDrupal6TestBase { class MigrateCommentVariableInstanceTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Migrate contact categories to contact.form.*.yml. * Migrate contact categories to contact.form.*.yml.
* *
* @group contact * @group migrate_drupal_6
*/ */
class MigrateContactCategoryTest extends MigrateDrupal6TestBase { class MigrateContactCategoryTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to contact.settings.yml. * Upgrade variables to contact.settings.yml.
* *
* @group contact * @group migrate_drupal_6
*/ */
class MigrateContactConfigsTest extends MigrateDrupal6TestBase { class MigrateContactConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to dblog.settings.yml. * Upgrade variables to dblog.settings.yml.
* *
* @group dblog * @group migrate_drupal_6
*/ */
class MigrateDblogConfigsTest extends MigrateDrupal6TestBase { class MigrateDblogConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade field formatter settings to entity.display.*.*.yml. * Upgrade field formatter settings to entity.display.*.*.yml.
* *
* @group field * @group migrate_drupal_6
*/ */
class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase { class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* Migrate field instances. * Migrate field instances.
* *
* @group field * @group migrate_drupal_6
*/ */
class MigrateFieldInstanceTest extends MigrateDrupal6TestBase { class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Migrate fields. * Migrate fields.
* *
* @group field * @group migrate_drupal_6
*/ */
class MigrateFieldTest extends MigrateDrupal6TestBase { class MigrateFieldTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Migrate field widget settings. * Migrate field widget settings.
* *
* @group field * @group migrate_drupal_6
*/ */
class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase { class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to file.settings.yml. * Upgrade variables to file.settings.yml.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateFileConfigsTest extends MigrateDrupal6TestBase { class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/** /**
* file migration. * file migration.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlterInterface { class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlterInterface {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Upload entity display. * Upload entity display.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase { class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Upload form entity display. * Upload form entity display.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase { class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Uploads migration. * Uploads migration.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateUploadFieldTest extends MigrateDrupal6TestBase { class MigrateUploadFieldTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upload field instance migration. * Upload field instance migration.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateUploadInstanceTest extends MigrateDrupal6TestBase { class MigrateUploadInstanceTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Migrate association data between nodes and files. * Migrate association data between nodes and files.
* *
* @group file * @group migrate_drupal_6
*/ */
class MigrateUploadTest extends MigrateUploadBase { class MigrateUploadTest extends MigrateUploadBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Upgrade variables to filter.formats.*.yml. * Upgrade variables to filter.formats.*.yml.
* *
* @group filter * @group migrate_drupal_6
*/ */
class MigrateFilterFormatTest extends MigrateDrupal6TestBase { class MigrateFilterFormatTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to forum.settings.yml. * Upgrade variables to forum.settings.yml.
* *
* @group forum * @group migrate_drupal_6
*/ */
class MigrateForumConfigsTest extends MigrateDrupal6TestBase { class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to locale.settings.yml. * Upgrade variables to locale.settings.yml.
* *
* @group locale * @group migrate_drupal_6
*/ */
class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase { class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Menu link migration. * Menu link migration.
* *
* @group menu_link_content * @group migrate_drupal_6
*/ */
class MigrateMenuLinkTest extends MigrateDrupal6TestBase { class MigrateMenuLinkTest extends MigrateDrupal6TestBase {
......
...@@ -16,17 +16,11 @@ ...@@ -16,17 +16,11 @@
abstract class MigrateFullDrupalTestBase extends MigrateDrupalTestBase { abstract class MigrateFullDrupalTestBase extends MigrateDrupalTestBase {
/** /**
* The test class which discovered migration tests must extend in order to be * The group to which tests should belong in order for this test to run them.
* included in this test run.
*/
const BASE_TEST_CLASS = 'Drupal\migrate_drupal\Tests\MigrateDrupalTestBase';
/**
* A list of fully-qualified test classes which should be ignored.
* *
* @var string[] * @var string
*/ */
protected static $blacklist = []; const TEST_GROUP = '';
/** /**
* Get the test classes that needs to be run for this test. * Get the test classes that needs to be run for this test.
...@@ -35,20 +29,8 @@ abstract class MigrateFullDrupalTestBase extends MigrateDrupalTestBase { ...@@ -35,20 +29,8 @@ abstract class MigrateFullDrupalTestBase extends MigrateDrupalTestBase {
* The list of fully-classified test class names. * The list of fully-classified test class names.
*/ */
protected function getTestClassesList() { protected function getTestClassesList() {
$classes = []; $groups = \Drupal::getContainer()->get('test_discovery')->getTestClasses();
return isset($groups[static::TEST_GROUP]) ? array_keys($groups[static::TEST_GROUP]) : [];
$discovery = \Drupal::getContainer()->get('test_discovery');
foreach (static::$modules as $module) {
foreach ($discovery->getTestClasses($module) as $group) {
foreach (array_keys($group) as $class) {
if (is_subclass_of($class, static::BASE_TEST_CLASS)) {
$classes[] = $class;
}
}
}
}
// Exclude blacklisted classes.
return array_diff($classes, static::$blacklist);
} }
/** /**
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* CCK field revision migration. * CCK field revision migration.
* *
* @group migrate_drupal * @group migrate_drupal_6
*/ */
class MigrateCckFieldRevisionTest extends MigrateNodeTestBase { class MigrateCckFieldRevisionTest extends MigrateNodeTestBase {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* CCK field content migration. * CCK field content migration.
* *
* @group migrate_drupal * @group migrate_drupal_6
*/ */
class MigrateCckFieldValuesTest extends MigrateNodeTestBase { class MigrateCckFieldValuesTest extends MigrateNodeTestBase {
......
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
*/ */
class MigrateDrupal6Test extends MigrateFullDrupalTestBase { class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
const BASE_TEST_CLASS = 'Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase'; const TEST_GROUP = 'migrate_drupal_6';
protected static $blacklist = array(
'Drupal\migrate_drupal\Tests\dependencies\MigrateDependenciesTest',
);
/** /**
* Modules to enable. * Modules to enable.
...@@ -52,6 +48,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase { ...@@ -52,6 +48,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'migrate_drupal', 'migrate_drupal',
'node', 'node',
'options', 'options',
'path',
'search', 'search',
'system', 'system',
'simpletest', 'simpletest',
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/** /**
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeBuilderTest extends MigrateDrupal6TestBase { class MigrateNodeBuilderTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Test migrating node settings into the base_field_bundle_override config entity. * Test migrating node settings into the base_field_bundle_override config entity.
* *
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase { class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* Upgrade variables to node.settings.yml. * Upgrade variables to node.settings.yml.
* *
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeConfigsTest extends MigrateDrupal6TestBase { class MigrateNodeConfigsTest extends MigrateDrupal6TestBase {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/** /**
* Node content revisions migration. * Node content revisions migration.
* *
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeRevisionTest extends MigrateNodeTestBase { class MigrateNodeRevisionTest extends MigrateNodeTestBase {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* Node content migration. * Node content migration.
* *
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeTest extends MigrateNodeTestBase { class MigrateNodeTest extends MigrateNodeTestBase {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* Upgrade node types to node.type.*.yml. * Upgrade node types to node.type.*.yml.
* *
* @group node * @group migrate_drupal_6
*/ */
class MigrateNodeTypeTest extends MigrateDrupal6TestBase { class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
......