Spun off from #2554321: Clean up Migrate's test suite.

MigrateDrupalTestBase contains a method, testSourcePlugin(), which is absolutely misplaced. It was only ever intended as a regression test against a really dumb bug which would have been caught if all source plugins had accompanying unit tests (most do, but a few don't). When #2554321: Clean up Migrate's test suite lands, each test method in Migrate Drupal's integration tests will incur a considerable amount of overhead due to all the required migrations running in setUp(), and this method really does not belong in the integration test suite anyway.

testSourcePlugin() should be removed and replaced with dedicated unit tests for all source plugins which use DummyQueryTrait. These will be able to catch the original regression, and provide a place to add further tests of each plugin if needed.

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Title: Remove MigrateDrupalTestBase:;testSourcePlugin() » Remove MigrateDrupalTestBase::testSourcePlugin()

Fixing an errant character in the issue title.

mikeryan’s picture

testSourcePlugin() should be removed and replaced with dedicated unit tests for all source plugins which use DummyQueryTrait.

That's kinda backwards - if a plugin is using DummyQueryTrait, then it's going to be fine and won't exhibit the original bug. The point of testSourcePlugin() is to automatically catch if a new source plugin is added which has a bogus query() and/or count() method, and should be using DummyQueryTrait.

phenaproxima’s picture

Status: Postponed » Needs work
phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new35.5 KB

So, first off, I apologize for the unexpected length of this patch.

This ices MigrateDrupalTestBase::testSourcePlugin() -- good riddance, IMO. That, however, required me to add tests for source plugins which didn't already have unit tests. That was the point of testSourcePlugin() to begin with -- a way to work around the holes in our source plugin test coverage. I've moved its assertions into MigrateSqlSourceTest and added a lot of missing tests.

This should, hopefully, be pretty non-controversial -- after all, it adds a lot of new test coverage to Migrate Drupal.

phenaproxima’s picture

StatusFileSize
new37.63 KB
new38.14 KB
new1.83 KB
new303 bytes

Here is the witch-dunker -- the fail patch reintroduces a buggy condition which is caught by the new UserPictureInstanceTest.

The last submitted patch, 5: 2573559-5.patch, failed testing.

The last submitted patch, 5: 2573559-5.patch, failed testing.

The last submitted patch, 6: 2573559-6.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: 2573559-6-FAIL.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new38.31 KB

Bah, humbug!

The last submitted patch, 6: 2573559-6.patch, failed testing.

The last submitted patch, 6: 2573559-6-FAIL.patch, failed testing.

mikeryan’s picture

Status: Needs review » Reviewed & tested by the community

Gave up waiting on PIFR, RTBC...

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Love the smell of fresh tests in the morning. ;)

Committed and pushed to 8.0.x. Thanks!

  • webchick committed 9fc8bba on 8.0.x
    Issue #2573559 by phenaproxima, mikeryan: Remove MigrateDrupalTestBase::...

Status: Fixed » Needs work

The last submitted patch, 11: 2573559-11.patch, failed testing.

mikeryan’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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