Problem/Motivation
In the process of working on #1806334: Replace the node listing at /node with a view, we're discovering that a lot of automated tests make all kinds of assumptions about the default frontpage listing, including that node
will always be available (despite that the node module is not required), that the front page will always be node
(despite that it's configurable) and that the page is formatted in a certain way (causing problems along the lines of those that blocked #823380: Read More link is always visible on teaser. forever). This is bad for DX, slows down tests, and makes it really difficult to swap out Drupal's default front page.
See background in issues:
- #1373142: Use the Testing profile. Speed up testbot by 50%
- #1541298: Remove Node module dependency from Testing profile (closed in favor of #1768758: Change default profile for tests from Testing to Minimal, but still relevant).
Proposed resolution
- Decouple tests from the
node
module (and specifically the front page listing) where appropriate. - Change tests on a case-by-case basis, because each change should probably be reviewed separately, we don't want to accidentally remove coverage, and smaller changes will be less disruptive (plus easier to merge in for #1806334: Replace the node listing at /node with a view).
- In some cases, if all that is needed is a valid response, the new
test_page_test
module can be added as a dependency, and thetest-page
path can be substituted (either in a direct request, or configured as the front page). - In other cases, the node module can be added as an explicit dependency when the node listing is actually being used for more than just a test request.
- Some of the tests will need more involved solutions.
Issues
- #1811020: Decouple BlockTest from the node module
- #1811068: MenuNodeTest improperly uses the node front page when checking for menu links.
- #1811572: menu_test_menu() relies on the node listing callback
- #1811622: Remove assumption about front page title from NodeCreationTest
- #1811632: Remove dependency on the standard profile from DBLogTest
- #1811648: Remove SimpleTestTest dependency on the node frontpage
- #1811662: Remove node frontpage dependency from HttpRequestTest
- #1811804: Provide a test page testing module
- #1847506: ToolbarHookToolbarTest has invalid preceding slash in path (and other cleanups)
- #1847540: [META] Clean up comment module tests and decouple from node
- #1848202: Decouple OpenID tests from node
Comments
Comment #1
Lars Toomre CreditAttribution: Lars Toomre commentedNote that #1797200-6: Remove t() from assertion messages in node.module tests which completes the removal of t() from Node test assert messages is still awaiting review. I am not sure what Node Tests may be moved around here to other modules, but please check t() wrapping of test assert messages for anything that gets moved. Thanks.
Comment #2
xjmThis is me you're talking to. ;)
Comment #2.0
xjmUpdated issue summary.
Comment #3
Lars Toomre CreditAttribution: Lars Toomre commented*smiles* I know that @xjm. However, you created this as a meta issue so there could well be someone else decides to move a existing test to say the User module. Hence, I added my comment. Keep up your great work!
Comment #4
sunComment #4.0
sunUpdated issue summary.
Comment #4.1
xjmUpdated issue summary.
Comment #4.2
xjmUpdated issue summary.
Comment #4.3
xjmUpdated issue summary.
Comment #4.4
xjm.
Comment #4.5
xjm.
Comment #4.6
xjmUpdated issue summary.
Comment #4.7
xjmUpdated issue summary.
Comment #4.8
xjmUpdated issue summary.
Comment #4.9
xjmUpdated issue summary.
Comment #4.10
xjmUpdated issue summary.
Comment #5
xjmSo everything in this other than #1541298: Remove Node module dependency from Testing profile and #1847540: [META] Clean up comment module tests and decouple from node is long since fixed -- retroactively marking this fixed as well.