1 = Composite Primary Keys - Testing Readme
5 There are tests available for the following adapters:
13 To run the tests for on of the adapters, follow these steps (using mysql in the example):
15 * rake -T | grep mysql
17 rake mysql:build_databases # Build the MySQL test databases
18 rake mysql:drop_databases # Drop the MySQL test databases
19 rake mysql:rebuild_databases # Rebuild the MySQL test databases
20 rake test_mysql # Run tests for test_mysql
22 * rake mysql:build_databases
25 == Testing against different ActiveRecord versions (or Edge Rails)
27 ActiveRecord is a RubyGem within Rails, and is constantly being improved/changed on
28 its repository (http://dev.rubyonrails.org). These changes may create errors for the CPK
29 gem. So, we need a way to test CPK against Edge Rails, as well as officially released RubyGems.
31 The default test (as above) uses the latest RubyGem in your cache.
33 You can select an older RubyGem version by running the following:
35 * rake ar:set VERSION=1.14.4 test_mysql
39 Before you can test CPK against Edge Rails, you must checkout a copy of edge rails somewhere (see http://dev.rubyonrails.org for for examples)
42 * svn co http://svn.rubyonrails.org/rails/trunk rails
44 Say the rails folder is /path/to/gems/rails
46 Three ways to run CPK tests for Edge Rails:
50 EDGE_RAILS_DIR=/path/to/gems/rails rake ar:edge test_mysql
52 ii) In your .profile, set the environment variable EDGE_RAILS_DIR=/path/to/gems/rails,
53 and once you reload your profile, run:
55 rake ar:edge test_mysql
57 iii) Store the path in local/paths.rb. Run:
59 cp local/paths.rb.sample local/paths.rb
60 # Now set ENV['EDGE_RAILS_DIR']=/path/to/gems/rails
61 rake ar:edge test_mysql
63 These are all variations of the same theme:
65 * Set the environment variable EDGE_RAILS_DIR to the path to Rails (which contains the activerecord/lib folder)
66 * Run: rake ar:edge test_<adapter>