Postponed on #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php

Problem/Motivation

When running a migration with the UI, failures are logged to watchdog but that table is deleted as part of tearing down the test setup. That leaves the developer with no information to find the migration causing the failure, as seen in this screenshot at #2746541-153: Migrate D6 and D7 node revision translations to D8:

We need a way to save and report those errors.

Proposed resolution

Access all pages of /admin/reports/dblog in the test site so the results are saved in the BROWSERTEST_OUTPUT_DIRECTORY directory.

Remaining tasks

Find out why test fail on sqlite
Update patch
Review
Commit

CommentFileSizeAuthor
#109 interdiff-106-109.txt3.87 KBquietone
#106 3082211-106.patch4.79 KBquietone
#106 interdiff-103-106.txt995 bytesquietone
#103 3082211-103.patch6.12 KBquietone
#103 interdiff-102-103.txt397 bytesquietone
#102 3082211-102.patch6.12 KBquietone
#102 diff-100-102.txt3.78 KBquietone
#100 3082211-100.patch6.28 KBquietone
#100 interdiff-78-100.txt1.79 KBquietone
#98 3082211-98.patch8.29 KBquietone
#95 3082211-95-fail.patch7.48 KBquietone
#88 3082211-88.patch5.46 KBquietone
#88 interdiff-78-88.txt603 bytesquietone
#78 3082211-78.patch5.47 KBquietone
#78 diff-75-78.txt384 bytesquietone
#75 3082211-75.patch5.47 KBquietone
#75 interdiff-66-75.txt1.08 KBquietone
#66 3082211-66.patch4.72 KBquietone
#66 diff-65-66.txt1.41 KBquietone
#65 3082211-65.patch4.63 KBquietone
#65 interdiff-63-65.txt646 bytesquietone
#63 3082211-63.patch4.63 KBquietone
#63 interdiff-54-63.txt688 bytesquietone
#54 3082211-54.patch4.62 KBquietone
#54 diff-49-54.txt1.05 KBquietone
#49 3082211-49.patch4.39 KBquietone
#49 interdiff-46-49.txt3.99 KBquietone
#46 3082211-46.patch7.23 KBquietone
#46 interdiff-44-46.txt2.95 KBquietone
#46 3082211-46.patch7.23 KBquietone
#46 interdiff-44-46.txt2.95 KBquietone
#45 log-example.png103.4 KBdanflanagan8
#44 3082211-44.patch6.11 KBquietone
#44 interdiff-42-44.txt454 bytesquietone
#42 3082211-42.patch6.11 KBquietone
#42 interdiff-40-42.txt1.03 KBquietone
#40 3082211-40.patch6.17 KBquietone
#40 interdiff-37-40.txt3.74 KBquietone
#37 3082211-37.patch6.08 KBquietone
#37 interdiff-33-37.txt3 KBquietone
#33 3082211-33.patch9.57 KBquietone
#33 interdiff-26-33.txt3.57 KBquietone
#31 3082211-31.patch24.17 KBquietone
#31 interdiff-26-31.txt17.92 KBquietone
#29 3082211-29.patch7.77 KBquietone
#29 interdiff-26-29.txt1.8 KBquietone
#26 3082211-26.patch6.05 KBquietone
#26 diff-19-26.txt714 bytesquietone
#23 interdiff_19_x.txt3.12 KBSpokje
#19 3082211-19.patch5.98 KBquietone
#19 interdiff-17-19.txt978 bytesquietone
#17 3082211-17.patch5.78 KBquietone
#15 3082211-15.patch1.35 KBquietone
#13 3082211-13.patch1.29 KBPooja Ganjage
#9 3082211-9.patch1.28 KBPooja Ganjage
#7 3082211-7.patch1.29 KBquietone

Issue fork drupal-3082211

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Wim Leers’s picture

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

Issue tags: +Migrate UI
quietone’s picture

Status: Active » Needs review
FileSize
1.29 KB

This will save the entire watchdog log to a csv file in the BROWSERTEST_OUTPUT_DIRECTORY. I couldn't think of a better place to put such a file. This could be smarter and only get warnings and errors.

benjifisher’s picture

Issue summary: View changes
Status: Needs review » Needs work

Saving a CSV file seems like a work-around, not a real solution.

Can we do drupalGet() in tearDown() and save the browser output of /admin/reports/dblog along with the rest of the UI pages?

Pooja Ganjage’s picture

Hi,

Creating a patch as suggested in #8 comment.

Please review the patch.

Thanks.

