Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Problem/Motivation
In order to move the RDF module from Core to Contrib, we need to move all RDF-module related tests to the RDF directory/namespace.
Steps to reproduce
Proposed resolution
Remaining tasks
Investigate EntityViewControllerTest, see #6
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3293813
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:
- 3293813-move-rdf-related-tests changes, plain diff MR !2462
Comments
Comment #2
spokjeComment #3
spokjeWork in Progress ATM.
Comment #5
quietone CreditAttribution: quietone at PreviousNext commentedApplied the MR. I ran the failing test locally and it passed. Then I searched for rdf in tests while specifically ignoring migration related tests.
What about these tests? Is there anything to move?
Comment #6
longwaveRe #5
I think the 3 HAL test can be deleted when we remove RDF module. It seems super unlikely anyone is ever reading RDF mappings via HAL, given that both those modules are on their way out of core.
NoJavaScriptAnonymousTest refers to all modules in standard so that should be dealt with in #3243121: Remove RDF module from the Standard profile
EntityViewControllerTest has a small test method that probably needs porting to the RDF module.
UpdatePathTestBaseFilledTest tests the upgrade path from 9.3.0 so references to RDF will be removed there when we remove the module itself.
ConfirmClassyCopiesTest needs to stay while
rdf-metadata.html.twig
remains in the core themes.To summarize I think only EntityViewControllerTest needs investigation here.
Comment #7
quietone CreditAttribution: quietone at PreviousNext commentedComment #8
spokjeComment #9
quietone CreditAttribution: quietone at PreviousNext commentedAdd remaining task to IS.
Comment #10
quietone CreditAttribution: quietone at PreviousNext commentedI have looked at EntityViewControllerTest and I don't know how to modify it so test coverage is kept and RDF is removed.
Anyone? I'll have a go if someone points the way.\
Comment #11
catchThe code in RDF that's being relied on is this (I think):
So what we'd need is a test module that sets $item->_attributes to something, and change the assertions to look for that instead.
Comment #12
quietone CreditAttribution: quietone at PreviousNext commented@catch, thanks!
I made a new test module and used the same hook to add the same attribute.
Comment #13
longwaveLooking at EntityViewControllerTest again, I would argue that this piece of functionality is no longer worth testing.
EntityViewBuilder sets:
entity_test.module appends to this array:
entity_view_controller_test also appends to this array:
So really all we are doing is checking that PHP can correctly merge arrays. When RDF was involved I guess it was important to ensure that RDF didn't accidentally overwrite existing attributes, but there is nothing to stop a module overwriting
$item->_attributes
instead of merging, so the test proves nothing to me.Comment #14
longwaveOtherwise the changes look fine to me. NW for #13 (or just to update the .info.yml if you disagree with #13).
Comment #15
longwaveFound via #3267703: Deprecate RDF module I think JsonApiRegressionTest::testLeakedCacheMetadataViaRdfFromIssue3053827() also needs moving to RDF module as an edge case in JSON API.
Comment #16
spokje@longwave: That is already in the MR and moved to the RDF module/namespace?
https://git.drupalcode.org/project/drupal/-/blob/c35932f73069b437e1995e4...
Comment #17
longwaveSorry, I am blind, don't know how I didn't see that :)
Addressed #13 by removing the test.
Comment #18
longwaveIn fact we can keep the spirit of the original tests by ensuring that the entity_test module adds two attributes, and then testing for both of them.
Comment #19
longwaveUnsure if we should decouple migrate_drupal_ui from RDF in here or in #3267703: Deprecate RDF module, the latter forces us because the tests fail with a deprecation error.
Comment #20
spokjeIn previous deprecation/removal "adventures" we had a separate issue for "Move migrate related [insert_module_name] tests to the module in preparation of removal in d10". (See for example #3265424: Move migrate related aggregator tests to the module in preparation of removal in d10) where this was done.
For RDF, this happened already in #3267513: Handle migration tests for removing RDF, but we re-added it again in #3243121: Remove RDF module from the Standard profile.
So it seems we worked a bit backwards there and we can/should remove
'rdf'
from all theprotected static $modules
arrays in migrate_drupal_ui.Note: I'm not telling this to educate @longwave, he almost certainly got to the above long before I did. Just wanted to document it for my sanity.
Comment #21
quietone CreditAttribution: quietone at PreviousNext commentedIn general, I think it is best to have changes to migration tests in a separate issue so that only those changes are considered. Experience is showing that is difficult and we have made some mistakes. However, in this particular case lets update the migrate_drupal_ui tests here and not muddle up the deprecation issue. I have moved the changes to migrate_drupal_ui from #3267703: Deprecate RDF module to here.
Comment #22
catchAgreed with @quietone in #21 those migrate_drupal_ui changes look fine to include here since it's a pretty trivial change (unlike many others).
Comment #23
nod_Looks like it's all there. Just a nitpick on a comment. Issue with EntityViewControllerTest has been resolved as far as I can see, removing from IS.
I don't feel too confident about knowing the ins and outs of the problem space but from what I can see patch does what the issue summary says it should do, so RTBC :)
Comment #24
longwaveRemoved out of scope comment changes in the data provider, fixed two uses of ableist language in entity_test - while only one is technically in scope if we are going to fix one I think we should fix the other at the same time.
Comment #25
xjmComment #26
longwaveComment #27
bbralaWent through the changes, searched for 'rdf' to see any missing places where the module is enabled. Ran RDF tests on the MR locally and they are green. I'd say, RTBC ^^
Comment #32
xjmCommitted to 10.1.x, 10.0.x, 9.5.x, and 9.4.x as a patch-eligible test cleanup. Thanks!
Comment #34
xjmI think this may have introduced a fail on 9.4, so reverting there.
Comment #36
adamps CreditAttribution: adamps at AlbanyWeb commentedThis issue seems to have removed a lot of important testing from Drupal Core: NodeDisplayConfigurableTest, node_display_configurable_test.info
This testing (that I spent quite a while writing) is/was an important part of the initiative #2353867: [META] Expose Title and other base fields in Manage Display. I have raised #3342700: Reinstate important testing NodeDisplayConfigurableTest. I hope that the authors of this issue might be willing to undo this accidental loss from their actions.