r8910: rework so that tests are automatically run for multiple backends
[clsql.git] / tests / README
1 * RUNNING THE REGRESSION SUITE
2
3 Create a .clsql-tests.config file in your home directory.
4 See test-init.lisp for the structure of the data.
5
6 Load clsql.asd or put it somewhere where ASDF can find it
7 and call:
8
9 (asdf:oos 'asdf:test-op 'clsql)
10
11 The test suite will then automatically run on all of the backends that
12 you have defined in .clsql-tests.config
13
14 * REGRESSION TEST SUITE GOALS
15
16 The intent of this test suite is to provide sufficient coverage for
17 the system to support the following:
18
19 ** Refactoring and Redesign of particular subsystems
20
21 Refactoring and redesign efforts are normally restricted to a single
22 subsystem, or perhaps to interdependent subsystems.  In such cases, a
23 set of regression tests which excercise the existing interface of the
24 rest of CLSQL to the changing subsystems should be in place and passing
25 before the coding starts.
26
27 ** Ensuring portability and Supporting new ports.
28
29 The more coverage the test suite provides the easier portability is to
30 maintain, particularly if we have instances of the test suite running
31 against the head on the supporting lisp environment/OS/hardware/DBMS
32 combinations.  Since no individual within the project has the ability
33 to run all of those combinations themselves, we are dependent upon some
34 informal coordination between the mintainers of the various ports.
35
36 ** Adding new RDBMS backends
37
38 The entire CLSQL DBMS interface needs to be excercised by the test
39 suite, such that a new RDBMS backend that passes all the tests can be
40 reasonably assured of working with the CLSQL layers above that.  These
41 tests should also serve as impromptu documentation for the details of
42 that interface and what it expects frothe RDBMS driver layers.
43
44 ** Bug identification and QA
45
46 As new bugs are identified, they should have a regression test written
47 which excercises them. This is to ensue that we donot start
48 backtracking. These tests by theselves are also very valuable for
49 developers, so even if you cannot fix a bug yourself, providing a
50 testto excercise it greatly reduces the amount of timea developer must
51 spend finding the bug prior to fixing it.
52
53
54 * TEST DESIGN ISSUES
55
56 ** Multiple RDBMS Issues
57
58 CLSQL supports several RDBMS backends, and it should be possible to run
59 every test against all of them.  However, there are some features
60 which we want tests for but which are not implemented on several of
61 the backends.  
62
63 ** Test Hygiene
64
65 Tests should be able to be run multiple times against the same
66 database.  It is also important that they clean up after themselves
67 when they create tables, sequences or other pesistent entities in the
68 RDBMS backends, because often there are limits to the number of those
69 thatcan exist at one time, and it also makes debuging thru the SQL
70 monitors difficult when there aretons of unused tables lying around.
71
72 If test need to load large datasets, they should have a mechanism to
73 ensure the dataset is loaded just once, and not with every test run.
74
75 Lastly, because there are various idiosyncracies with RDBMSs, please
76 ensure that you run the entire test suite once when you write your
77 tests, to ensure that your test does not leave some state behind which
78 causes other tests to fail.
79
80 ** Test Run Configuration
81
82 The file test-init.lisp defines several variables which can be used to
83 control the connection dictionary of the database against which tests
84 will be run.  
85
86
87 * DATABASE CONNECTIONS/LIFECYCLE
88
89 ** CreateDB
90    *** Without existing DB
91    *** With existing DB and use old
92    *** With existing DB and use new
93    *** Error if existing DB
94
95 ** Data Definition
96   *** Create Tables/Sequences/Indexes -- Should cover creation of
97       tables with all supported types of fields.
98   *** Delete Tables/Sequences/Indexes
99   *** Inspection of Tables and attributes, including types
100
101 ** Data Manipulation
102   *** Update
103   *** Insert
104   *** Delete
105   *** Query
106
107 ** Functional Interface
108   *** Creation/Modification of SQL expressions
109   *** Querying
110
111 ** Embedded SQL syntax
112   *** Excercise all sql operators
113   
114 ** Object Interface
115   *** View class definition
116   *** Object creation/manipulation/deletion
117   *** Inter-object Relations
118
119 ** Editing Contexts
120   *** Object Create/Modification/Deletion in a context -- partly covered already
121   *** Interaction of multiple contexts
122   *** Schema manipulation within a context
123   *** Rollback and error handling within a context