Pooja Ganjage’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: 3082211-9.patch, failed testing. View results

Vishalghyv’s picture

Have not seen the issue in detail but drupalGet is undefined in migrate_drupal_ui/tests/src/Functional/ - Reason for failing of test,
Without its fix patch will not work

Pooja Ganjage’s picture

quietone’s picture

@Pooja Ganjage, Thanks for working on this. When making a patch always add an interdiff, or a diff, whichever is appropriate. There are instructions for creating an interdiff in the handbook. If you think a diff is not needed, just add a comment stating why. It also helps to keep costs down if you run the relevant tests locally before uploading a patch. Thanks!

@benjifisher, yes, it is a workaround. And yes, we can save /admin/reports/dblog to the browser output directory. However, the links will not work, making it hard to read the message and if the local site has log messages it will be rather confusing if you follow one. Also, how does one get all the pages?

quietone’s picture

Status: Needs work » Needs review
FileSize
1.35 KB

And now a patch for the suggestion in #8, that will get all the log entries. I have tested this locally and found it usable to review the entire log. It isn't ideal but it is much, much better than nothing or having to remember to set breakpoints and then search the watchdog table before the test db is deleted.

No interdiff because this is a new approach.

benjifisher’s picture

Status: Needs review » Needs work
  1. I like this approach a lot better!

     +    $this->drupalGet('/admin/reports/dblog');
     +    while (strstr($this->getSession()->getPage()->getContent(), 'Next page') !== FALSE) {
     +      $this->clickLink('Next page');
     +    }

    Can we be a little more specific? We might follow the wrong link if we just search for the text "Next page". (Does clickLink('Next page') look for a link whose text contains "Next page" or does it only match if that is the complete link text?)

    Slight refinement: do not search for "Next page" twice.

     $page = $this->getSession()->getPage();
     while ($next_link = $page->findLink(...)) {
       $next_link->click();
     }

    Or does this work?

     $next_link = $this->getSession()->getPage()->findLink(...);
     while ($next_link) {
       $next_link->click();
     }
  2. What we are doing here is a little unusual, so maybe we should add a code comment.

  3. MigrateUpgradeTestBase extends BrowserTestBase, which already uses UiHelperTrait. Why do we need this?

     +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
     @@ -5,6 +5,7 @@
     ...
     +use Drupal\Tests\UiHelperTrait;
     @@ -16,6 +17,7 @@ abstract class MigrateUpgradeTestBase extends BrowserTestBase {
     ...
     +  use UiHelperTrait;

    I know that #12 claims that drupalGet() is not available. I see: the patch in #9 tried drupalGet() as a global function. I meant $this->drupalGet() as in #15.

quietone’s picture

Status: Needs work » Needs review
FileSize
5.78 KB

As I started to make changes for #16 I realized that this will output the pages for tests where it really isn't needed. This is really for Upgrade6 and Upgrade7 tests and the upcoming Rollback tests. So, I have changed this to only have those tests save the logs. And after the logs are saved there is a test of the number of errors in the watchdog log. That way, the test will fail if new errors are introduced and then one has the browser output for the logs to look at to help figure out what went wrong. Unfortunately, this adds another abstract method, getLogCountsError().

Another problem that this happens at the end of the test and by then the logged in user is not user 1. Since accessing the log requires user 1, an login request as user 1 is made. Unfortunately, that always fails. It fails with manual testing as well. I am fairly sure that worked in the past so that needs to be looked at.

There is no interdiff because this is a new approach. It probably needs more comments but I want to figure out why user 1 can't log in after the migration.

Status: Needs review » Needs work

The last submitted patch, 17: 3082211-17.patch, failed testing. View results

quietone’s picture

This fixes the user 1 login problem that I messed up.

Status: Needs review » Needs work

The last submitted patch, 19: 3082211-19.patch, failed testing. View results

quietone’s picture

Not sure how to figure this one out. The failing test passes locally with both with run-tests.sh and phpunit.

benjifisher’s picture

The test failed with

1) Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::testMigrateUpgradeExecute
Failed asserting that '33' matches expected 37.
...
/var/www/html/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php:126

If you update outputLogs() from

    $this->drupalGet('/admin/reports/dblog');

to

    $this->drupalGet('/admin/reports/dblog', ['query' => ['severity[]' => '3']]);

and run the test locally, then you can see the 37 expected errors on one page (no pagination needed). Also one error from the node module.

Staring at the list, can we guess which of the errors are not logged when the testbot runs the test? I see exactly 4 copies of

