Unit tests

fedak
fedak's picture

Joined: 2003-12-14
Posts: 79
Posted: Thu, 2004-02-19 04:40

Getting 5 failing unit tests with last night's dev cut:

core adminlayoutscontrollertest testactivate FAIL 0.0224
core adminlayoutscontrollertest testdeactivate FAIL 0.0350
core adminlayoutscontrollertest testsavelayout FAIL 0.0139
core adminlayoutscontrollertest testundolayout FAIL 0.0170
core adminlayoutscontrollertest testsavelayoutwithvalidationerrors FAIL 0.0148
slideshow slideshowtest testslideshow FAIL 1.0979

The unit test result page has been saved off here: http://www.fedak.net/g2_unit.htm

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sun, 2004-02-22 23:31

Ah ha! This turned out to only be an issue on Windows. Thanks for bringing it to my attention -- I just committed a fix for it.

 
fedak
fedak's picture

Joined: 2003-12-14
Posts: 79
Posted: Wed, 2004-02-25 06:17

Yup, looks like the adminlayoutscontrollertest layouts are now working.

mindless, the slideshow test still seems to be failing...

-fedak

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Thu, 2004-02-26 09:47

I was unable to get the unit tests to fail on my box -- are they still failing for you now, fedak? If so, what platform are you on? Thanks.

 
fedak
fedak's picture

Joined: 2003-12-14
Posts: 79
Posted: Thu, 2004-02-26 18:54

Windows.

I should have some time over the weekend to poke around with it a little deeper if its not something you're able to recreate.

-fedak

 
fedak
fedak's picture

Joined: 2003-12-14
Posts: 79
Posted: Thu, 2004-03-04 03:32

Tracked this down, Looks like the root cause was not having the ImageMagick module activated.

Probably should be a check for this in the slideshow test, but there doesn't appear to be an issue with the slideshow code itself.

All the test cases are now passing again with the latest dev build...
-fedak

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Fri, 2004-03-05 23:11

The slideshow test should be modified so that it uses a mock graphics utility that can handle the derivative operations that it's depending on. This will free it from dependencies on any of the real graphics toolkits and speed up the test considerably.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2004-03-05 23:41

I've added that to my list.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Sat, 2004-03-06 09:33

FYI, I encountered the same problem with the PhotoAccessCartPlugin test, since it requires the existence of thumbnails and derivatives, but shouldn't really be doing any graphics operations on them (since all it really needs to do is verify that we've passed the right data to the mock PhotoAccess server). Check out what I did in the setUp method there -- I forced the entity class to be a GalleryPhotoItem but used a bogus mime type so that none of the graphics toolkits would work with it -- this basically allows us to skate by without invoking a toolkit without breaking the rules.

 
fedak
fedak's picture

Joined: 2003-12-14
Posts: 79
Posted: Sat, 2004-03-27 18:55

Did someone forget to check in modules\core\test\data\apo'strophe.jpg?

Seems to be causing the "core itemaddfromservertest testaddchildrenfromlocalserver" unit test to fail in last night's build.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7985
Posted: Tue, 2004-03-30 06:40

Ah, this is a problem with paths in the unit test code. That file doesn't exist -- we have a dummy toolkit that is designed to expect a request for a file with that name and fulfil it. This lets us test weirdly named files in the ItemAdd code without actually having to ship all kinds of weird files with the code. The bug was yet another slash-or-backslash issue on Windows .. I just commmitted a fix for it now.