Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Nov 2008 at 17:55 UTC
Updated:
14 Jul 2009 at 01:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
damien tournoud commentedThis implements simpletest_id() and fix two small things:
- the file directory should use the not prefixed id
- a typo
Comment #2
damien tournoud commentedc9606571 noted that the installer was broken and that double prefixing could happen in tearDown().
New version up for review.
Comment #3
damien tournoud commentedFixed code comments and removed the unused parameter for simpletest_id(), following c9606571 review on IRC.
Comment #4
damien tournoud commentedSome tests fails with this.
Badfully, we will have to make simpletest_id() to work also in the testing site. Back to the drawing board.
Comment #5
boombatower commentedThe files directory should most definitely use the database prefix for the same reasons the database does. Since tests can run concurrently through shell script and such it needs the prefix.
Comment #6
damien tournoud commented@boombatower: I reverted back the file directory to the old behavior. Note anyway that we now add the main database prefix just to make the "clean environment" feature work correctly, not because of potential conflicts (which should not happen because the prefix is random enough).
Also:
- moved the detection of HTTP_USER_AGENT out of the database layer and in conf_init(), where it makes sense.
- cleanup the simpletest test :)
Comment #8
boombatower commenteddue to: #74645: modify file_scan_directory to include a regex for the nomask.
Comment #10
damien tournoud commentedRerolled without significant changes.
Comment #11
damien tournoud commentedMoved the core of the user agent detection to conf_init(), in order to simplify the logic in simpletest_id, which is now a simple get/set function.
Comment #12
damien tournoud commentedFollowing chx' review on the IRC:
- renamed inTestingSite() to inChildSite() which is clearer and reworked comments
- remove a redundant new line
As a summary, this patch aims to remove the multiple regexps on HTTP_USER_AGENT or $db_prefix that were all over core, in the benefit of a simpler and clearer simpletest_id() function. It's a building block above which we will be able to implement #195416: Table prefixes should be per database connection, and that will, later, allow us to speed-up simpletest by simply duplicating a pre-installed Drupal instance, instead of rebuilding it at each test run.
Comment #13
damien tournoud commentedFinally, a simpletest_id() function was not enough, so I added a small static DrupalTestRunInfo class.
Comment #15
c960657 commentedWith the patch in #13, $db_prefix is modified before settings.php is included AFAICT. If settings.php sets $db_prefix, the prefix will get overwritten. So I think this should be moved a bit down in the bootstrap process.
Comment #16
damien tournoud commented@c960657: $db_prefix is set at the bottom of conf_init(), after the settings.php file has been included.
Comment #17
c960657 commentedD'oh. Sorry :-(
Comment #18
boombatower commentedEnergy at #518404: Lock down DB config based on simpletest UA headers.