Invalid translation language (und) specified. (/app/core/lib/Drupal/Core/Entity/ContentEntityBase.php:955)

(Get the full text of the message from the title attribute.)

Spokje’s picture

FileSize
3.12 KB

I've whacked in couple of assertions on the expected watchdog errors (interdiff attached), these pass my local test, but the way it looks the 4 errors about A translation already exists for the specified language are not in the CI -environment.

See test-result here

benjifisher’s picture

@Spokje: Thanks! Certainly it is better to use RfcLogLevel::ERROR instead of '3' as in #22.

Looking at the results of my local test, these are /admin/reports/deblog/972 through ...975. The full text (from the title attributes):

  • Source ID 1: A translation already exists for the specified language (zu). (/app/core/lib/Drupal/Core/Entity/ContentEntityBase.php:810)
  • A translation already exists for the specified language (zu). (/app/core/lib/Drupal/Core/Entity/ContentEntityBase.php:810)
  • Source ID 2: A translation already exists for the specified language (fr). (/app/core/lib/Drupal/Core/Entity/ContentEntityBase.php:810)
  • A translation already exists for the specified language (fr). (/app/core/lib/Drupal/Core/Entity/ContentEntityBase.php:810)
Spokje’s picture

By hacking Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase to extend WebDriverTestBase I was able to get a screenshot from the Watchdog log on Drupal CI.
(Very Evil Patch that made the screenshot here)

Indeed the 4 A translation already exists for the specified language errors mentioned by @benjifisher in #24 are not present on the Drupal CI environment.

On my local install they _are_ present (and it seems on @benjifisher's install as well).

Hope Bigger Brains than mine are able to figure out why those errors are not present on CI, but present when running local.

quietone’s picture

Status: Needs work » Needs review
FileSize
714 bytes
6.05 KB

Needed a reroll, probably because of #2565931: Handle long comment bundle names.

quietone’s picture

Optionally, the errors are coming from d6_taxonomy_term_translation and d6_term_node_translation. Maybe those migrations can be changed and the errors avoided?

Status: Needs review » Needs work

The last submitted patch, 26: 3082211-26.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
1.8 KB
7.77 KB

An idea for avoiding the errors.

Status: Needs review » Needs work

The last submitted patch, 29: 3082211-29.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
17.92 KB
24.17 KB

Another attempt, this changes d6_taxonomy_term_localized to skip rows that are not using localization. This patch is based on #26.

Edit; fix grammar

quietone’s picture

Created an issue for fixing the d6_taxonomy_term_localized_translation migration. #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php.

I am not yet marking this a blocked, because work can continue on a) why drupalci reports different results and b) improving the test. For b) is a count a message sufficient here or should we count the types of messages. In one sense this is about saving the log for review after the test so the number of message is sufficient. However, we could take advantage of this and add more assertions on the message type or message text.

quietone’s picture

Updating the patch in #26 with the latest version of #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php to make sure that Upgrade6Test passes with that change.

quietone’s picture

Issue summary: View changes
Status: Needs review » Postponed
Issue tags: +MLS IDX feed

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Assigned: Unassigned » quietone
Status: Postponed » Needs work
Issue tags: -MLS IDX feed

Removing tag, I don't know that tag or how I did that.

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
3 KB
6.08 KB

Just a reroll.

quietone’s picture

