Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remote integration tests

  • Loading branch information...
commit fd45de5475c8e14b21f8f924d476f99d39e72b13 1 parent 21d8969
@kmayer kmayer authored
View
2  cucumber.yml
@@ -0,0 +1,2 @@
+default: --tags ~@slow_process
+remote: --tags @slow_process
View
56 features/remote.feature
@@ -0,0 +1,56 @@
+@announce @slow_process
+Feature: Works with Heroku
+
+ Background:
+ Given I run `git clone git://github.com/kmayer/heroku_san_demo.git`
+ And I cd to "heroku_san_demo"
+
+ Scenario: Remote commands
+ When I run `rake demo deploy`
+ Then the output should match /(http:.*-demo.heroku.com deployed to Heroku)|(Everything up-to-date)/
+
+ When I run `rake demo heroku:maintenance_on`
+ Then the output should contain "Maintenance mode enabled."
+
+ When I run `rake demo migrate`
+ Then the output should contain "Migrating to CreateDroids"
+
+ When I run `rake demo restart`
+ Then the output should contain "Restarting processes... done"
+
+ When I run `rake demo heroku:maintenance_off`
+ Then the output should contain "Maintenance mode disabled."
+
+ When I run `rake demo heroku:rake[db:seed]`
+ Then I run `curl -s http://heroku-san-demo-demo.heroku.com/droids.text`
+ And the output should contain "C3PO, Marvin, R2D2, Robby"
+
+ When I run `rake demo logs`
+ Then the output should contain "Starting process with command `rake db:seed`"
+
+ When I run `git co staging`
+ And I run `rake deploy`
+ Then the output should match /(http:.*-staging.heroku.com deployed to Heroku)|(Everything up-to-date)/
+ When I run `curl -s http://heroku-san-demo-staging.heroku.com`
+ And the output should contain "Ruby on Rails: Welcome aboard"
+
+ # Runs a before_deploy
+ # Runs an after_deploy
+ # Adds a collaborator
+
+# Given I run `rake heroku:create_config`
+
+# When I run `rake demo heroku:create`
+# Then the output should contain "somthing about the created app"
+# $ rake all heroku:create
+# heroku create heroku-san-demo-demo
+# Creating heroku-san-demo-demo.... done, stack is bamboo-mri-1.9.2
+# http://heroku-san-demo-demo.heroku.com/ | git@heroku.com:heroku-san-demo-demo.git
+# Git remote heroku added
+# heroku create heroku-san-demo-production
+# Creating heroku-san-demo-production... done, stack is bamboo-mri-1.9.2
+# http://heroku-san-demo-production.heroku.com/ | git@heroku.com:heroku-san-demo-production.git
+# heroku create heroku-san-demo-staging
+# Creating heroku-san-demo-staging... done, stack is bamboo-mri-1.9.2
+# http://heroku-san-demo-staging.heroku.com/ | git@heroku.com:heroku-san-demo-staging.git
+
View
5 features/support/env.rb
@@ -6,3 +6,8 @@
unless File.readable? File.join(File.dirname(__FILE__), '..', 'data', 'test-config', 'config.yml')
`git submodule init && git submodule update`
end
+
+Before('@slow_process') do
+ # @aruba_io_wait_seconds = 15
+ @aruba_timeout_seconds = 60
+end
View
2  heroku_san.gemspec
@@ -24,10 +24,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<rails>, ['>= 2'])
s.add_runtime_dependency(%q<heroku>)
s.add_runtime_dependency(%q<rake>)
- s.add_development_dependency(%q<rails>, ['>= 3'])
s.add_development_dependency(%q<aruba>)
s.add_development_dependency(%q<cucumber>)
s.add_development_dependency(%q<rake>)
+ s.add_development_dependency(%q<bundler>, ['1.0.7'])
else
s.add_dependency(%q<rails>, ['>= 2'])
s.add_dependency(%q<heroku>)
View
4 lib/heroku_san/tasks.rb
@@ -157,9 +157,9 @@
end
desc 'Runs a rake task remotely'
- task :rake, :task do |t, args|
+ task :rake, [:task] do |t, args|
each_heroku_app do |stage, app, repo|
- sh "heroku run --app #{app} rake #{args[:task]}"
+ sh "heroku run:rake #{args.task} --app #{app}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.