file_check_directory() does not support the creation of recursive directories, so in case the sites/default/files/simpletest does not exist for any reason, verbose logging throws lots of exceptions, as it tries to create simpletest/verbose, but simpletest itself does not exist.

Comments

boombatower’s picture

Isn't this an issue for D7 as well or does file_prepare_directory() support creating recursive directories? If not then we should fix in D7?

dave reid’s picture

Status: Needs review » Postponed (maintainer needs more info)
sun’s picture

Status: Postponed (maintainer needs more info) » Needs review

We use drupal_mkdir() in D7, which implements recursive creation of directories. See http://api.drupal.org/api/drupal/includes--file.inc/function/file_prepar...

dave reid’s picture

Status: Needs review » Fixed

This should be resolved now with the latest backport, which creates the initial /files/simpletest directory on install, and then creates /files/simpletest/verbose when called.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kenorb’s picture

Tested the latest dev on D6.22 (including uninstalling and re-installing), the folder files/simpletest/verbose doesn't exist.
Directory files/simpletest was created during install, but after test run, it was removed, so I can't access mine verbose html files generated by test.

Errors:

file_put_contents(files/simpletest/verbose/ULegal-1.html) [function.file-put-contents]: failed to open stream: No such file or directory
file_put_contents(files/simpletest/verbose/ULegal-2.html) [function.file-put-contents]: failed to open stream: No such file or directory

The folder is removed when 'Clear results after each complete test suite run' option is enabled. When I've disabled this option, the folder is still not created when running another test.

Anyone can confirm if it's still a bug?

kenorb’s picture

Status: Closed (fixed) » Reviewed & tested by the community

Tested the original patch, it fixes the problem, at least the folder is being created.

Index: drupal_web_test_case.php
===================================================================
--- drupal_web_test_case.php	(revision 6477)
+++ drupal_web_test_case.php	(working copy)
@@ -3119,7 +3119,9 @@
     $file_directory = $original_file_directory;
     $class = $test_class;
     $verbose = variable_get('simpletest_verbose', TRUE);
-    $directory = $file_directory . '/simpletest/verbose';
+    $directory = $file_directory . '/simpletest';
+    file_check_directory($directory, FILE_CREATE_DIRECTORY);
+    $directory = $directory . '/verbose';
     $writable = file_check_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
     if ($writable && !file_exists($directory . '/.htaccess')) {
       file_put_contents($directory . '/.htaccess', "<IfModule mod_expires.c>\nExpiresActive Off\n</IfModule>\n");
kenorb’s picture

StatusFileSize
new2.7 KB

Patch for the latest Pressflow 6.26

Issue:
https://github.com/pressflow/6/issues/56

Status: Reviewed & tested by the community » Needs work

The last submitted patch, drupal_web_test_case.php-943572.patch, failed testing.

kenorb’s picture

Priority: Major » Minor
Issue summary: View changes
lendude’s picture

Status: Needs work » Closed (outdated)

This version is not supported anymore.