I'm trying to run the unit tests for CPK from the current master and having no success. My ultimate goal is to fix issue #98 in the oracle_enhanced adapter[1].
Following the directions in test/README_tests.txt, I've:
* Installed AR 3.1
* Installed the gems that the adapters I'm using depend on (pg 0.11.0 and sqlite3 1.3.4)
* Set up databases.yml
* Run the appropriate *:build_databases tasks
When I try to run the actual tests I get this output:
----
$ rake sqlite3:test
/Users/rsutphin/ruby/composite_primary_keys/lib/composite_primary_keys/version.rb:3: warning: already initialized constant MAJOR
/Users/rsutphin/ruby/composite_primary_keys/lib/composite_primary_keys/version.rb:4: warning: already initialized constant MINOR
/Users/rsutphin/ruby/composite_primary_keys/lib/composite_primary_keys/version.rb:5: warning: already initialized constant TINY
/Users/rsutphin/ruby/composite_primary_keys/lib/composite_primary_keys/version.rb:6: warning: already initialized constant STRING
/Users/rsutphin/ruby/composite_primary_keys/test/test_associations.rb:1:in `require': no such file to load -- ./abstract_unit (LoadError)
from /Users/rsutphin/ruby/composite_primary_keys/test/test_associations.rb:1
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/rsutphin/.rvm/gems/ruby-1.8.7-p352@cpk/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/Users/rsutphin/.rvm/rubies/ruby-1.8.7-p35...]
Tasks: TOP => subtest_sqlite3
----
(The output for PostgreSQL is very similar.)
I've also tried rake 0.8.7 and 0.9.2 on MRI 1.8.7-p352 and 1.9.2-p290; all combinations give the same result. I tried postgresql:test on the 3.1_series branch also; this gave the same result. Any idea what I'm missing?
Thanks,
Rhett
On Sep 15, 2011, at 9:53 PM, cfis wrote:
> Are you still having issues? Make sure you are in the test directory
> to run tests - note the require './abstract_unit.rb'.
Yeah, I noticed that. I get the same output running `rake sqlite3:test` from either the root or the test directory. Since rake uses the directory where the Rakefile is as the working directory (i.e., not the directory `rake` was called from), I'm not surprised by this. But since the README_tests.txt document indicates that rake should work, I wondered if I might be missing something.
Would you be interested in a pull request that eliminates the relative paths in the test suite? I'd replace them with the usual File.expand_path('../something', __FILE__) pattern.
>
> I haven't been testing the oracle adapter, so you may run into issues
> there that need cleaning up. If so, send me a pull request on github.
Will do.
Rhett
>
> Thanks - Charlie
>
> --
> You received this message because you are subscribed to the Google Groups "Composite Keys for ActiveRecord" group.
> To post to this group, send email to compos...@googlegroups.com.
> To unsubscribe from this group, send email to compositekey...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/compositekeys?hl=en.
>