features/step_definitions/ci_steps.rb in lobot-0.10.3 vs features/step_definitions/ci_steps.rb in lobot-1.0.pre
- old
+ new
@@ -6,13 +6,13 @@
Given /^I am in the temp directory$/ do
Dir.chdir(LOBOT_TEMP_DIRECTORY)
end
When /^I create a new Rails project$/ do
- system!("rvm ruby-1.9.3-p125 do rvm gemset create testapp")
+ system!("rvm ruby-1.9.3-p194 do rvm gemset create testapp")
system!("rails new testapp")
- system!("cd testapp && echo 'rvm use ruby-1.9.3-p125@testapp' > .rvmrc")
+ system!("cd testapp && echo 'rvm use ruby-1.9.3-p194@testapp' > .rvmrc")
end
When /^I vendor Lobot$/ do
lobot_dir = File.expand_path('../../', File.dirname(__FILE__))
system! "cd #{lobot_dir} && rake build"
@@ -54,11 +54,10 @@
raise "Missing private SSH key for AWS!" unless File.exist?(File.expand_path("~/.ssh/id_github_current"))
ci_conf_location = 'testapp/config/ci.yml'
ci_yml = YAML.load_file(ci_conf_location)
ci_yml.merge!(
'app_name' => 'testapp',
- 'app_user' => 'testapp-user',
'git_location' => 'git@github.com:pivotalprivate/ci-smoke.git',
'basic_auth' => [{ 'username' => 'testapp', 'password' => 'testpass' }],
'credentials' => { 'aws_access_key_id' => secrets['aws_access_key_id'], 'aws_secret_access_key' => secrets['aws_secret_access_key'], 'provider' => 'AWS' },
'ec2_server_access' => {'key_pair_name' => "lobot_cucumber_key_pair_#{hostname}", 'id_rsa_path' => '~/.ssh/id_github_current'},
'github_private_ssh_key_path' => secrets["github_private_ssh_key_path"]
@@ -77,11 +76,12 @@
system! "echo 'config/ci.yml' >> testapp/.gitignore"
["headless", "rspec-rails", "jasmine"].each do |gem|
system!(%{echo "gem '#{gem}'" >> testapp/Gemfile})
end
system!("cd testapp && bundle install")
- system!("cd testapp && bundle exec jasmine init .")
+ system!("cd testapp && bundle exec rails g jasmine:install")
+ system!("cd testapp && bundle exec rails g jasmine:examples")
system!(%{cd testapp && echo "task :default => 'jasmine:ci'" >> Rakefile})
spec_contents = <<-RUBY
require 'rspec'
@@ -108,10 +108,13 @@
system! "cd testapp && git push --force -u origin master"
end
When /^I start the server$/ do
system! "cd testapp && bundle exec rake ci:create_server"
+ server_ip = YAML.load(File.read('testapp/config/ci.yml'))["server"]["elastic_ip"]
+ system! "cat ~/.ssh/known_hosts | grep -v #{server_ip} > /tmp/known_hosts"
+ system! "mv /tmp/known_hosts ~/.ssh/known_hosts"
end
When /^I bootstrap$/ do
system!("cd testapp && bundle install")
system! "cd testapp && bundle exec cap ci bootstrap"
@@ -120,27 +123,15 @@
When /^I deploy$/ do
system! "cd testapp && cap ci chef"
end
Then /^CI is green$/ do
- Timeout::timeout(300) do
+ Timeout::timeout(600) do
until system("cd testapp && bundle exec rake ci:status")
sleep 5
end
end
end
Then /^rake reports ci tasks as being available$/ do
`cd testapp && bundle exec rake -T`.should include("ci:start_server")
end
-
-Then /^TeamCity is installed$/ do
- ci_conf_location = 'testapp/config/ci.yml'
- ci_yml = YAML.load_file(ci_conf_location)
-
- Timeout::timeout(400) do
- until system("wget http://#{ci_yml['server']['elastic_ip']}:8111")
- sleep 5
- end
- end
-end
-