Problem/Motivation
I am seeing all sorts of functional test issues in my project after upgrading from 9.2.11 to 9.3. I have a few custom modules that add some view configs and also some role configs. The tests are pretty basic...create a few nodes, then visit a view page and make sure the nodes are all displaying. However, all the tests are now failing, and the html output shows a 'page not found' error when visiting the view page. 9.2.11 these tests all work, 9.3.0 they do not. I noticed each one of these custom modules each provide a custom role that I created. If I remove these role configs from the module /config/install
directories, all the tests start to pass. Why would the existence of these role configs cause these unit tests to fail? In my test if I log in as an admin and check the /admin/structure/views
page, I can see that my view is there after viewing the html output. So why would a simple $this->drupalGet('view-page-url-here');
show a 404 when a role config is present?
Steps to reproduce
1. Create a basic custom module.
2. Through the UI, create a view page. Make the view do something simple (for instance, display the node title of all published nodes).
3. Export this view and put it in /config/install
of the custom module.
4. Create a functional test that adds some page nodes using $this->drupalCreateNode()
. Make sure the node titles are all appearing (or even just make sure the view page exists doing something like $this->drupalGet('view-page-url-here')
then a $this->assertSession()->statusCodeEquals(200);
.
5. Run the test. It should pass.
6. Now, through the UI, add a custom role.
7. Export the role config and put it in /config/install
of that custom module.
8. Run the functional test again. The test will fail, and if you inspect the html output, you can see the view page does not exist (shows a 404).
9. Remove the role config from /config/install
and run the test again. It will pass.
The role doesn't need to have any permissions set or anything. Just the existence of this role config in /config/install
seems to break functional tests that involve going to a view page. I tried adding a test role in /config/install
for some of my custom modules that do not supply a view page, and those tests still pass.
Any ideas on what could be happening here?