Using the CVS version of G2 (20021210). These are some problems I encountered using the test harness:
Test: core :: CreatePhotoItem [1 iteration(s)]
Timing: 0.1278 elapsed, 7.8218 per second
Error: Error (ERROR_PLATFORM_FAILURE)
* in modules/core/classes/GalleryDataItem.class at line 180
* in modules/core/classes/GalleryPhotoItem.class at line 135
* in modules/core/test/TestCase/CreatePhotoItem.class at line 44
* in setup/test/TestCase.class at line 18
* in setup/test/index.php at line 212
Debug:
<<<SNIP>>>>
(mysql): SELECT g2_GalleryEntity.g_id,
g2_GalleryEntity.g_creationTimestamp,
g2_GalleryEntity.g_modificationTimestamp, g2_GalleryEntity.g_serialNumber,
g2_GalleryEntity.g_entityType, g2_GalleryChildEntity.g_parentId,
g2_GalleryFileSystemEntity.g_pathComponent, g2_GalleryItem.g_description,
g2_GalleryItem.g_layout, g2_GalleryItem.g_keywords,
g2_GalleryItem.g_orderBy, g2_GalleryItem.g_orderDirection,
g2_GalleryItem.g_orderWeight, g2_GalleryItem.g_ownerId,
g2_GalleryItem.g_summary, g2_GalleryItem.g_theme, g2_GalleryItem.g_title,
g2_GalleryItem.g_viewedSinceTimestamp FROM g2_GalleryEntity,
g2_GalleryChildEntity, g2_GalleryFileSystemEntity, g2_GalleryItem WHERE
g2_GalleryEntity.g_id IN ('5') AND
g2_GalleryChildEntity.g_id=g2_GalleryEntity.g_id AND
g2_GalleryFileSystemEntity.g_id=g2_GalleryEntity.g_id AND
g2_GalleryItem.g_id=g2_GalleryEntity.g_id
file_exists(/home/michel/public_html/g2data/albums/root//home/michel/public_html/gallery2/modules/core/test/data/test1.itemPath_1039529553)
copy(/home/michel/public_html/gallery2/modules/core/test/data/test1.jpg,
/home/michel/public_html/g2data/albums/root//home/michel/public_html/gallery2/modules/core/test/data/test1.itemPath_1039529553)
Output:
Creating new photo item
Warning: Unable to create '/home/michel/public_html/g2data/albums/root//home/michel/public_html/gallery2/modules/core/test/data/test1.itemPath_1039529553': No such file or directory in /home/michel/public_html/gallery2/modules/core/classes/GalleryPlatform.class on line 54
--------------------
DeleteRandomAlbum gives this error:
Fatal error: Call to undefined function: fetchchildrenwithtypes() in /home/michel/public_html/gallery2/modules/core/test/TestCase/DeleteRandomAlbum.class on line 44
------------------------
GetChildren gives this error:
Fatal error: Call to undefined function: fetchchildcount() in /home/michel/public_html/gallery2/modules/core/test/TestCase/GetChildren.class on line 32
--------------------------
Test: core :: CreateRandomTree [500 iteration(s)]
Timing: 0.3209 elapsed, 1558.0937 per second
Error: Error (ERROR_BAD_DATA_TYPE, ERROR_GRAPHICS_FAILURE)
* in modules/netpbm/classes/NetPbmGraphics.class at line 344
* in modules/netpbm/classes/NetPbmGraphics.class at line 71
* in modules/core/classes/GalleryPhotoItem.class at line 128
* in modules/core/test/TestCase/CreateRandomTree.class at line 133
* in modules/core/test/TestCase/CreateRandomTree.class at line 46
* in setup/test/TestCase.class at line 18
* in setup/test/index.php at line 212
---------------------------
That's what I found.
As always, I started with a fresh mysql and gallery directory.
Cheers,
Kees
Posts: 7994
Kees,
Excellent work as always. I had forgotten to update the test cases to reflect some API
changes I made in GalleryItem. I just checked in the corrected test cases. The only
error I couldn't reproduce was the CreateRandomTree one. Can you still reproduce
that? If so, are you certain that your NetPBM module is configured properly?
Posts: 29
The CreateRandomTree works fine right after a clean install.
But why I do ConfigureNetPbm first and then the CreateRandomTree, I get the error.
So I guess the problem is in ConfigureNetPbm.
After doing ConfigureNetPbm, I went back to the Site Administration page and saw that the path for the NetPBM tools was modified to: /usr/local/bin
When I change the path to /usr/bin, CreateRandomTree works again.
I Haven't looked at the code but I think that it's your hard-coded default path for NetPBM tools that ConfigureNetPbm is changing.
Maybe it would be nice to autoprobe some paths during the NetPBM module configuration. Speaking as linux user, the NetPBM binaries are likely to be in /usr/bin or /usr/local/bin anyway.
Posts: 7994
Ah yes, right. I have a hardcoded path in ConfigureNetPbm to point to /usr/local/bin -- this is a convenience for me when I do development. Sorry.
Yes I plan to add that eventually. It's a bit tricky to do it right and avoid spewing open_basedir errors, etc so I haven't gotten into it yet.