Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Tests are failing in both the 8.x-1.x-dev and the rc1 versions with the following error:
Behat\Mink\Exception\ResponseTextException : The text "First" was not found anywhere in the text of the current page.
in state_machine/tests/src/Functional/StateTransitionFormTest.php:56
This happens because the views.view.state_machine_test.yml
is not imported and the
$this->drupalGet('/state-machine-test');
returns a page not found.
I see two other patches fail due to this issue.
Comment | File | Size | Author |
---|---|---|---|
#5 | broken_test-3058938-D8-5.patch | 844 bytes | idimopoulos |
|
Comments
Comment #2
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedComment #3
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedI do not know how the test was merged in https://www.drupal.org/project/state_machine/issues/3012285 since the source of the issue seems to be due to core since 8.0.
The failing test derives from the fact that the view itself is not imported but it does not throw any errors. Digging a bit more on what happens when a module is installed, it seems the process ends up in
\Drupal\Core\Config\ConfigInstaller::createConfiguration
where it loads the appropriate Entity class from the configuration file and attempts to create and store an entity with the given values.That leads to line 363 of that file where it is checked if the entity is installable (
if ($entity->isInstallable()) {
).For a view entity, the
\Drupal\views\Entity\View::isInstallable
is gathering the views data from all entities and checks if the base table declared in the view exists.So the main problem is the main table. For the
StateTransitionFormTest
, theEntityTestWithBundle
test content entity is used.This entity, in its definition PHPDocBlock has the following:
The
translatable
here is very important as, during the construction of the views data, there is a distinction between thebase_table
anddata_table
.In
\Drupal\views\EntityViewsData::getViewsData
, the following check is performedwhich overrides the base table with the data table, which means that the base table for the views is not
entity_test_with_bundle
butentity_test_with_bundle_field_data
.The same applies for all base properties in the view. So the label requested should be
(the table of the property should also point on the data table).
This also is consistent with the rest of the translatable entities, like node, where I exported a single view and it contains
I am attaching a patch to fix the views and allow the tests to be green again as the patches fail all over. Again, How was this merged if it was not tested? Accident?
Comment #4
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedComment #5
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commentedSorry, empty patch provided before. I accidentally created it without committing the changes so it was blank. Providing the correct patch now.
Comment #6
alonaoneill CreditAttribution: alonaoneill at Hook 42 commentedPatch applied!
Not sure what was wrong before.
Comment #7
Neograph734EntityTestWithBundle was changed 2 months ago in https://git.drupalcode.org/project/drupal/commit/46424a8
Comment #8
jungleConfirm that tests passed on my local
Comment #10
bojanz CreditAttribution: bojanz at Centarro commentedCommitted, thanks!