Problem/Motivation

When any update path test fails we just check for TRUE/FALSE whether we need some additional updates. This doesn't help people to figure out for example which updates didn't got executed in the test.

Proposed resolution

Do something along

+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -265,7 +265,15 @@ protected function runUpdates() {
-    $this->assertFalse(\Drupal::service('entity.definition_update_manager')->needsUpdates(), 'After all updates ran, entity schema is up to date.');
+    $needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates();
+    $this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
+    if ($needs_updates) {
+      foreach (\Drupal::entityDefinitionUpdateManager()->getChangeSummary() as $entity_type_id => $summary) {
+        foreach ($summary as $message) {
+          $this->fail($message);
+        }
+      }
+    }

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner created an issue. See original summary.

pashupathi nath gajawada’s picture

Status: Active » Needs review
FileSize
1006 bytes

Hi @dawehner,

As proposed I have Impriovised the debuggability of the UpdatePathTestBase.
Please find the attached patch.

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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.

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

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

jhedstrom’s picture

Status: Needs review » Needs work

This went in along with #2308745: Remove rest.settings.yml, use rest_resource config entities, so closing as a duplicate.

However, now that this base class is phpunit-based, any code after a failed assertion is not executed, so we are back to it just displaying

After all updates ran, entity schema is up to date.

with no further details.

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
1.13 KB

Version: 8.5.x-dev » 8.6.x-dev

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

jhedstrom’s picture

jhedstrom’s picture

Component: simpletest.module » phpunit
jhedstrom’s picture

Honestly though, this sort of message isn't too much more helpful in terms of determining what actually needs to be updated:

The node.field_test_3 field needs to be updated.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Re #11, at least it quickly shows you what needs to be investigated/debugged further. The current code in HEAD forces you to debug the whole update process and extract the relevant problem (e.g. which field needs to be updated) manually.

So #7 is already a nice improvement, IMO :)

catch’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!

  • catch committed 420400c on 8.6.x
    Issue #2747789 by jhedstrom, pashupathi nath gajawada: Improve...

  • catch committed 79357bf on 8.5.x
    Issue #2747789 by jhedstrom, pashupathi nath gajawada: Improve...

Status: Fixed » Closed (fixed)

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