Assigned: quietone » Unassigned
mikelutz’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
    @@ -22,6 +23,14 @@ protected function setUp() {
    +  /**
    +   * Gets the expected number of error messages.
    +   *
    +   * @return int
    +   *   The number of expected logged errors of type migrate_drupal_ui.
    +   */
    +  abstract protected function getLogCountsError();
    +
       /**
    

    Need the return typehint that is in the docblock to be added to the method declaration

  2. +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
    @@ -67,6 +67,12 @@ protected function getAvailablePaths() {
    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected function getLogCountsError() {
    +  }
    +
       /**
    

    Which brings up the issue that you've declared the return value to be an int, but you are returning void here. Should these `return 0;`?

quietone’s picture

Status: Needs work » Needs review
FileSize
3.74 KB
6.17 KB

This should fix #39 1 and 2. I added the return type hints and added 'return 0' as needed.

Status: Needs review » Needs work

The last submitted patch, 40: 3082211-40.patch, failed testing. View results

quietone’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Needs work » Needs review
FileSize
1.03 KB
6.11 KB

Remove duplicate doc block and fix the test to test for integers.

Status: Needs review » Needs work

The last submitted patch, 42: 3082211-42.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
454 bytes
6.11 KB

Yep, forgot to check Upgrade7Test like I did for Upgrade6Test.

danflanagan8’s picture

Status: Needs review » Needs work
FileSize
103.4 KB

I patched and ran Drupal\Tests\migrate_drupal_ui\Functional\d7\Upgrade7Test locally, and I get all the logs pages as html.

While you can't click into the links (since we don't scrape those pages), you can read the un-truncated message by hovering over the link since the link title holds the un-truncated message.

I'm confused about something, though: if the test fails, I don't see browser output for all the log pages.

I tested this by setting $context['results']['failures'] = 1; in MigrateUpgradeImportBatch::run(). The result is that I get a test failure like this:

Drupal\Tests\migrate_drupal_ui\Functional\d7\Upgrade7Test::testUpgradeAndIncremental
Behat\Mink\Exception\ResponseTextException: The text "Congratulations, you upgraded Drupal!" was not found anywhere in the text of the current page.

And that's where my browser output stops. I can't get to the log pages because they apparently aren't scraped. So the logs aren't there when I actually need them!

Is this something wrong or different with my local test setup? Or is there something I'm misunderstanding? Or is this a real problem with the approach in the issue?

Setting to NW to get response. Thanks!

quietone’s picture

Status: Needs work » Needs review
FileSize
2.95 KB
7.23 KB
2.95 KB
7.23 KB

@danflanagan8, thanks for testing this.

You are not wrong. The logs are only accessed, and thus part of the browser_output, at the end of the test. Any assertion that fails before that will mean that the logs are not output.

To fix that let's go back to the original idea made by benjifisher in #8 and move this into the tearDown method. By doing that it is possible to always access the logs.

quietone’s picture

Somehow uploaded that patch twice. I'll cancel the tests for the first one.

danflanagan8’s picture

Status: Needs review » Needs work

Thanks, @quietone. That makes sense and I like the fixes.

Now I get the logs even if the test fails.

I only have one suggestion for the patch, and I'm open to a rebuttal on it. Regarding the new abstract function:

+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
@@ -22,6 +37,25 @@ protected function setUp() {
+  abstract protected function getLogCountsError(): int;

What would you think about changing that to a protected property just like the new ones you added in the last patch. It could be protected $logCountsError = 0; or even leave it null protected $logCountsError;.

And then that default value could be overridden as needed. That way we wouldn't have to duplicate this all over:

  /**
   * {@inheritdoc}
   */
  protected function getLogCountsError(): int {
    return 0;
  }

Setting to NW to get a response. Once again, open to rebuttal!

quietone’s picture

@danflanagan8, I wasn't fond of that abstract method either. I did want to return to look at that after the tests completed in #46 but, as we can see, that did not happen. I do agree with you that the three variables should be properties should on the TestBase class.

#48. This patch implements the suggestion.

Status: Needs review » Needs work

The last submitted patch, 49: 3082211-49.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review

The test failure was fixed in #3255836: Test fails due to Composer 2.2 so returning this to Needs Review. Not rerunning to the tests until there is a review.

danflanagan8’s picture

I somehow lost track of this one! The latest patch looks really nice. I'm going trigger tests and then RTBC when they pass.

danflanagan8’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Darn, apparently this needs a reroll. Tagging and setting to NW.

quietone’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.05 KB
4.62 KB

Here is the reroll. I also noticed that we all missed that the logs were not tested in Upgrade6Test so I added that as well.

danflanagan8’s picture

Status: Needs review » Reviewed & tested by the community

I also noticed that we all missed that the logs were not tested in Upgrade6Test so I added that as well.

Oops. Well this time I applied the patch and tested with Upgrade6Test, but otherwise just like I did in #45. The logs were available when the test passed as well as when the test failed. I'm happy.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 54: 3082211-54.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

The failing test is Drupal\Tests\file\FunctionalJavascript\FileManagedFileElementTest which I don't see on the #2829040: [meta] Known intermittent, random, and environment-specific test failures but it unrelated, so restarting the tests.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 54: 3082211-54.patch, failed testing. View results

ravi.shankar’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC as per comment #57.

danflanagan8’s picture

For the record, #57 was not the latest failure. The failure in #58 is in Drupal\Tests\views\Functional\Plugin\DisplayTest which is a different random failure.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 54: 3082211-54.patch, failed testing. View results

danflanagan8’s picture

Status: Needs work » Reviewed & tested by the community

Most recent random failure was in Drupal\Tests\layout_builder\FunctionalJavascript\AjaxBlockTest

Back to RTBC.

quietone’s picture

Version: 9.4.x-dev » 10.0.x-dev
FileSize
688 bytes
4.63 KB

Adding 10.0.x version

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 63: 3082211-63.patch, failed testing. View results

quietone’s picture

Need to increase the count of errors logged maybe because aggregator was removed from the test. Or maybe not since Upgrade7Test is not affected. But for the purpose of this issue the number of errors in not a problem, we just want to make sure they are logged. This will become a test that needs to change when a module is removed, sort of like the entity_counts, so at least it is the same two files.

quietone’s picture

danflanagan8’s picture

Status: Needs review » Reviewed & tested by the community

Reroll looks correct. RTBC. Thanks, @quietone!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 66: 3082211-66.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated failure in Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove

Restoring RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 66: 3082211-66.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

random fail, Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 66: 3082211-66.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

And again, 1) Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 66: 3082211-66.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
1.08 KB
5.47 KB

