Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Sep 2008 at 23:17 UTC
Updated:
7 Jun 2009 at 05:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedI should add, because one of my tests had deleted the existing files.
Comment #2
boombatower commentedNever noticed I am assuming because I had files install correctly once. I also added deletion of files and folder during un-install along with comments.
Upload test passes and after fresh install of SimpleTest (deleted files) it seems to work.
Comment #3
webchickSorry, could I please have some test instructions with this patch?
Comment #4
boombatower commentedShould uninstall SimpleTest and make sure that the files/simpletest directory doesn't exists. (it won't remove them without patch, so you will have to do manually)
Install SimpleTest and make sure that it puts all the files there and upon uninstall it removes them.
Comment #5
boombatower commentedGuess I should change back to RTBC?
Comment #6
drewish commentedAs for testing the current broken behavior delete half of the simpletest image files. That will cause it to avoid installing the rest of them.
Comment #7
webchickI confirmed that the uninstall stuff does what's intended. I still don't quite grok the copy stuff. That probably means it needs to be better documented than "// Copy other test files for consistency." Is that overwriting the files in the files directory with whatever's in simpletest's files directory, or..?
Comment #8
drewish commentedwebchick, the problem is that some of the files are generated and some are copied. the generated ones work fine but the current test for the copied ones is faulty. if there is a single html, image, javascript, php, or sql file then none will be copied. I changed the test to copy them if there are fewer. Perhaps it not even worth testing, maybe we should always just overwrite them.
Comment #9
boombatower commentedAdded extra comment.
Comment #10
boombatower commentedRe-rolled.
Comment #11
webchickShoot. :( No longer applies. Sorry. :(
Comment #12
boombatower commentedRe-rolled.
Comment #13
lilou commentedAttached patch correct typo :
+ // Unistall schema.Comment #14
keith.smith commented"then" is also a typo. It should be "than".
Comment #15
keith.smith commentedForgot to change status.
Comment #16
boombatower commentedRe-rolled...
Comment #17
drewish commentedat first i was going to call it a bug that this changed file_unmanaged_copy() to file_copy() but the more i think about it, i think it's a good idea. it'll make it easier to fully test the file system since the files will already exists in the db so if i want to search for something by mime type it's easy to do so.
Comment #18
boombatower commentedping...ping
Comment #19
drewish commentedstill applies...
Comment #20
webchickOops, I thought I committed this already!
Committed to HEAD. Thanks. :)
Comment #21
webchickBzzzt. Spoke too soon.
hook_uninstall() appears to be b0rked.
I get a bazillion of these:
And then:
And so does hook_install() for that matter:
x40 or so.
Not sure if this patch needs work or if it's just waiting on #74645: modify file_scan_directory to include a regex for the nomask. to get re-committed, but it's definitely NOT working, so rolled it back. Sorry.
Comment #22
drewish commentedah, actually the patch hadn't been updated for the file_scan_directory() preg regex change. it also was also calling the old file_copy() and file_delete() rather than the unmanged versions.
to test this, disable simple test and then when uninstalling make sure it removes the files/simpletest directory, re-install the module and make sure all the files are copied/generated. then repeat the uninstall process.
Comment #24
boombatower commentedissue with core.
Comment #26
boombatower commentedComment #27
cburschkaGood comments; even I can understand the patch now. ;)
I assume there is no way for the destination to contain files /not/ in the original path, which would make the file-count comparison unreliable. Common sense says we can always assume that, but I'm mentioning it just in case.
Comment #28
boombatower commentedWe should be able to assume that, but otherwise it could do a comparison of the files themselves.
Comment #29
dries commentedThis looks good. However, I'd add one sentence to
+ // If there are more files in the original directory than the files directory, copy files.explain _when_ or _why_ this can happen.Comment #30
boombatower commentedThis behaves like the "Clean environment" button. More for automatically fixing any issues with the test environment.
The uninstall behavior is technically a bug since it should not leave all the test files behind.
Comment #31
dries commented"servers" sounds like a typo.
So, right now, according to the documentation, there are 3 directories: the original directory, the files directory and the SimpleTest directory. I initially thought that the original directory was the SimpleTest directory but that doesn't make sense when I read the code comments. It is still not clear how files can disappear from the original directory?
Comment #32
boombatower commented"servers" => "serves"
The SimpleTest directory stuff was a messup. Not sure how I managed that. :)
Comment #33
dries commentedThis looks good to me -- it is reasonably clear now. Let's see what others have to say.
Comment #34
drewish commentedI'm not going to change the status on this since I think this patch is totally RTBC but I was going to offer up an alternate comment:
Comment #35
boombatower commentedI like the comment.
Comment #36
dries commentedGreat. Thanks. Committed! Next patch? :)