Grand-prix

Tests, stress-test and performance-tests for Common Lisp object-databases and persistence libraries.

Why?

Classes

a set of test cases that work against the same data

an implementation of a circuit for a database/persistence solution

Running the tests

In theory, if you got all dependencies in place and were lucky:

(asdf:operate 'asdf:load-op :grand-prix)
(asdf:operate 'asdf:load-op :grand-prix-rucksack) ;; If you have rucksack
(asdf:operate 'asdf:load-op :grand-prix-elephant) ;; If you have grand-prix
(asdf:operate 'asdf:load-op :grand-prix-perec) ;; If you have cl-perec
(grand-prix:run-grand-prix)

Adding a test

  1. Find the name of a Formula one track. In this example I choose boavista from wikipedia.
  2. Make a subdirectory boavista under circuits.
  3. Make an empty lisp file boavista.lisp.
  4. Add an empty class boavista that inherits circuit. This is the test.
  5. Add an empty class called boavista-driver. This will be the interface that different databases needs to implement to run you test.
  6. Implement a run-circuit method that takes your new circuit and driver. Optional, implement a clean-up method on your circuit.
  7. Add the new circuit to grand-prix.asd.
  8. Add the new circuit to circuits parameter in grand-prix.lisp
  9. Darcs add all you new files. darcs record, darcs send -o boavista.patch. Write a mail to the mailing list and attach boavista.patch

Sample code is in boavista-sample.lisp

Implementing a test for a backend

If you looked the sample code doc/boavista.lisp you see that a boavista-driver needs to implement five methods.

So, if you are implementing it for one of the provided backends, for example elephant, add a file elephant-boavista-driver.lisp to drivers/elephant.

Add the lisp file to the asd file in /drivers/elephant.

In the new elephant-boavista-driver.lisp file, create an empty class elephant-boavista that inherits boavista-driver.

Now implement all methods for the elephant-boavista class. make-clean-db, add-person, export-db, import-to-new-db and query-all-persons-name-and-age.

To register the driver class when loaded, add this form:

(grand-prix:register-driver-class 'elephant-boavista-driver)

Darcs record, darcs send or push.