From 3e3e9055c0a092922ea6bb17727114ab2eef583f Mon Sep 17 00:00:00 2001 From: Micah Geisel Date: Fri, 25 May 2018 19:41:12 -0700 Subject: [PATCH] test all adapters in travis run. --- .travis.yml | 9 +-------- Rakefile | 19 +++++++++++-------- .../database_cleaner-active_record/bin/setup | 4 ++-- .../database_cleaner-couch_potato/bin/setup | 3 +-- .../database_cleaner-data_mapper/Gemfile.lock | 1 - .../database_cleaner-data_mapper/bin/setup | 4 ++-- adapters/database_cleaner-mongo/bin/setup | 3 +-- .../database_cleaner-mongo_mapper/bin/setup | 3 +-- adapters/database_cleaner-mongoid/bin/setup | 3 +-- adapters/database_cleaner-moped/bin/setup | 3 +-- adapters/database_cleaner-neo4j/bin/setup | 3 +-- adapters/database_cleaner-ohm/bin/setup | 3 +-- adapters/database_cleaner-redis/bin/setup | 3 +-- adapters/database_cleaner-sequel/bin/setup | 4 ++-- bin/setup | 12 ++++++++++++ 15 files changed, 38 insertions(+), 39 deletions(-) create mode 100755 bin/setup diff --git a/.travis.yml b/.travis.yml index de3f35a..ee447d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,6 @@ rvm: - 2.0.0 - 2.1 - 2.2 -script: - - bundle exec rspec - - bundle exec cucumber -gemfile: - - Gemfile before_install: - | # cached install of Neo4j locally: if [ ! -d neo4j-community-2.3.3/bin ]; @@ -20,9 +15,7 @@ before_install: fi before_script: - neo4j-community-2.3.3/bin/neo4j start - - mysql -e 'create database database_cleaner_test;' - - psql -c 'create database database_cleaner_test;' -U postgres - - cp db/sample.config.yml db/config.yml + - bin/setup services: - redis-server - mongodb diff --git a/Rakefile b/Rakefile index 63e0df9..afc3962 100644 --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,6 @@ require 'rake' require 'rspec/core' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |spec| - spec.pattern = FileList['spec/**/*_spec.rb'] end @@ -15,15 +14,19 @@ RSpec::Core::RakeTask.new(:rcov) do |spec| spec.rcov = true end -begin - require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) -rescue LoadError - puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" +require 'cucumber/rake/task' +Cucumber::Rake::Task.new(:features) + +desc "Run adapter test suites" +task :adapters do + Dir["adapters/*"].each do |adapter_dir| + Dir.chdir adapter_dir do + sh "bundle exec rake" + end + end end -task :default => [:spec, :features] - +task :default => [:spec, :features, :adapters] desc "Cleans the project of any tmp file that should not be included in the gemspec." task :clean do diff --git a/adapters/database_cleaner-active_record/bin/setup b/adapters/database_cleaner-active_record/bin/setup index dce67d8..268b1b4 100755 --- a/adapters/database_cleaner-active_record/bin/setup +++ b/adapters/database_cleaner-active_record/bin/setup @@ -3,6 +3,6 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install +cp spec/support/sample.config.yml spec/support/config.yml -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-couch_potato/bin/setup b/adapters/database_cleaner-couch_potato/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-couch_potato/bin/setup +++ b/adapters/database_cleaner-couch_potato/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-data_mapper/Gemfile.lock b/adapters/database_cleaner-data_mapper/Gemfile.lock index b5ba80d..7492677 100644 --- a/adapters/database_cleaner-data_mapper/Gemfile.lock +++ b/adapters/database_cleaner-data_mapper/Gemfile.lock @@ -94,7 +94,6 @@ DEPENDENCIES bundler (~> 1.16) database_cleaner! database_cleaner-data_mapper! - dm-migrations dm-sqlite-adapter rake (~> 10.0) rspec (~> 3.0) diff --git a/adapters/database_cleaner-data_mapper/bin/setup b/adapters/database_cleaner-data_mapper/bin/setup index dce67d8..268b1b4 100755 --- a/adapters/database_cleaner-data_mapper/bin/setup +++ b/adapters/database_cleaner-data_mapper/bin/setup @@ -3,6 +3,6 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install +cp spec/support/sample.config.yml spec/support/config.yml -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-mongo/bin/setup b/adapters/database_cleaner-mongo/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-mongo/bin/setup +++ b/adapters/database_cleaner-mongo/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-mongo_mapper/bin/setup b/adapters/database_cleaner-mongo_mapper/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-mongo_mapper/bin/setup +++ b/adapters/database_cleaner-mongo_mapper/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-mongoid/bin/setup b/adapters/database_cleaner-mongoid/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-mongoid/bin/setup +++ b/adapters/database_cleaner-mongoid/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-moped/bin/setup b/adapters/database_cleaner-moped/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-moped/bin/setup +++ b/adapters/database_cleaner-moped/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-neo4j/bin/setup b/adapters/database_cleaner-neo4j/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-neo4j/bin/setup +++ b/adapters/database_cleaner-neo4j/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-ohm/bin/setup b/adapters/database_cleaner-ohm/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-ohm/bin/setup +++ b/adapters/database_cleaner-ohm/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-redis/bin/setup b/adapters/database_cleaner-redis/bin/setup index dce67d8..3fc3387 100755 --- a/adapters/database_cleaner-redis/bin/setup +++ b/adapters/database_cleaner-redis/bin/setup @@ -3,6 +3,5 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install -# Do any other automated setup that you need to do here diff --git a/adapters/database_cleaner-sequel/bin/setup b/adapters/database_cleaner-sequel/bin/setup index dce67d8..268b1b4 100755 --- a/adapters/database_cleaner-sequel/bin/setup +++ b/adapters/database_cleaner-sequel/bin/setup @@ -3,6 +3,6 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle check || bundle install +cp spec/support/sample.config.yml spec/support/config.yml -# Do any other automated setup that you need to do here diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..d852b97 --- /dev/null +++ b/bin/setup @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle check || bundle install +cp spec/support/sample.config.yml spec/support/config.yml + +for adapter in adapters/*; do + (cd $adapter && bin/setup) +done +