maxocub discovered in #2981393: Migrate D6 comment type language settings that the migration entity count in MigrateUpgrade6Test doesn't seem to be tested. He changed the value locally and the test still passed. See Comment #14.4.

This issue is to investigate that and make any necessary to changes to all the Drupal 6 and Drupal 7 tests affected.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
1.52 KB
5.36 KB

The test gets all the entities on the destination site and then checks that the count matches the count in the large array of expected counts. When there are more entity types in the expected array than on the actual site the count for those 'extra' entity types are simply ignored. When there are less entity types in the expected array than on the actual site the count for the 'missing' entity types defaults to zero and is tested. In both cases the list of expected entity types may not match what is actually tested. And I think they should.

The list of expected entity counts should be a accurate list of the entity types being tested.

To help make that happen I have added a test that compares the expected entity types with the actual entity types. And that test failed because contact_message was not in the expected list. Adding 'contact_message => 0' to the list and the test (MigrateUpgrade6Test) passed. The same line is added to the other tests but haven't run those tests locally.

The existing test is changed too, I removed the setting of the entity count to 0. That means that the expected count array now must list all the entities tested even if the count is 0.

The last submitted patch, 2: 3009137-2-fail.patch, failed testing. View results

quietone’s picture

Status: Needs review » Needs work
Issue tags: +Novice
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6NoMultilingualTest.php
@@ -58,6 +58,7 @@ protected function getEntityCounts() {
+      'contact_message' => 0,

@@ -66,7 +67,6 @@ protected function getEntityCounts() {
-      'migration' => 105,

+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/ .php
@@ -61,6 +61,7 @@ protected function getEntityCounts() {
+      'contact_message' => 0,

@@ -68,7 +69,6 @@ protected function getEntityCounts() {
-      'migration' => 73,

Remove changes to these to two files.

The fact that the failing test didn't have more failures has been bothering me. So, did some checking and these two tests aren't running the full migration (although with the entity count lists it looks like they do). They simply test that the migration does not run unless migrate_drupal_multilingual is enabled which, as I recall, was the intention at the time.

Tagging novice to remove the changes to MigrateUpgrade6NoMultilingualTest and MigrateUpgrade7NoMultilingualTest.

quietone’s picture

Status: Needs work » Needs review
FileSize
3.36 KB
1.41 KB

Removed items as per #4

maxocub’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice

Great, I'm glad you removed the default count of zero and the unused 'migration' count.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9629b7a and pushed to 8.7.x. Thanks!

Testing against 8.6.x to see if we can backport.

  • alexpott committed 9629b7a on 8.7.x
    Issue #3009137 by quietone, maxocub: Migration entity count not tested...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.