Permalink
Browse files

Start running SQLite/PostgreSQL/MySQL adapter tests on TravisCI

These are the most common adapters, so I think it makes sense to
test them on TravisCI for additional assurance.
  • Loading branch information...
1 parent 90d084d commit 038b0e37e00a4a76e71355dfdb304aa030873550 @jeremyevans committed Jun 5, 2012
Showing with 29 additions and 1 deletion.
  1. +12 −0 .travis.gemfile
  2. +4 −1 .travis.yml
  3. +13 −0 Rakefile
View
@@ -4,7 +4,19 @@ source 'http://rubygems.org'
gem 'rake'
gem 'rspec', '<2.10.0'
+
+# Plugin/Extension Dependencies
gem 'tzinfo'
gem 'activemodel'
gem 'nokogiri'
gem 'json'
+
+# MRI/Rubinius Adapter Dependencies
+gem "sqlite3", :platform => :ruby
+gem "mysql2", :platform => :ruby
+gem "pg", :platform => :ruby
+
+# JRuby Adapter Dependencies
+gem 'jdbc-sqlite3', :platform => :jruby
+gem 'jdbc-mysql', :platform => :jruby
+gem 'jdbc-postgres', :platform => :jruby
View
@@ -10,5 +10,8 @@ rvm:
- ruby-head
- jruby-head
- ree
-script: bundle exec rake spec spec_plugin
+script: bundle exec rake spec_travis
gemfile: .travis.gemfile
+before_script:
+ - mysql -e 'create database sequel_test;'
+ - psql -c 'create database myapp_test;' -U postgres
View
@@ -138,6 +138,19 @@ begin
%w'postgres sqlite mysql informix oracle firebird mssql db2'.each do |adapter|
spec_with_cov.call("spec_#{adapter}", ["spec/adapters/#{adapter}_spec.rb"] + Dir["spec/integration/*_test.rb"], "Run #{adapter} specs"){|t| t.rcov_opts.concat(%w'--exclude "lib/sequel/([a-z_]+\.rb|connection_pool|database|dataset|model|extensions|plugins)"')}
end
+
+ task :spec_travis=>[:spec, :spec_plugin, :spec_sqlite] do
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
+ ENV['SEQUEL_PG_SPEC_DB'] = "jdbc:postgresql://localhost/sequel_test?user=postgres"
+ ENV['SEQUEL_MY_SPEC_DB'] = "jdbc:mysql://localhost/sequel_test?user=root"
+ else
+ ENV['SEQUEL_PG_SPEC_DB'] = "postgres://localhost/sequel_test?user=postgres"
+ ENV['SEQUEL_MY_SPEC_DB'] = "mysql2://localhost/sequel_test?user=root"
+ end
+
+ Rake::Task['spec_postgres'].invoke
+ Rake::Task['spec_mysql'].invoke
+ end
desc "Run model specs without the associations code"
task :spec_model_no_assoc do

0 comments on commit 038b0e3

Please sign in to comment.