Closed (fixed)
Project:
SimpleTest
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
10 Jul 2007 at 12:04 UTC
Updated:
23 Sep 2007 at 00:32 UTC
Jump to comment: Most recent file
I started work on porting simpletest to D6.
Attached patch fixes simpletest module to the point where tests can be run and resulsts dispayed.
I will work on fixing tests later this week.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | simpletest.d6port_0.patch | 24.42 KB | chx |
| #14 | simpletest.d6port-3.patch | 23.75 KB | pwolanin |
| #13 | simpletest.d6port-2.patch | 23.06 KB | pwolanin |
| #12 | fix_tests_for_D6.patch | 9.93 KB | mrharolda |
| #8 | simpletest_cli.php_.txt | 1.15 KB | mrharolda |
Comments
Comment #1
Rok Žlender commentedThis patch fixes all tests. There really was not much to do.
- this http://drupal.org/node/154216 has to be committed for profile tests to work
- image module is not yet ported to D6 and I couldn't look into fixing tests
If someone can try it out and let me know if everything is green.
Comment #2
mrharolda commentedRok,
I've downloaded the CVS version of the simpletest module, applied 'simpletest.d6port.patch', downloaded simpeltest from sourceforge and added it to the simpletest module dir with the following result in the 'Simpletest unit testing' menu item:
Fatal error: Call to undefined method DrupalUnitTests::_requireWithError() in /var/www/d6/drupal/sites/all/modules/simpletest/drupal_unit_tests.php on line 42My bad or bug?
-H-
Comment #3
Rok Žlender commentedThanks for trying out my patch. Its not your bad its rather an unresolved issue http://drupal.org/node/160859 . Hope this helps.
Comment #4
mrharolda commentedThat sure helps!
I'd reckon that most tests aren't ported to Drupal 6 yet? A lot of the tests fail, even on a 'clean' checkout of Drupal 6...
-H-
Comment #5
Rok Žlender commentedWell at the time I posted my patch everything was green. But since D6 is moving target things probably changed. So please if you can help out and post a patch that fixes the tests.
Comment #6
mrharolda commentedThis is my first encounter with unit tests. I'm currently researching tools/methods to perform tests through a cron job.
Simpletest looks very promising, except for the fact that the Drupal module depends on a slightly older version...
If I encounter any (easy) fixable bugs, I'll surely report them here...
-H-
Comment #7
mrharolda commentedEhm, how can I launch a test from the CLI? Or is this not possible?
Comment #8
mrharolda commentedI've cooked up the following script to run tests from the command line:
I've named it "simpletest_cli.php" and put it the Simpletest module directory (sites/all/modules/simpletest/simpletest_cli.php)
When running Drupal from the CLI, the url() function doesn't create a 'http://' like url. Use this ugly hack to get tests working again.
Edit 'drupal_test_case.php' around line 104:
I've got little Drupal experience, so please tell me if I'm totally wrong on this one...
-H-
Comment #9
Rok Žlender commentedPlease don't change title of the issue.
There is already a CLI version of simpletest "run_all_tests.php". If you have special needs use that one to build on.
Comment #10
moshe weitzman commentedrok - we may not need that script anymore in D6 version. instead, we could ask folks to use the new /scripts/drupal.sh with the right url (we might need to build this callback). i didn't look at run_all_tests, so i might be wrong on this.
Comment #11
mrharolda commentedI might be wrong on this, but doesn't the drupal.sh output formatted (=html) text?
As for "run_all_tests.php", it has 'require_once' issues, I doubt that it handles url's correctly, and it isn't possible to specify a specific test, so I'm sticking with my own script for the moment.
If time permits, I'll try to fix some tests on D6 once I've fully mastered the art of testing...
Cheers!
-H-
PS: I wasn't aware that I could change the title of the issue, I thought it was the title of my own post... Sorry 'bout that...
Comment #12
mrharolda commentedI've attached a patch that fixes all tests (except for the 'Image Module' test) on a fresh checkout of Drupal 6. Basically, all the 'Submit' buttons are replaced by 'Save' buttons...
Current test result:
443 passes, 0 fails and 0 exceptions.-H-
Comment #13
pwolanin commentedThis patch combines the above two so that it can be applied in one go.
Comment #14
pwolanin commentedPatch updated for the removal from the DB API of db_num_rows().
Seems to work now.
Comment #15
chx commentedI added an 'administer users' permission to single profile field testing. That helped -- we did not need to test profile for D6 beta. I love simpletest.
Comment #16
Rok Žlender commentedCommited to HEAD. Thanks everyone for helping out.
Comment #17
(not verified) commented