Description

The tests were broken before 1.3.2 release. Because of that, we did not include them.

Steps to reproduce

  1. Be sure to use 1.3.3pre code.
  2. Use Twisted, Standalone, fast cgi or mod python servers (no error with CGi).
  3. Run ?action=test

  4. Run it again
  5. You can see about 12 errors and 2 failures.

Workaround

We disabled the tests in 1.3.2. They will return in 1.3.3.

Discussion

The test are just fine with CGI: http://nirs.dyndns.org/main/?action=test . No test was broken until patch-580.

There is problem with long running process, I don't remember this problem before - I remember when I fixed the user tests, I run the test on standalone with no problem (probably I run it once).

At the past the tests were available only on cgi, and the test system assumed cgi environment. All the tests that uses a request object import request from MoinMoin._tests - this is done only on the first import of the tests. The second run uses the wrong request instance from the first import.

If we want to make the tests compatible with long running processes, we need to have the current request available to each TestCase class.

-- NirSoffer 2005-01-23 21:06:51

Plan

Check how we can pass the current request to all TestCase classes. This probably require patching Python unittest module to run all test or create all test case instances with a request object.

Seems that if we change these lines in the _tests.__init__.py:

   1         # Collect TestCase and create suite for each one
   2         test_cases = [unittest.makeSuite(obj, 'test') 
   3             for name, obj in module.__dict__.items()
   4             if name.endswith('TestCase')]

Maybe we can create the test suites without using unittest.makesuite, which is considered obsolete in Python 2.4, then we can add the missing request into every TestCase, and use it in the tests as self.request. This could be done by using a TestLoader sub class. See http://docs.python.org/lib/testloader-objects.html.

Or just enable the test for CGI. Do we really need those test in any environment?

Since its has no effect on using the system and we have many other real bugs to fix, I schedule it to later release. -- NirSoffer 2005-02-10 23:48:30


Fixed by injecting the current request into TestCase classes by using a TestLoader subclass. A test can refer to the current request as self.request. All tests updated to use request, all types of server tested.

Enjoy: CGI, FastCGI, Mod Python. (Standalone and Twisted also ok but I run them only for testing)


CategoryMoinMoinBugFixed CategoryRelease1.3.5

MoinMoin: MoinMoinBugs/TestsBrokenWithLongRunningServers (last edited 2007-10-29 19:19:23 by localhost)