source: ndgCommon/trunk/ndg/common/unittests/README.txt @ 5011

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ndgCommon/trunk/ndg/common/unittests/README.txt@5011
Revision 5011, 2.0 KB checked in by cbyrom, 11 years ago (diff)

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.

Line 
1ndgCommon testsuite - overview
2--------------------------------
3
4The test suite can be ran as a whole by running the 'noseTests.py' class as
5a python app - otherwise, individual test classes can be ran as unittests.
6
7Setting up test environment:
8----------------------------
9
10i) Some tests require an eXist DB config file, 'exist.config' to
11be available - in the unittests/testdata directory.  This should provide access
12details to the required eXist database in the following format:
13
14hostname user password
15
16ii) Additionally, the testpostgresclient.py tests require a config file at:
17
18unittests/testdata/pg.config with the format:
19
20databaseName hostName userName password port
21
22- obviously, these will have to point to a running instance of postgres
23
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!
28
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:
32
33unittests/testdata/ndgDiscovery.config
34
35should be adjusted so that the DEFAULT server value points to this server.
36
37Errors
38-----------
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.
43
44NB, the errors usually encountered are like:
45
46error: (10048, 'Address already in use')
47
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...
52
53
54
Note: See TracBrowser for help on using the repository browser.