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.
Problem
- SimpleTest module was originally based on a very early version of the SimpleTest framework, but vastly diverged, even from its 1.0 release code.
- Today's SimpleTest module code has nothing in common with the SimpleTest library, except for some class method names.
Goal
- Prevent user/developer confusion.
- Avoid name/licensing problems.
Details
- The name was originally kept as an attempt to ensure that we are not diverging from the library.
- SimpleTest was introduced very early, when it was immature on its own. It was also changed and adapted to work within Drupal. These two points caused the diversion.
- Users/developers familiar with the SimpleTest library have to re-learn Drupal tests.
- Today, SimpleTest would be the wrong library to standardize on in the first place. There are much better testing frameworks for PHP5.
- "SimpleTest" is just the module name and namespace to integrate the testing framework into Drupal.
- Changing the name to test.module does not imply any desire to retain a custom testing framework or to diverge from a testing framework.
- Originally discussed in DC Paris 2009.
Proposed solution
- DONE: #33: Rename "SimpleTest" into "Testing" in the UI. (D7)
- Rename simpletest.module into test.module.
On test vs. testing:
- test.module leads to a PHP namespace of "test", and the test classes will be
Drupal\test\WebTest
; see
#1541676: Convert Simpletest base test classes to PSR-0 - The UI can happily use "Testing" module.
- test.module leads to a PHP namespace of "test", and the test classes will be
Comment | File | Size | Author |
---|---|---|---|
#46 | drupal8.test-module.46.patch | 118.46 KB | sun |
#44 | drupal8.test-module.44.patch | 101.71 KB | sun |
#33 | drupal-testing.patch | 1.34 KB | sun |
#25 | renaming_to_testing_00000000000174.patch | 169.65 KB | catch |
#18 | renaming_to_testing_00000000000174.patch | 169.64 KB | cwgordon7 |
Comments
Comment #1
cwgordon7 CreditAttribution: cwgordon7 commentedComment #2
boombatower CreditAttribution: boombatower commentedThis probably requires a bit of discussion since webchick has pointed out several times that it would be good to keep the framework similar to SimpleTest so that people can transfer there skills from SimpleTest -> Drupal Testing and back. Having it named accordingly would be helpful to that end.
Another concern is that testing is a verb and the module names are nouns.
Comment #3
cwgordon7 CreditAttribution: cwgordon7 commentedTesting can also be used as a noun.
Comment #4
boombatower CreditAttribution: boombatower commentedCan we get a consensus on this so we can close this issue?
My vote: opposed
Comment #5
cwgordon7 CreditAttribution: cwgordon7 commentedMy vote: in support
This is no longer simpletest, really. This is Drupal testing. To call it simpletest is misleading because it is no longer compatible with the simpletest library.
I'm not sure 'testing' is the right name, though. Maybe 'test' or something else might be better— thoughts?
Comment #6
boombatower CreditAttribution: boombatower commentedI still think the point webchick brought up and I wrote in comment #2 stands.
Comment #7
webchickIt's my opinion that any and all moves we make that make our testing framework less like SimpleTest are moves in the wrong direction. SimpleTest is widely used, with copious numbers of tutorials, API docs, and so on that we as a community don't have to re-write. People coming from other projects where they've used SimpleTest should be able to jump write into writing tests for Drupal with as little learning curve as possible. Similarly, those who have written tests for Drupal should be able to transfer that knowledge to using SimpleTest on other projects.
So I oppose this change because I oppose the basic idea of stripping out all the SimpleTest-ness of SimpleTest and replacing it with some custom testing framework that people have to re-learn. I would much rather make our testing framework be *more* like SimpleTest, not less. And if we don't like something about the way SimpleTest is? It's open source. Let's work with them to improve it.
Comment #8
cwgordon7 CreditAttribution: cwgordon7 commentedI agree; however our goals and their goals don't always align. I think we have provided them with some of our patches, which they have rejected; ultimately no matter what we try to do, there will always be slight differences in our goals, which equate to at the very least slight differences in the code, and possibly the API; as a result, calling it simpletest would especially be misleading to the target audience you suggest (existing simpletest developers) as the slight differences could easily throw them off track.
Comment #9
webchickAnd my response to *that* is that I'd need a very good and strong reason why we shouldn't revert the "hacks" we made to stock SimpleTest library, if they won't accept them. They're more familiar with their library than we are, with far more developers using their product than just us. What is their justification, and can we build that different logic into drupal_web_test_case.php instead?
Comment #10
cwgordon7 CreditAttribution: cwgordon7 commentedAnd my response to that is that, well, our interests conflict. We want lightweight code, even if it is not necessarily php 4 compatible, etc, whereas they care about php 4 compatibility. Why even bother to continue using their library if we override half their functions in drupal_web_test_case.php anyway?
Comment #11
webchickAnd my response to *that* (this is fun! :D) is that I care far less about lightweight code than I do about low barrier to entry for developers and the Drupal project NOT having to divert our own resources towards maintaining our own custom testing framework that we're also responsible for bug-fixing, since we're the only ones who use it, and pulling in patches from upstream that fix security issues or add additional API features that people are going to expect us to have, and... I'd love to see the folks from the testing sprint spend their considerable talents helping improve Drupal's *test coverage*, and doing education around that, than wasting effort solving problems that SimpleTest already solved, just in a more "Drupal" way, thus locking us into yet more code to maintain without help from the entire SimpleTest development community.
It's the same reason we use jquery.js (5.x+) and not drupal.js (4.7.x) as our JS framework. Let people dedicated to it worry about how to make a good framework, let us just use it.
Comment #12
boombatower CreditAttribution: boombatower commentedShall we mark this one closed? Or is it still open for debate?
Comment #13
Dries CreditAttribution: Dries commentedI think it is still open for debate.
Comment #14
cwgordon7 CreditAttribution: cwgordon7 commentedOk, I've finally thought of a response to #11. ;)
SimpleTest is CamelCased. Module names in Drupal should not be camelCased. So at the very least, the Drupal backend module should be renamed to Testing? Then we are only changing Drupal code, not SimpleTest code.
Comment #15
webchickHow about this? We rename it testing after http://drupal.org/project/issues?projects=3060&components=tests&states=1... shows no core test failures. :P~~~
Comment #16
webchick;)
Comment #17
boombatower CreditAttribution: boombatower commentedThe module names as they are written are independent of actual directory name. Lots of modules differ in the way they are written in text vs. directory name.
I'm still not convinced. :)
Comment #18
cwgordon7 CreditAttribution: cwgordon7 commentedOk, going ahead with this now based on general consensus.
Comment #19
boombatower CreditAttribution: boombatower commentedLets just make sure the result is diffed against repository. Otherwise Dries can just apply the first portion of the patch and rename the directory himself to ensure the files are the same.
Comment #20
Dries CreditAttribution: Dries commentedJust 'testing' seems like the best choice to me. It's the most Drupal-ish. I'm ready to commit this patch and add/remove the necessary files when it is marked RTBC.
Comment #21
keith.smith CreditAttribution: keith.smith commentedI started making notes on comments in this patch before I realized how long it was. I stopped because it would be easier for me to capitalize comments and add periods than write about the need to do so. I'm temporarily assigning to myself and will go through this with a text editor in a bit.
Comment #22
keith.smith CreditAttribution: keith.smith commentedWell. poxy on that. Actually this no longer applies very cleanly (mostly but not exactly) and I'm not nearly up enough on testing to know exactly how to fix it. If someone can sync it up with today's head and repost, I'll clean up the code comments, though.
Comment #23
dmitrig01 CreditAttribution: dmitrig01 commented@keith - this patch does not add or change any code comments, so that should go in a separate issue.
Comment #24
keith.smith CreditAttribution: keith.smith commentedAh. After a second look I see what it's doing now. There are some comments that need fixing, but they can indeed go in a different issue after this one is resolved. Sorry for the sidetrack.
Comment #25
catchWorks great. Only thing that stuck out was "Testing is initializing" - changed this to "Test framework is initializing". Marking RTBC, please don't credit on commit.
Comment #26
Dries CreditAttribution: Dries commentedDoesn't apply smoothly. Doesn't look up-to-date.
Comment #27
cwgordon7 CreditAttribution: cwgordon7 commentedThis was rolled before #274994: Simpletest not including tests includes directory and #275396: Cannot pass querystring and other url() options to drupalPost() were applied... needs to be redone.
Comment #28
pwolanin CreditAttribution: pwolanin commentedThe main work will be renaming/moving files areound directly in the repository - maybe we can get sign-off form Dries and then a window of a few days where no patches should touch these files except the one needed to rename the module functions?
Comment #29
boombatower CreditAttribution: boombatower commentedYea, once t.d.o is up and running. Fair amount of issues with server #321659: testing.drupal.org down, Centos repair needed I will focus on getting a few other SimpleTest patches cleaned up and committed.
Then I would feel more comfortable with this.
Comment #30
boombatower CreditAttribution: boombatower commentedWaiting for D7 freeze.
Comment #31
webchickDries, I'm operating under the assumption that small "clean-up" changes like this (as well as moving tests around en-masse so they are more consistent) are things that can happen at the very start of code freeze so we do not needlessly break every patch in the queue during our most critical development time. If this is an incorrect assumption, please let us know because then we really should do this sooner than later.
Comment #32
sunBack into business.
Comment #33
sunCan we simply commit this for starters?
I'm not sure whether it's really worth renaming the entire module folder, classes, files, etc. At least, I can handle that. But what confuses me each time I want to enable the "Testing" module to get my testing environment is that I need to enable "SimpleTest", not "Testing"....
Comment #34
wmostrey CreditAttribution: wmostrey commentedI think that making the name change in only that single place will make for a lot of confusion. I think it's bad practice to have a module in the simpletest directory with a simpletest.info file name itself "testing" instead of "simpletest". Also, the documentation still also consistently refers to SimpleTests. Doing the change this way sounds too much like the taxonomy/categories tale, with the admin link labeled "categories" going to admin/content/taxonomy and info text reading "The taxonomy module allows you to...".
Comment #35
Dries CreditAttribution: Dries commentedIf I were the SimpleTest project, I'd be unhappy with this 'fork' because it creates confusion between the two projects.
If they have a SimpleTest trademark (don't know if they do), they will probably demand that we rename our fork -- and rightly so. We can still say 'Based on SimpleTest' but the two projects and code bases are different enough that they really should have a different name.
In other words, we must rename this. For starters, I committed the patch in #33 but it would be good to re-roll the earlier patch too.
Comment #36
boombatower CreditAttribution: boombatower commentedAnd if we add js testing...it is even less SimpleTest, #237566: Automated JavaScript unit testing framework. I am happy to role a full patch...I just need to know that the time is right and it will be committed...as otherwise it will need constant re-rolling.
Comment #37
sunYes, this would break every single mission critical patch in the queue now. Let's defer this to right after API freeze.
Comment #38
PasqualleThis will break every patch with test even after the API freeze, so the reason for postponed status is unclear.. And we are in "some kind of" API freeze already..
Comment #39
boombatower CreditAttribution: boombatower commentedThis should only break patches to simpletest...rest of core should be fine, right?
Comment #40
webchickYeah. And I do think this is worth doing. It's inaccurate at best to name our totally custom testing framework after another project it has absolutely nothing to do with, other than loosely sharing a syntax. Also, I don't know that there is a SimpleTest Foundation who has a trademark on the name and goes after people who name their custom testing frameworks SimpleTest, but since D7 will be around for another 3-4 years at least, it's probably not worth testing the theory. ;)
This requires coordination tho since testing bot will of course break.
Comment #41
scor CreditAttribution: scor commentedWhen is a good window to reroll this patch?
Comment #42
sunToo late for D7 now.
Comment #43
XanoI'm not sure, but this might conflict with #1076130: Fully pluggable testing.
Comment #43.0
sunUpdated issue summary.
Comment #44
sunIf possible, I'd like to do this before #1541676: Convert Simpletest base test classes to PSR-0
I've rewritten and clarified the issue summary.
Comment #46
sunSorry, typo.
Comment #48
chx CreditAttribution: chx commentedI am fine with test module.
Comment #49
sunPIFR currently has 'simpletest' hard-coded, so I've created #1556696: Prepare for simpletest.module rename to test.module (D8) to adjust it for the rename.
Comment #50
sunSimpletest is broken beyond repair. I can prove and explain that with a long list of architectural design problems.
We will go an entirely different route. Renaming is pointless and will only waste time.
I'll try to do a write up as soon as time permits (and after calming down to not make it a total rant). That said, it's going to be huge undertaking that potentially needs funding and possibly also a digital or in-person sprint.
Comment #51
boombatower CreditAttribution: boombatower commentedBeen saying the funding and rewrite/new framework for a while...something tells me you will have more sway.
Comment #51.0
boombatower CreditAttribution: boombatower commentedUpdated issue summary.