Nicolas Lehuen wrote:
Hi,

Just FYI, here are the results of my latest build & tests with mod_python
SVN revision 387864 :

+1 ActivePython 2.4.2.10 / Apache 2.0.55 / Windows XP SP2 / old importer
+1 ActivePython 2.4.2.10 / Apache 2.0.55 / Windows XP SP2 / new importer
+1 ActivePython 2.3.5.? / Apache 2.0.55 / Windows 2000 SP4 / old importer
+1 ActivePython 2.3.5.? / Apache 2.0.55 / Windows 2000 SP4 / new importer
+1 Python 2.2.3 / Apache 2.0.55 / Windows 2000 SP4 / old importer

-1 Python 2.2.3 / Apache 2.0.55 / Windows 2000 SP4 / new importer
    * A lot of failures caused by the new importer, as expected

With mod_python SVN revision 389505 :

-1 ActivePython 2.4.1.247 / Apache 2.2.0 / Windows XP SP2 / new importer
    * Still the same problem in test_req_auth_type, I still need to check
this

BTW, one of my fantasy is that when the test suite is refactored, we use
BuildBot to automate the tests on multiple platforms.

I've been playing with some ideas for a new test framework, using a subclass of unittest.TestLoader to find and configure tests. I want to play around with it for another day or so before sharing but at this point I'm pretty confident it'll work.

Creating a new set of tests could be as simple as:

testsuites/core/simpletest.py
----------------------------

from testlib import VirtualHostTest

class MyTests(VirtualHostTest):
    def test_hello_world(self):
        rsp = self.send_request()
        self.failUnless(rsp == 'test ok')

    def test_goodbye_world(self):
        rsp = self.send_request()
        self.failUnless(rsp == 'test ok')


htdocs/testhandlers/core/simpletest.py
--------------------------------------

from mod_python import

def test_hello_world(req):
    req.write('test ok')
    return apache.OK

def test_goodbye_world(req):
    req.write('test ok')
    return apache.OK

$ python testrunner.py

Things like virtual host names and handler directives required for configuration or send_request() are automatically derived from the test class and test method names. It will still be possible to provide custom apache configuration directives in a manner similar to that which we currently use, but for most tests this will not be required.

Usage would look something like this:

Run all the tests
$ python testrunner.py

Run one test
$ python testrunner.py -t core.simpletest.MyTests.test_hello_world

Run a group of tests (this would load the TestCase subclasses in testsuites/sessions/filesession.py):

$ python testrunner.py -t sessions.filesession


Jim

Reply via email to