There is a new failure and I tracked it down to #3277057: Make Claro the default admin theme in Standard profile.

We can either change the count of errors logged or install Seven in the destination site. I did the later in order to preserve what is on the source site, that is the theme settings for Seven. doing that changes the number of blocks, so an entity count is updated.

danflanagan8’s picture

Status: Needs review » Reviewed & tested by the community

This makes sense to me. RTBC.

This got me wondering if all the tests we've been moving to contrib are going to start failing, but it looks like they'll be fine. Those tests don't assert the number of log errors so they shouldn't mind a few extra errors.

benjifisher’s picture

Issue summary: View changes
Issue tags: +Needs reroll, +Novice

The patch for this issue needs a reroll after #3219959: Update standard profile so Olivero is the default theme. I am adding the Novice tag for the reroll.

quietone’s picture

quietone’s picture

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

Updating the tags.

And setting to NR so someone checks the reroll.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the reroll!

I compared the patches in #75 and #78. Other than metadata, the only differences were an entity count and an expected error count in Upgrade7Test. If the testbot is happy, then I am happy. Back to RTBC.

  • catch committed 8b52c0c on 10.0.x
    Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje,...
  • catch committed 42c8484 on 10.1.x
    Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje,...
  • catch committed d60a3f9 on 9.4.x
    Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje,...
  • catch committed 98e5ab0 on 9.5.x
    Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje,...
catch’s picture

Version: 10.0.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

I was a bit confused why we're visiting the log pages reading the patch, but it seems like a decent way to preserve the messages and couldn't think of another idea.

Committed/pushed to 10.1.x and cherry-picked back to 9.4.x, thanks!

xjm’s picture

This issue may have broken D9 head; a revert patch is running at #2994000: Notice in logs when setting invalid translation config for a content type.

mikelutz’s picture

Must have been this one. We changed the block count several times as the new themes became default, all of which should be in 9.4 and 10, but we should have ran the test again against D9, there are enough differences. I would be fine with leaving this in 10.1+ and reverting 9.4,9.5, and 10.0 if that's an option.

  • catch committed c39e9dc on 9.4.x
    Revert "Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje...

  • catch committed dd9e2e4 on 9.5.x
    Revert "Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje...
catch’s picture

Version: 9.4.x-dev » 10.0.x-dev

Reverted from 9.4.x and 9.5.x for now.

quietone’s picture

Working on a patch for D9.

quietone’s picture

I don't know why this is failing on sqlite. And locally, I don't seem to be able to run tests with sqlite anymore. Looks like some investigation is in order.

quietone’s picture

What I didn't realize is that the test was running with sqlite, it was just taking a very long time. It takes 50 minutes (!) to run Upgrade6Test.php but it fails when asserting that the upgrade succeeded which happens before the point where the test fails on the testbot.

Not sure what to try next.

  • catch committed bfeff83 on 10.1.x
    Revert "Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje...
catch’s picture

Status: Needs review » Needs work

This is failing on sqlite on 10.0.x and 10.1.x too, reverted from those branches as well.

  • catch committed 85191d0 on 10.0.x
    Revert "Issue #3082211 by quietone, Pooja Ganjage, danflanagan8, Spokje...
quietone’s picture

Issue summary: View changes

Update remaining tasks

Adding a test with sqlite to #78, to show the error.

quietone’s picture

Status: Needs work » Needs review
FileSize
7.48 KB

Let's see if I can get testbot to output something useful.

Status: Needs review » Needs work

The last submitted patch, 95: 3082211-95-fail.patch, failed testing. View results

