From 3b56e56262b2c1a9d014d5ab9434d192d474dcfd Mon Sep 17 00:00:00 2001 From: Ken Mayer Date: Tue, 22 Oct 2013 15:06:19 -0700 Subject: [PATCH] Allow integration tests to run on Travis - Use addons that do not require verification - Add cucumber and travis tasks --- .travis.yml | 5 +++++ Gemfile | 24 +++++++++++++---------- Rakefile | 17 ++++++++++++++++ features/step_definitions/remote_steps.rb | 5 +++-- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6efc37..a9d0955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ language: ruby +bundler_args: --without development +script: "rake travis" rvm: - 1.9.2 - 1.9.3 - 2.0.0 +env: + global: + - secure: dAxfEdg/7Cb/G9vkrn/ifdvycbXWtK2ey60JMepOxx9v3QyaqoSY3w5G0QB+4+uyOYmHwtif8tnK3Sa8jbBgqhAlXaxqxOT8WmQKYlhSgwWX4lQe4lUM5jkOkfNHRMRaQvCAn27gNAjdIRU7sb2cU/pm64eAFbU01TejJOM7Aow= diff --git a/Gemfile b/Gemfile index fecc2ed..e002f67 100644 --- a/Gemfile +++ b/Gemfile @@ -3,21 +3,25 @@ source 'https://rubygems.org' # Specify dependencies in heroku_san.gemspec gemspec -group :development do - gem 'rails', '>= 2' - gem 'rspec' +group :test do gem 'aruba' + gem 'bundler', '~> 1.1' gem 'cucumber' + gem 'godot' + gem 'rails', '>= 2' gem 'rake' - gem 'bundler', '~> 1.1' + gem 'rspec' +end + +group :development do gem 'git-smart' - gem 'godot' gem 'guard' - gem 'rb-inotify', :require => false - gem 'rb-fsevent', :require => false - gem 'rb-fchange', :require => false - gem 'terminal-notifier-guard' - gem 'guard-rspec' gem 'guard-bundler' gem 'guard-cucumber' + gem 'guard-rspec' + gem 'rb-fchange', :require => false + gem 'rb-fsevent', :require => false + gem 'rb-inotify', :require => false + gem 'terminal-notifier-guard' + gem 'travis', '~> 1.5.6' end diff --git a/Rakefile b/Rakefile index 0a8becb..140be50 100644 --- a/Rakefile +++ b/Rakefile @@ -3,6 +3,8 @@ require 'rubygems' require 'bundler/setup' require 'bundler/gem_tasks' require 'rspec/core/rake_task' +require 'cucumber' +require 'cucumber/rake/task' desc 'Default: run unit tests.' task :default => :spec @@ -11,3 +13,18 @@ desc "Run all specs" RSpec::Core::RakeTask.new do |t| t.pattern = 'spec/**/*_spec.rb' end + +namespace 'cucumber' do + Cucumber::Rake::Task.new(:remote) do |t| + t.profile = "remote" + end + + Cucumber::Rake::Task.new(:default) do |t| + t.profile = "default" + end +end + +desc "Run travis test suite" +task :travis => [:spec, 'cucumber:default', 'cucumber:remote'] + +# for app in `heroku apps | tail +2`; do heroku apps:destroy --app $app --confirm $app; done diff --git a/features/step_definitions/remote_steps.rb b/features/step_definitions/remote_steps.rb index 7d7f0d3..b08f2bc 100644 --- a/features/step_definitions/remote_steps.rb +++ b/features/step_definitions/remote_steps.rb @@ -201,13 +201,14 @@ def run_clean(cmd) test_app: app: #{@app} addons: - - scheduler:standard + - heroku-postgresql:dev + - pgbackups:plus END_CONFIG output = run_clean 'rake test_app heroku:addons' # The output should show the new one ... - assert_partial_output "scheduler:standard", output + assert_partial_output "heroku-postgresql:dev", output end Then /^(?:heroku_san|issue \d+) (?:is green|has been fixed)$/ do