Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
StatusFileSize
new3.99 KB
quietone’s picture

StatusFileSize
new6.58 KB

Added VariableTest.php

erozqba’s picture

StatusFileSize
new6.56 KB

Hi @quietone,
I was reviewing and testing your patch and it looks great to me.
I have only one suggestion : Use only one way to declare an array. In the class i18nVariableTest, you have used two different ways: array() and []. How you use [] more frequently in other parts of your code, I have replaced array() by [] in the patch 2807913-4.patch .

Status: Needs review » Needs work

The last submitted patch, 4: 2807913-4.patch, failed testing.

quietone’s picture

@erozqba, thanks for catching my error and converting everything to short array syntax.

erozqba’s picture

Status: Needs work » Reviewed & tested by the community

All tests pass for the patch 2807913-4.patch, @quietone and I have tested and review this.

quietone’s picture

Status: Reviewed & tested by the community » Needs review

@erozqba, Thanks for your work! But since we both wrote the patch it neither of us should really be marking it RTBC. I realize your latest change was kinda minor but it still better to have another person RTBC. (Adding an interdiff with your patch is also helpful to anyone following). The handbook has some more detail on marking RTBC that you may haven't seen.

Setting to NR so that someone other than those helped write the patch take a look.

erozqba’s picture

StatusFileSize
new1.1 KB

@quietone
I found that replace only the way that arrays are declared was really a minor change, but you are completely right, is better if someone other takes a look. I have added the interdiff-2807913-3-4.txt to make this helpful as you suggested. Thanks!

svendecabooter’s picture

StatusFileSize
new10.39 KB

The patch doesn't seem to convert the VariableMultiRow plugin tests.
Attached is an updated patch that converts this Plugin test as well.

Status: Needs review » Needs work

The last submitted patch, 10: 2807913-10.patch, failed testing.

erozqba’s picture

Status: Needs work » Needs review
StatusFileSize
new10.38 KB
new2.03 KB

@svendecabooter Thanks for your work! I have made minor changes to your patch to make it pass the tests.

svendecabooter’s picture

Thanks erozqba!
Seems my "phpcbf" command added a dot at the end of the @covers statement, which is not really helpful :)

phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Assigning to myself for review.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Nothing objectionable here. Great work, guys.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableMultiRowTest.php
    @@ -0,0 +1,41 @@
    +class VariableMultiRowTest extends VariableTest {
    ...
    +    // Use the same test data as parent.
    +    $tests = parent::providerSource();
    

    I think entangling these tests actually makes it harder to understand what is being tested. Let's just copy the providerSource from VariableTest and extend MigrateSqlSourceTestBase.

  2. +++ /dev/null
    @@ -1,20 +0,0 @@
    -<?php
    -
    -namespace Drupal\Tests\migrate_drupal\Unit\source;
    -
    -/**
    - * Tests variable multirow source w/ high water handling.
    - *
    - * @group migrate_drupal
    - */
    -class VariableMultiRowSourceWithHighwaterTest extends VariableMultiRowTestBase {
    -
    -  /**
    -   * {@inheritdoc}
    -   */
    -  protected function setUp() {
    -    $this->migrationConfiguration['highWaterProperty']['field'] = 'test';
    -    parent::setup();
    -  }
    -
    -}
    

    Where's this test gone?

erozqba’s picture

Hi @alexpott I don't know how to implement the VariableMultiRowSourceWithHighwaterTest, any hint you could provide here, any example? Thanks in advance.

jofitz’s picture

Assigned: phenaproxima » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.36 KB
new12.38 KB
  1. VariableMultiRowTest now extends MigrateSqlSourceTestBase.
  2. Re-instated VariableMultiRowSourceWithHighwaterTest.

(and replaced a few commas)

Status: Needs review » Needs work

The last submitted patch, 18: 2807913-18.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new12.4 KB
new728 bytes

Correctly named the VariableMultiRowSourceWithHighwaterTest class(!) #facepalm

Status: Needs review » Needs work

The last submitted patch, 20: 2807913-20.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review

Tests pass after retest.

phenaproxima’s picture

Great stuff. Thank you, @Jo Fitzgerald! I have only one concern about one of the tests, and it's nothing you did, but I'd like to address it here:

+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableMultiRowSourceWithHighwaterTest.php
@@ -0,0 +1,58 @@
+    // The source plugin configuration.
+    $tests[0]['configuration']['variables'] = [
+      'foo',
+      'bar',
+    ];
+    $tests[0]['configuration']['high_water_property']['name'] = 'name';

I don't understand what this test is asserting. How can variables have a high-water mark? High-water marks are only for things that have a deterministic order; variables don't really fall into that category.

If this is what the old version of the test did, that old test is weird and strange and proves nothing, and we should drop this entire test class from our suite.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

quietone’s picture

Version: 8.4.x-dev » 8.3.x-dev
StatusFileSize
new695 bytes
+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableMultiRowSourceWithHighwaterTest.php
@@ -0,0 +1,58 @@
+class VariableMultiRowTest extends MigrateSqlSourceTestBase {

s/VariableMultiRowTest/VariableMultiRowSourceWithHighwaterTest

quietone’s picture

Really? I think I'm in time slip, didn't see comments 20+. Sigh. Sorry for the noise.

quietone’s picture

Status: Needs review » Needs work

Re #23, Yes, that is just converting the original code. I thought it was kinda odd too.

+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/d6/i18nVariableTest.php
@@ -0,0 +1,77 @@
+class i18nVariableTest extends MigrateSqlSourceTestBase {

s/i18nVariableTest/I18nVariableTest

And, if it can be done here, can we also rename the plugin from i18nVariable to I18nVariable?

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new6.25 KB

Rerolled and removed VariableMultiRowSourceWithHighwaterTest.php.

Renaming the source plugin i18nVariable and the corresponding test should be another issue.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Werd to that. Looks poifect to me!

Any further condensing of these tests (i.e., taking greater advantage of the data provider pattern) can happen in a follow-up. Just moving these to the new base class is a big help. So let's get this in.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: 2807913-27.patch, failed testing.

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community

Testbot hiccup

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: 2807913-27.patch, failed testing.

erozqba’s picture

Status: Needs work » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed b523b90 to 8.4.x and b400bf8 to 8.3.x. Thanks!

Backported to 8.3.x as this is a tests only change to an experimental module.

  • alexpott committed c9f41a1 on 8.4.x
    Issue #2807913 by quietone, erozqba, Jo Fitzgerald, svendecabooter,...

  • alexpott committed b400bf8 on 8.3.x
    Issue #2807913 by quietone, erozqba, Jo Fitzgerald, svendecabooter,...

Status: Fixed » Closed (fixed)

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