quietone’s picture

That doe show the differences in the output for mysql and sqlite.

1) The order of error messages for the d6_term_node_translation migration vary. For mysql it is source id 2001, 2001, 3, 2001. For sqlite it is source id 2001, 3, 2001, 2001.

2) For sqlite there is an extra entry at the end,

    36 => stdClass Object &000000000000891a0000000000000000 (
        'message' => 'Source ID field_test_text_single_checkbox: Widget types optionwidgets_onoff, text_textfield are used in Drupal 6 field instances: widget type optionwidgets_onoff applied to the Drupal 8 base field'

This message is listed earlier in the watchdog log with both mysql and sqlite. The message is from the d6 Field source plugin which is used in migration d6_field.yml, so it makes sense for it appear early in the log. But for some reason, with sqlite that source plugin is running again later in the upgrade. The d6_field source plugin is used in the d6_field migration and the d6_field_option_translation migration.

Now, I just need to figure how to use that to make a fix. Hmm....

Edit: s/node complete/d6_node_term_node_translation/

quietone’s picture

Status: Needs work » Needs review
FileSize
8.29 KB

The process plugin, NodeCompleteNodeTranslationLookup, will return the nid and langcode when the language is NULL. The patch changes the to return NULL when the langcode is NULL.

Status: Needs review » Needs work

The last submitted patch, 98: 3082211-98.patch, failed testing. View results

quietone’s picture

I didn't remove the test code.

This patch added the possible fix to NodeCompleteNodeTranslationLookup. The interdiff is against the patch that got committed.

Status: Needs review » Needs work

The last submitted patch, 100: 3082211-100.patch, failed testing. View results

quietone’s picture

Version: 10.0.x-dev » 11.x-dev
Status: Needs work » Needs review
FileSize
3.78 KB
6.12 KB

Just updating the patch.

quietone’s picture

sonam_sharma made their first commit to this issue’s fork.

quietone’s picture

@sonam_sharma, credit has been removed per How is credit granted for Drupal core issues

quietone’s picture

Title: Migrate UI tests should provide the complete log message on failure » Migrate UI upgrade tests should provide the complete log
FileSize
995 bytes
4.79 KB

This patch removes the changes to drupalci and to core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeTranslationLookup.php. The latter should be in a separate issue.

Status: Needs review » Needs work

The last submitted patch, 106: 3082211-106.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
3.87 KB

Back to needs review.

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Want to request an uncheck all button. Since the fix has moved to MR5272 hiding the patches for clarity.

Rebased MR5272 to run test-only feature

1) Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::testUpgradeAndIncremental
Error: Call to undefined method Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::outputLogs()
/builds/issue/drupal-3082211/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php:211
/builds/issue/drupal-3082211/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
ERRORS!
Tests: 1, Assertions: 4364, Errors: 1.
Unsilenced deprecation notices (3)
  1x: Creation of dynamic property Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::$outputLogs is deprecated
    1x in Upgrade6Test::testUpgradeAndIncremental from Drupal\Tests\migrate_drupal_ui\Functional\d6
  1x: Creation of dynamic property Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::$migratedAdminUserName is deprecated
    1x in Upgrade6Test::testUpgradeAndIncremental from Drupal\Tests\migrate_drupal_ui\Functional\d6
  1x: Creation of dynamic property Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test::$expectedLoggedErrors is deprecated
    1x in Upgrade6Test::testUpgradeAndIncremental from Drupal\Tests\migrate_drupal_ui\Functional\d6
Uploading artifacts for failed job

The change itself seems simple enough.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Added some questions to the MR.

quietone’s picture

Status: Needs work » Needs review

I've answered the queries and adjusted the error message count.

smustgrave’s picture

Left some small nitpicky stuff, leaving in review for additional eyes.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems nitpicky stuff was addressed. Since this was close before believe it's fine to mark now.

longwave’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs rebasing against 11.x, there are lots of unrelated changes in the MR.

quietone’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll

@longwave, sorry about that. I don't know how that happened, but it is fixed now. I am restoring RTBC because there were no conflicts when rebasing.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Confirmed via GitLab CI that the tests pass on SQLite now. However, decided not to backport as this is a minimal improvement and seems slightly fragile given the hardcoded log counts.

Committed a904645 and pushed to 11.x. Thanks!

  • longwave committed a9046450 on 11.x
    Issue #3082211 by quietone, Pooja Ganjage, smustgrave, danflanagan8,...

Status: Fixed » Closed (fixed)

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