So You Want To Change Your Schema

This is a very brief overview of how to write upgrade tests for Axiom. I hope someone else will clean it up and add more information. This assumes familiarity with Axiom, Divmod project layout, trial unit tests, Combinator, and probably a dozen other things.

In order to understand the following you will need to look at these two modules: axiom.test.historic.stub_catalog1to2 and axiom.test.historic.test_catalog1to2

Do Stuff

  1. write a file, (this should look vaguely like the aforementioned in your project’s tests/historic directory, named appropriately for your object and versions. This is written using the old API, the one present in trunk before your branch is merged.

  2. the number in the call to saveStub is the revision of $COMBINATOR_PROJECTS/Divmod/trunk when you are writing the upgrader.

  3. % cd $COMBINATOR_PROJECTS/Divmod/branches/foo-19191919/Foo/foo/test/historic/
    % chbranch Divmod trunk
    % python # this will create a file called 'foo1to2.axiom.tbz2'.
    % svn add foo1to2.axiom.tbz2
  4. write (this should look vaguely like the aforementioned, and it works like a regular trial test, except for loading your stub database automatically.