RFC: Testing datasets for non-sideeffecting test-specific data.

Nathan Bird <[email protected]>
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
This mostly comes from previous email trying to figure out how to make
test inits run in the scope of a test. I thought about just changing
those class definitions to not use autoincrement, but that still falls
short, I believe, for the following reasons:
1. The test init file not only provides the framework for running tests
in clsql, but also contains several hundred lines of class definitions,
flat data and non-lexical variable declaration --cluttered
2. Individul tests are making efforts to not side effect any data, since
other tests may depend on that.  tests that fail are going to cause more
cascading failures which isn't friendly.
3. Loading the sample data is dependent upon a lot of features of clsql
already working-- e.g. view-classes

Here's my proposed fix code-sketch:
http://github.com/UnwashedMeme/clsql/blob/update-records-refactoring/tests/datasets.lisp

I tried to keep this from getting too long and just sketch the idea, but
wanted to make sure it was detailed enough that everyone knew what I was
proposing. I think this helps the problem by keeping setup/teardown to
within a test (fixes 1,2), and giving options for avoiding problem 3.

Please let me know what you think. Is this something that could be
included in the main branch?

Nathan Bird
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.