23/02/09 09:28:51 (12 years ago)

Add main README.txt documentation to codebase giving an overview of
the complete codebase along with descriptions of the structure and
info on important details. Also extend the setting up eXist and the test documentation.

1 edited


  • ndgCommon/trunk/ndg/common/unittests/README.txt

    r4793 r5011  
     1ndgCommon testsuite - overview 
    14The test suite can be ran as a whole by running the 'noseTests.py' class as 
    25a python app - otherwise, individual test classes can be ran as unittests. 
    4 NB, some of the tests require a DB config file, 'exist.config' to 
    5 be available - in the ndgutilstests/testdata directory.  This should provide access 
     7Setting up test environment: 
     10i) Some tests require an eXist DB config file, 'exist.config' to 
     11be available - in the unittests/testdata directory.  This should provide access 
    612details to the required eXist database in the following format: 
    814hostname user password 
     16ii) Additionally, the testpostgresclient.py tests require a config file at: 
     18unittests/testdata/pg.config with the format: 
     20databaseName hostName userName password port 
     22- obviously, these will have to point to a running instance of postgres 
     24iii) The testconstants.py class defines constants to use for running the tests. 
     25These don't need changing, typically, however, the EXIST_DB variable defines 
     26which eXist host to use when running tests.  Whilst the tests do clean up after  
     27themselves, it's probably best not to run tests using a production environment DB! 
     29iv) Additionally, some tests expect a browse/discovery stack to be running and 
     30available for use.  Typically this just means deploying a MILK server and running 
     31this.  The file at: 
     35should be adjusted so that the DEFAULT server value points to this server. 
     39noseTests is not always very reliable and quite often produces errors from tests 
     40which run ok by themselves.  If, after a run has completed, errors are output, it 
     41is worth rerunning the test classes in question again - directly as python unit 
     42tests.  This will normally fix problems. 
     44NB, the errors usually encountered are like: 
     46error: (10048, 'Address already in use') 
     48- these suggest that some tests are being ran concurrently, although it's difficult 
     49to see exactly what is going on.  There are some tests that involve invoking 
     50asynchronous code and these may interfere, although these include sleep periods 
     51so this shouldn't be a problem... 
Note: See TracChangeset for help on using the changeset viewer.