CommentFileSizeAuthor
#17 ffs.patch9.42 KBAnonymous (not verified)
#12 ffs.patch9.46 KBAnonymous (not verified)
#11 ffs.patch3.66 KBAnonymous (not verified)
#9 ffs.patch1.35 KBAnonymous (not verified)
#6 693084-reverse-suspected.patch20.6 KBStevel

Comments

Anonymous’s picture

17:11:35.0.: menu_execute_active_handler --> call_user_func_array --> system_batch_page --> _batch_page --> _batch_do --> _batch_process --> call_user_func_array --> _simpletest_batch_operation --> DrupalTestCase::run --> FileFieldValidateTestCase::testFileExtension --> node_load
Array
(
    [0] => 
)

we're passing crap into node_load_multiple(), that's dump of $nids before this line in node_load():

  $node = node_load_multiple($nids, $conditions, $reset);
Anonymous’s picture

and that's because we don't validate FileFieldTestCase::uploadNodeFile() actually worked:

The specified file <em class="placeholder">image-test.png</em> could not be uploaded. Only files with the following extensions are allowed: <em class="placeholder">txt gif</em>.
marcvangend’s picture

is this a duplicate of #840182: Testing is broken?

Anonymous’s picture

looks like the code that calls FileFieldTestCase::updateFileField() was broken by the changes in this issue #693084: Regression: file_munge_filename() extension handling broken by move to File Field:

    // Disable extension checking.
    $this->updateFileField($field_name, $type_name, array('file_extensions' => ''));

that no longer does what it says in the comment. don't have time to figure out the magic incantation we need to pass in here now, will circle back to it later unless someone beats me to it.

Stevel’s picture

Could some of the image test files be related to #562968: Optimize module and theme images?

Stevel’s picture

Status: Active » Needs review
StatusFileSize
new20.6 KB

Lets try if reversing the suspected patch makes the tests work. If so, we are at least certain where to look at.

Stevel’s picture

Status: Needs review » Active

Set back to active as the above certainly is not for solving the issue.

rfay’s picture

All of the test bots have failed validation as a result of this one, so after the fix is committed, they'll have to be re-tested.

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB

This is much, much simpler than it looks. this commit:

http://drupal.org/cvs?commit=385780

changed the file sizes, so we no longer get a GIF image from:

     $test_file = $this->getTestFile('image');

so the tests that blindly expect that fail. attached patch changes the tests to use actual extension of $test_file. now the broken tests pass.

Anonymous’s picture

oh, seems there are more tests to fix, patch coming shortly.

Anonymous’s picture

StatusFileSize
new3.66 KB

now with a little bit less broken, upload tests pass, still have to fix:

Image field display tests (ImageFieldDisplayTestCase) [Image] 98 8 3
Image field validation tests (ImageFieldValidateTestCase) [Image] 24 2 3
Image styles path and URL functions (ImageStylesPathAndUrlUnitTest) [Image] 44 2 0

Anonymous’s picture

StatusFileSize
new9.46 KB

ok, the broken tests now pass for me locally.

how do we get the bot turned back on?

plach’s picture

how do we get the bot turned back on?

I'm afraid we can't: I think the bot won't run until the head gets fixed. Someone has to test the patch locally and RTBC.

rfay’s picture

It has to get committed before we can turn on the bot, because all the bots think they've failed testing.

Stevel’s picture

Status: Needs work » Needs review

edit: double post, see below.

Stevel’s picture

Status: Needs review » Needs work
+++ modules/image/image.test	30 Jun 2010 14:24:41 -0000
@@ -692,10 +692,12 @@ class ImageFieldDisplayTestCase extends 
+      'file_extensions' => 'gif jpg jpeg ' . $test_image_extension,

What does this give when the gif file becomes smaller again? Would it be a problem when an extension is added twice?

+++ modules/image/image.test	30 Jun 2010 14:24:41 -0000
@@ -817,20 +818,33 @@ class ImageFieldValidateTestCase extends
+    ¶

Some trailing whitespace here.

Powered by Dreditor.

Anonymous’s picture

StatusFileSize
new9.42 KB

updates as per #16.

dries’s picture

Do we have to use a variable $test_file_extension? If we know it is a 'gif' file, can't we simply hardcode the extension?

Stevel’s picture

It's always the smallest image file found. This was the gif file previously. When #562968: Optimize module and theme images got committed, the png version became smaller.
This patch prevents the tests from failing when an image gets updated (and another filetype becomes the smallest image).

Stevel’s picture

Status: Needs review » Reviewed & tested by the community

Looks OK

Anonymous’s picture

@Dries - the point of the indirection is to make the tests able to survive changes to the test files.

seems overly brittle to depend on exact file names, sizes and dimensions if we don't need to. we're testing stuff like 'can i add an extension to the list of extensions and upload a file with that extension' etc.

webchick suggested we could just put the hardcoding back, and i'm not totally opposed to that, but it seems better to me to avoid that unless we have to do it.

andypost’s picture

+1 Confirm that this patch fixes all image and file related tests.

Suppose better proceed with current approach because hard-coded things like 'dimensions', 'size' and etc are lead to nonavailability of UI related patches (when images are changed) or broken HEAD

webchick’s picture

Title: HEAD BROKEN: some file/image tests are failing » Some file/image tests are failing
Status: Reviewed & tested by the community » Fixed

I was originally in Dries's camp of making the test more obvious rather than adding more layers of indirection so it doesn't take the next poor slob who breaks this test an hour to figure out what's going on, but Justin gave a pretty good case for this making the test more robust going forward so hopefully random changes like file sizes and whatnot shouldn't break things horribly like they did in this case.

Committed to HEAD, so we can get the bot working again. Dries, if you feel strongly about this, as always feel free to revert.

Status: Fixed » Closed (fixed)
Issue tags: -HEAD broken

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