It's been really bugging me that the SimpleTest from D6 and D7 are so out of sync now, and I wanted to see if I could backport them.
I removed all the commented out lines because it makes the code really hard to read, and I use a visual two-way diff between D6 and D7 modules and it's way easier to see the actual differences in the files. And why are there a bunch of copyrights in the top of the files??
Two new files are added in core's /includes directory rather than trying to add those new functions in the existing core files.
Also took a stab at backporting D7's class registry in #817496: Autoload via .info files which would make autoload a dependency for SimpleTest, which is not a bad thing.
Currently it's not working, but thought I'd start posting patches for initial review.
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | 890440-backport-round2.patch | 44.41 KB | dave reid |
| #34 | 890440-backport-round2.patch | 26.99 KB | dave reid |
| #33 | 890440-backport-round2.patch | 26.7 KB | dave reid |
| #31 | 890440-backport-round2.patch | 26.1 KB | dave reid |
| #29 | 890440-backport-round2.patch | 18.64 KB | dave reid |
Comments
Comment #1
mikey_p commentedI'm confused, this seems to be a patch against core as well as Simpletest?
Comment #2
mikey_p commentedNevermind, patching a patch file is as confusing as patching a patch file which is....
Comment #3
dave reidComment #4
sun+1 Badly needed.
However, I'm mainly interested in newly introduced assertion methods and stuff. Would it be possible and would it make sense to split those "feature" changes into a separate patch?
I'm not really interested in changing the fundamental D6 implementation of SimpleTest. Also not sure whether that shouldn't require a new major version for this module.
Comment #5
dave reidYeah I've found that its going to be a very difficult effort to try and do it all at once. The first effort will probably be just to backport new assertions that don't require a wider change.
Comment #6
mikey_p commentedGetting
Fatal error: Call to undefined function drupal_static() in /Users/mdp/www/6/sites/all/modules/simpletest/simpletest.module on line 300Whats your plan for this, want to backport drupal_static or patch where necessary?
I think somewhere there is a module that backports a bunch of stuff (like drupal_static) to D6. This is already likely to be dependent on Autoload for D6.
Comment #7
mikey_p commentedxpost
Comment #8
boombatower commentedEnsure #699216: Module dependencies not being checked in SimpleTest 6.x (and needs doc) works.
Comment #9
dave reidYep it backports the SimpleTestMissingDependencyTestCase from D7 and passes.
Comment #10
boombatower commentedMore to check:
- #789188: Wrong path listed for viewing results
- #803026: Fatal error on simpletest: Unsupported operand types in form.inc on line 518
- #892446: Backport drupal_hmac_base64 so drupal_generate_test_ua makes valid headers.
- #382334: drupalGetNodeByTitle doesn't return node object
- #869408: curlHeaderCallback() should join headers if no colon found
Comment #11
boombatower commentedCleaned up existing issue (thus the list above) and created 6.x-2.11 so the backport will be 2.12.
Comment #12
andypostThis issue should be backported when commited #278425: Using basename() is not locale safe
Comment #13
neclimdulKinda tricky tracking all these in one issue but... here's the backport drupal_hmac_base64 patch. Its sort of critical because d6 simpletest is not reliable enough to use without it. Any set of tests of sufficient size will fail somewhere logging in a user or testing some form.
Comment #14
neclimdulSorry, correct format and a patch to apply over the previous core patch for testing.
Comment #15
dave reidHooray we got all of the backports to SimpleTest done, now it's just time to work on the necessary core backports.
Comment #16
rfay@davereid, What ended up being the status of this?
Comment #17
dave reidWe got most of the big functional backports to the testing framework itself fixed. We still have to work on functions that have changed or added in D7 and need to be backported as a part of SimpleTest's core patch.
I alos found more D7 changes to fix for now.
Comment #18
dave reidTry that again.
Comment #20
dave reidComment #21
sunNot sure whether this is correct for D6 -- did you double-check that with user_save() in detail?
Did you manually run a test and verify that
1) the proper page title is displayed
2) the proper breadcrumb is displayed
?
Powered by Dreditor.
Comment #22
dave reidReverted the change to the user_save() call as by default in D6 we use the empty string. Not sure why I changed that. As for the menu callback change: when running a test result I get a title of 'Test result' and breadcrumb of "Home › Administer › Site building › Testing" which is correct.
Comment #23
dave reidPassed locally and via the test bot, so committed #22 to CVS - http://drupal.org/cvs?commit=492672
Comment #24
sunThanks for double-checking, and committing, @Dave Reid! :)
Comment #25
kenorb commented+1
Comment #26
neclimdulThis still hasn't been ported over #892446-1: Backport drupal_hmac_base64 so drupal_generate_test_ua makes valid headers.
Comment #27
dave reid"We still have to work on functions that have changed or added in D7 and need to be backported as a part of SimpleTest's core patch." Patches welcome. :)
Comment #28
neclimdulI would but I get random 500 invalid header failures breaking tests. :)
Seriously though, I think it is unfortunate that we're blocking a fairly critical bug fix in favor of an amorphous "Backport everything from 7" issue. That's the only reason I bumped the issue.
Comment #29
dave reidLet's try this.
Comment #31
dave reidGetting closer.
Comment #33
dave reidAnd one more which should pass.
Comment #34
dave reidSummary of #34:
1. Adds a 'SIMPLETEST_PATCH_VERSION' constant to bootstrap.inc rather than using the $GLOBAL variables so that we can check the versions of the core patches
2. Backports the REQUEST_TIM constant for use with drupal_generate_test_ua() and drupal_valid_test_ua().
3. Backports drupal_hmac_base64(), drupal_hash_base64(), drupal_valid_test_ua(), drupal_generate_test_ua(), and drupal_get_hash_salt() from Drupal 7 into bootstrap.inc
4. Backports latest debug() from Drupal 7 into common.inc
5. Made the core patch requirements check a runtime patch because until you try to run simpletests, you don't *actually* need the core patch.
6. Expanded the core patch requirements check to notify users with the old $GLOBAL variable to re-patch.
7. Misc backports to drupal_web_test_case.inc and simpletest.test.
Todos:
1. Backport error handling currently in common.inc.
Comment #35
dave reidAttempting to include error handling backports...
Comment #36
kenorb commentedDrupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.