Problem/Motivation
Once Simpletest module is available in contrib, we can deprecate it in core. However if we just remove Simpletest from the code base in 9.x sites, it could break sites that have simpletest enabled for whatever reason.
Proposed resolution
In Drupal 9, have an update requirement to ensure the core simpletest module is not installed.
In Drupal 8, have a hook_requirements() runtime/install to notify users that the simpletest module is deprecated and they should uninstall / use the contrib version.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
The SimpleTest module (labeled Testing in the Drupal core user interface) has been deprecated in Drupal core. Developers are encouraged to run tests via run-tests.sh or the PHPUnit CLI, or to use the SimpleTest contributed module in Drupal 9.
Note that the final decision to deprecate SimpleTest still has some dependencies on the in-progress Drupal 9 issue so exact details of the deprecation may be revised.
| Comment | File | Size | Author |
|---|---|---|---|
| #54 | interdiff-51-54.txt | 1.06 KB | tedbow |
| #54 | 3084493-54.patch | 2.01 KB | tedbow |
| #52 | 3084493-52.patch | 2.02 KB | tedbow |
| #52 | interdiff-46-51.txt | 1016 bytes | tedbow |
| #49 | 3084493.46_49.interdiff.txt | 886 bytes | dww |
Comments
Comment #2
mile23Given the IS, this is postponed on #3075490: Move simpletest module to contrib
Comment #3
mile23Comment #4
catchComment #5
catchThought about this some more and new proposal in the issue summary, this can probably have a patch on it for the 8.x part before there's a contrib module, although we'd need the contrib module to actually commit it, but unpostponing.
Comment #6
xjmComment #7
mile23This is two patches. One is for 8.8.x, and one is for 9.x.
The 9.x patch starts with @lendude’s patch from #3075490-38: Move simpletest module to contrib, and then adds hook_requirements().
The 8.8.x patch only adds hook_requirements() to the existing module with some explanation.
Todo: Figure out the language, add CR, link to it from hook_requirements().
Comment #8
mile23Comment #11
lendudeUpdated the text a bit, and we need to uninstall the simpletest module before running updates in update tests or they will be blocked.
Comment #13
lendudeThis should clear up some fails.
Comment #15
lendudeSo we need to rebuild the container inside the test after uninstalling stuff.
Comment #16
lendudeAdded a CR, https://www.drupal.org/node/3091784, so now we just need to point to that in the requirements message.
Comment #17
lendudeAdded the ref to the CR.
Comment #18
catchNow that we have a 9.x-compatible simpletest module in contrib, this is unblocked.
Comment #19
xjmJust grammar fixes.
Comment #20
mile23Issue is targeted at 8.8.x, but the last patch ran against 8.9.x.
The patch applies to both, and to 9.0.x. I'm pretty sure the D9 part of this issue will require a different patch to remove everything but the hook_requirements() part. That should maybe be a follow-up since its such a different scope?
Adding an 8.8.x test to #19.
Comment #21
xjmI think #3075490: Move simpletest module to contrib covers the scope for the 9.0.x-only patch. This would be committed first prior to the 8.8 beta; that other can be done any time prior to the 9.0 beta.
Comment #22
dwwThanks to everyone working on this, and especially to those willing to maintain simpletest in contrib!
Patch mostly looks good. A few concerns:
A)
Shall we link directly to the project page, too? Or we're intentionally only linking to the CR here?
B) Shouldn't we have some kind of official release for 8.x at https://www.drupal.org/project/simpletest before we do this? Right now, all that's available is 8.x-3.x-dev.
C) (Partially contradicting myself from point A): The simpletest project page could use some help:
D) The CR is a bit confusing / incomplete:
Can we get clear instructions on how to do this? When can I install/enable the contrib version? Since they have the same name, wouldn't installing the contrib module also break updates? Which update(s) are broken/prevented? When/how is it safe to actually re-install the contrib version? etc.
Thanks again,
-Derek
Comment #23
catch@dww
#22.A:
I think we should link to the change notice, there's a remote possibility that someone will create a new UI test runner or similar, and we can easily update the change record to say that but not the simpletest project node. Also in the change record we should probably direct people to simplytest.me, the phpunit cli runner and other alternatives.
#22.B:
For API deprecations I think we need a stable release in contrib, but the API deprecations for Simpletest have already happened with replacements in core, all that's left is a UI development tool which should never be installed on a production site, so in this case a dev release seems fine.
#22.D: the contrib version is only really needed in Drupal 9, the main thing with updates is that it shouldn't be installed on a site running updates anyway - can still be uninstalled/reinstalled.
Comment #24
catchHere's an updated patch which makes the deprecation message slightly more broad.
Edit: updated the change record
Comment #25
dwwRe: #23:
Re: #22.A: Yup, a level of indirection is often a good thing. ;)
Re: #22B: Hrm, okay, fair enough. But I'd still feel better with *something*, but if it's just the UI test runner, yeah, cool. But I thought it also held the deprecated test base class (I forget what it's called) and some folks might still have a bunch of tests that they can't sink the time/$ into updating. I'm sure they'd appreciate at least an 8.x-3.0-alpha1 or something to target...
Re: #22D: Okay. When it's not 4am (and if no one beats me to it) I'll update the CR with that.
Re: #24: Generally agree with the generalizations. But we lost "You will need to uninstall the module before continuing." which seems like really important, concrete info that needs to be said in the status warning. Can we split the difference?
t('The Drupal core Simpletest module is deprecated for removal in Drupal 9. It should not be enabled on production sites. You will need to uninstall the module before continuing. See https://www.drupal.org/node/3091784 for alternatives.')?
Thanks,
-Derek
Comment #26
catchI went for 'You will need to uninstall the module before updating' - because technically what we want them to do is to restore their old code base, uninstall there, then come back and run the updates.
So it does, but the issue that actually removes simpletest and all the bc layers from core is #3075490: Move simpletest module to contrib. That's the issue that affects developers, this issue affects people using the UI test runner. Even if we were to leave the UI test runner in core, the test classes are still deprecated already and since some time ago, and they're mostly run via run-tests.sh on DrupalCI at the moment.
We might want a tagged contrib release before the actual removal issue lands in 9.0.x for that reason, but I don't think it's an issue for this one which is just informing people of the plan.
Comment #27
alexpottAll the hooks provided by the module are already deprecated and use
\Drupal::moduleHandler()->invokeAllDeprecated()so any contrib module leveraging them is already getting deprecations.There's also the
simpletest/drupal.simpletestlibrary that we could deprecate. However I think that depending on the module and using the library is a very limited use-case. There are the routes too but I don't think anything will be depending on them.One thing I've noticed is that this change prevents updating from 8.7.whatever to 8.8.0 (if this patch is applied). I think we should probably take a leaf out of the block_place module's deprecation patch and only run the deprecation requirement at runtime and perhaps consider changing it to a notice as well.
Comment #28
catchDiscussed briefly with @alexpott - let's make it a warning only during runtime, notice elsewhere. This means sites can update without special steps, and we don't need the test change.
Comment #30
catchs/REQUIREMENT_NOTICE/REQUIREMENT_INFO/
Comment #32
catchHEAD was broken.
Comment #33
amateescu commentedLooks great to me.
Comment #34
dww#28 and #30 lost the "fix" from #26. Seems accidental, not intentional.
Otherwise, agreed on all points.
Thanks!
-Derek
Comment #35
dwwSince we want to see a clean bot run, anyway, this restores #26 on top of #30
Comment #36
amateescu commentedThanks eagle-eyed @dww, I guess it's fine to get it back to RTBC now :)
Comment #37
dwwSorry, sleep deprivation. ;) I now understand -- we no longer prevent you from running updates. Duh.
#30 is RTBC after all. Thanks/sorry!
-Derek
p.s. I canceled the test run for #35 on 8.9.x, but there seems to be no way to cancel https://www.drupal.org/pift-ci-job/1465930 since it's still queuing. That'd be really nice to allow...
Comment #38
catch@dww no it didn't lose it, because #30 makes uninstalling before update unnecessary now the warning is only 'info' instead of warning. Re-uploading #30 for clarity.
(edit, cross post, but yes).
Comment #39
dwwYup, thanks! Slowly waking up... :)
Re-hiding my patch + interdiff.
edit: and finally was able to cancel the testbot runs against #35
Comment #40
catchSo #3075490: Move simpletest module to contrib is tagged for product manager review because it removes the developer feature of running tests via the UI, however this is as much the 'decision' issue as that one is, so adding the tag here.
However both webchick and Gabor are off this week, meaning actually getting official on-issue sign off is impossible (although Dries has indicated by e-mail he's in favour of moving to contrib in principle).
Since the best time to get this in is before the 8.8.0-beta, I think we're better off doing that and sorting out product manager review before #3075490: Move simpletest module to contrib lands. If there's some blocker to #3075490: Move simpletest module to contrib landing (whether not actually getting product sign-off or some unforseen technical issue) we'd need to revert or extend to Drupal 10 the deprecation added here, but that is less disruptive than adding it into Drupal 8.9 or an 8.8 rc or patch release.
Comment #41
catchComment #42
xjmI agree with #40. I've added the same note from the end of the CR to the release note for now. We can remove it if/when product management does sign off on the main issue.
So the name of the module in the user interface is actually "Testing". A less looped-in site owner might see "Simpletest" and have no idea what they need to do to resolve the warning.
Also, I don't think the message should make it sound as though there are alternatives for production sites?
Comment #43
xjmWe can say "The Testing module (SimpleTest)" or such. (Note casing on "SimpleTest".)
Comment #44
xjmComment #45
catchWhat about 'Testing (SimpleTest)' and '.... alternatives for running tests during development' ?
Comment #46
tedbowHere is updated working as per #42
and #43 and #45
Comment #47
dwwHere's a patch for this:
Does that address all concerns?
Do we want "SimpleTest" in a placeholder so it can't be translated? Or is this better?
Thanks,
-Derek
edit: eeek, x-post. Oh well, I guess committers can pick which wording they prefer. ;)
p.s. I was trying to avoid double "for" -- "for alternatives for running..." which is why I went with "for alternative ways to run..."
Comment #48
xjm#47 repeats "SimpleTest" twice, so let's use #46. @dww, want to RTBC it?
Comment #49
dwwSorry folks, 4 hours of sleep. I should probably not do *anything* for Drupal today. :/
This fixes the double trouble.
RTBC. Committer discretion for this or #46. I think this is (slightly) better, but I don't trust myself at all right now. ;)
Thanks/sorry,
-Derek
Comment #50
dww(slightly better title for the commit message)
Comment #51
xjmSo there's another problem that I was crossposting: The URL is just stuck in the string as plain text. It won't even be clickable because input filters don't run on translated strings. Even if it were clickable, it's not good accessibility to have a link text be a URL, rather than words meaningful out of context. I'd suggest:
Explicitly assigning to Ted for less crossposts. ;)
Comment #52
tedbow🤞
Comment #53
dww1. I prefer @xjm's:
Read <a href="https://www.drupal.org/node/3091784">The Drupal core SimpleTest module is deprecated</a>vs.
See <a href="https://www.drupal.org/node/3091784">the change record about the Testing module\'s deprecation</a>2. I still prefer:
"... for alternative ways to run"
vs.
"...for alternatives for running"
I don't want to hold up progress, but I don't want to call #52 RTBC, either. :/
Sorry,
-Derek
Comment #54
tedbowwords are hard
🤞🤞🤞🤞🤞🤞🤞🤞🤞🤞
Comment #55
dwwLooks great, thanks!
Meanwhile, updated the CR again now that the dust is settling in here:
https://www.drupal.org/node/3091784/revisions/view/11637799/11638010
Cheers,
-Derek
Comment #59
xjmThanks @tedbow and @dww! I committed this without waiting for the final test run, since the same thing with slightly different words passed already, the clock is ticking on the beta release window, we're in a commit freeze anyway, and HEAD tests will prove that this passes.
Marking fixed; we'll reopen or file a followup if the product management decision in #3075490: Move simpletest module to contrib is different from what this issue expects. I'll also publish the CR.
Comment #60
dwwYay, thanks!
@xjm: Re: "I'll also publish the CR." I already did. ;)
-Derek
Comment #61
lendudeNice! Awesome job all!