Posted by msonnabaum on March 10, 2012 at 9:01pm
10 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D7 |
Issue Summary
The run-tests.sh script tries to find your php binary by checking $_ENV. This is not safe. If you have variables_order set to "GPCS" in php.ini (which is common), it will be empty. This is what the getenv() function is for. Patch fixes.
Also, it returns the results of the tests with simpletest_script_format_result(), which prints html special characters as if the output is html. Patch also fixes this by capturing the output and running it through htmlspecialchars_decode() so it's less ugly.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| un-f-runtests-script.patch | 1.39 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 35,631 pass(es). | View details |
Comments
#1
I'd RTBC the first hunk, but I'm not sure about the second one (which requires manual testing for various environments and scenarios [e.g., testbots]).
#2
I have been meaning to do the first hunk forever. For some reason, the default PHP production configuration doesn't include E in variables_order (which seems slightly retarded, but that's another issue).
The second one looks like a hack:
simpletest_script_format_result()is local to the script runner, so we could likely fix it not to return HTML in some cases (what are those? verbose results?)#3
Ok, here's just the env fix. The output fix should probably have it's own issue.
#4
#5
This looks backportable to D7, to me. Is it?
#6
Totally backportable.
#7
#8
Committed to 8.x. Moving to 7.x. Thanks!
#9
This did not get pushed yet, setting back.
#10
http://drupalcode.org/project/drupal.git/commit/4b6355f
#11
Same patch should apply fine for D7 with -p2.
#12
Rerolled.
#13
+++ b/scripts/run-tests.shundefined@@ -253,14 +253,14 @@ function simpletest_script_init($server_software) {
- elseif (!empty($_ENV['_'])) {
+ elseif ($php_env = getenv('_')) {
Does it look to anyone else like the little face is sadder than it used to be?
(RTBC)
#14
great thanks!
committed and pushed to 7.x.
#15
Automatically closed -- issue fixed for 2 weeks with no activity.