diff --git a/Gemfile b/Gemfile index 2a32802..85831ba 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'ci_reporter' gem 'cfoundry', '~> 4.0.4.rc2' gem 'cf-uaa-lib' gem 'httparty' -gem 'blue-shell' +gem 'blue-shell', '~> 0.3.0' gem 'parallel_tests' group :monitoring do diff --git a/Gemfile.lock b/Gemfile.lock index d497a4a..1940870 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GEM activesupport (3.2.14) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - blue-shell (0.2.2) + blue-shell (0.3.0) rspec builder (3.0.4) cf-uaa-lib (1.3.10) @@ -49,7 +49,7 @@ PLATFORMS ruby DEPENDENCIES - blue-shell + blue-shell (~> 0.3.0) cf-uaa-lib cfoundry (~> 4.0.4.rc2) ci_reporter diff --git a/services_spec/managing_a_service_spec.rb b/services_spec/managing_a_service_spec.rb index abeb811..aa1f639 100644 --- a/services_spec/managing_a_service_spec.rb +++ b/services_spec/managing_a_service_spec.rb @@ -49,7 +49,9 @@ runner.should say "Bind other services to application?>" runner.send_keys "n" - runner.should say "Uploading #{app_name}... OK", 180 + runner.with_timeout 180 do + runner.should say "Uploading #{app_name}... OK" + end end set_app_signature_env_variable(app_name) diff --git a/services_spec/service_connector_spec.rb b/services_spec/service_connector_spec.rb index 11b076a..3d9f03c 100644 --- a/services_spec/service_connector_spec.rb +++ b/services_spec/service_connector_spec.rb @@ -53,7 +53,9 @@ runner.should say "Bind other services to application?>" runner.send_keys "n" - runner.should say "Uploading #{app_name}... OK", 180 + runner.with_timeout 180 do + runner.should say "Uploading #{app_name}... OK" + end end set_app_signature_env_variable(app_name) diff --git a/spec/loggregator_spec.rb b/spec/loggregator_spec.rb index 1b554e3..b825670 100644 --- a/spec/loggregator_spec.rb +++ b/spec/loggregator_spec.rb @@ -52,13 +52,15 @@ def check_loggregator_works puts "starting #{__method__} (#{Time.now})" BlueShell::Runner.run("gcf logs #{app_name}") do |runner| - runner.should say "Connected, tailing logs for app #{app_name}" - - # Hit twice to see that both router and app messages come through; order is not guaranteed - page_content - runner.should say "[RTR]" - page_content - runner.should say "[App/0]" + runner.with_timeout 60 do + runner.should say "Connected, tailing logs for app #{app_name}" + + # Hit twice to see that both router and app messages come through; order is not guaranteed + page_content + runner.should say "[RTR]" + page_content + runner.should say "[App/0]" + end end end diff --git a/spec/support/cf_helpers.rb b/spec/support/cf_helpers.rb index 1158161..818ec5f 100644 --- a/spec/support/cf_helpers.rb +++ b/spec/support/cf_helpers.rb @@ -59,20 +59,26 @@ def login cmd = "#{cf_bin} login #{username} --password #{password} -o #{org.name} -s #{space.name}" BlueShell::Runner.run(cmd) do |runner| - runner.wait_for_exit 60 + runner.with_timeout 60 do + runner.wait_for_exit + end end end def logout BlueShell::Runner.run("#{cf_bin} logout") do |runner| - runner.wait_for_exit 60 + runner.with_timeout 60 do + runner.wait_for_exit + end end end def set_target target = ENV['NYET_TARGET'] BlueShell::Runner.run("#{cf_bin} target #{target}") do |runner| - runner.wait_for_exit(20) + runner.with_timeout 20 do + runner.wait_for_exit + end end end @@ -116,14 +122,20 @@ def use_newest_cf def set_app_signature_env_variable(app_name) BlueShell::Runner.run("#{cf_bin} set-env #{app_name} APP_SIGNATURE #{app_signature}") do |runner| - runner.should say "Updating env variable APP_SIGNATURE for app #{app_name}... OK", 180 + runner.with_timeout 180 do + runner.should say "Updating env variable APP_SIGNATURE for app #{app_name}... OK" + end end end def start_app(app_name) BlueShell::Runner.run("#{cf_bin} start --trace #{app_name} 2>>#{tmp_dir}/cf_trace.log") do |runner| - runner.should say "Preparing to start #{app_name}... OK", 180 - runner.should say "Checking status of app '#{app_name}'", 180 + runner.with_timeout 180 do + runner.should say "Preparing to start #{app_name}... OK" + end + runner.with_timeout 180 do + runner.should say "Checking status of app '#{app_name}'" + end runner.should say "1 of 1 instances running" runner.should say "Push successful" end