Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test gem install improvements

- Test setting BUNDLE_WITHOUT

- Test exclusion of gems that don't match
:platform in Gemfile

- Test Gemfile.locks from Windows

Change-Id: Ied58865e7a9ad76ed75e414bffd6bcd7dd4e4e39
  • Loading branch information...
commit 433c924c81be2c9ed63a1a668ada4fb03c9e4759 1 parent c514fcf
Jennifer Hickey authored
View
79 features/rubygems.feature
@@ -2,7 +2,7 @@
Feature: Deploy the sinatra canonical app with bad gem
As a user with all canonical apps
- I want to deploy a sinatra app with a gem containing an invalid date
+ I want to deploy Ruby apps and have gems properly installed
Background: deploying canonical service
Given I have registered and logged in
@@ -14,3 +14,80 @@ Feature: Deploy the sinatra canonical app with bad gem
Then I should be able to access my application root and see hello from sinatra
When I delete my application
Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app without specifying BUNDLE_WITHOUT
+ Given I have deployed my application named sinatra_gem_groups
+ # Verify test gems are not installed by default
+ Then I should be able to access my application file logs/staging.log and not get text including Adding rspec-2.11.0.gem to app
+ Then I should be able to access my application file app/.bundle/config and get text including BUNDLE_WITHOUT: test
+ Then I should be able to access my application root and see hello from sinatra
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app specifying BUNDLE_WITHOUT
+ Given I have deployed my application named sinatra_gem_groups without starting
+ Then I set sinatra_gem_groups environment variable BUNDLE_WITHOUT to development
+ Then I start my application named sinatra_gem_groups
+ # Verify gem belonging to test and development group is installed and gem belonging only to development group is not
+ Then I should be able to access my application file logs/staging.log and get text including Adding thor-0.15.4.gem to app
+ Then I should be able to access my application file logs/staging.log and not get text including Adding rubyzip-0.9.9.gem to app
+ Then I should be able to access my application file app/.bundle/config and get text including BUNDLE_WITHOUT: development
+ Then I should be able to access my application root and see hello from sinatra
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app setting BUNDLE_WITHOUT to multiple groups
+ Given I have deployed my application named sinatra_gem_groups without starting
+ Then I set sinatra_gem_groups environment variable BUNDLE_WITHOUT to development:test
+ Then I start my application named sinatra_gem_groups
+ # Verify gems belonging to test and/or development groups are not installed
+ Then I should be able to access my application file logs/staging.log and not get text including Adding thor-0.15.4.gem to app
+ Then I should be able to access my application file logs/staging.log and not get text including Adding rubyzip-0.9.9.gem to app
+ Then I should be able to access my application file logs/staging.log and not get text including Adding rspec-2.11.0.gem to app
+ Then I should be able to access my application file app/.bundle/config and get text including BUNDLE_WITHOUT: development:test
+ Then I should be able to access my application root and see hello from sinatra
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app setting BUNDLE_WITHOUT blank to override default
+ Given I have deployed my application named sinatra_gem_groups without starting
+ Then I set sinatra_gem_groups environment variable BUNDLE_WITHOUT to
+ Then I start my application named sinatra_gem_groups
+ # Verify gems belonging to all groups are installed
+ Then I should be able to access my application file logs/staging.log and get text including Adding thor-0.15.4.gem to app
+ Then I should be able to access my application file logs/staging.log and get text including Adding rubyzip-0.9.9.gem to app
+ Then I should be able to access my application file logs/staging.log and get text including Adding rspec-2.11.0.gem to app
+ Then I should be able to access my application file app/.bundle/config and not get text including BUNDLE_WITHOUT
+ Then I should be able to access my application root and see hello from sinatra
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app with Gemfile.lock containing Windows versions
+ Given I have deployed my application named sinatra_windows_gemfile
+ # Verify gem for mswin platform is not installed
+ Then I should be able to access my application file logs/staging.log and not get text including Adding yajl-ruby-0.8.3.gem to app
+ # Verify non-Windows versions of gems are installed
+ Then I should be able to access my application file logs/staging.log and get text including Adding mysql2-0.3.11.gem to app
+ Then I should be able to access my application file logs/staging.log and get text including Adding pg-0.14.0.gem to app
+ # mysql2 and pg gems had Windows-specific versions in Gemfile.lock. Make sure we can use them.
+ When I provision mysql service
+ Then I post mysqlabc to mysql service with key abc
+ Then I should be able to get from mysql service with key abc, and I should see mysqlabc
+ Then I delete my service
+ When I provision postgresql service
+ Then I post postgresqlabc to postgresql service with key abc
+ Then I should be able to get from postgresql service with key abc, and I should see postgresqlabc
+ Then I delete my service
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ Scenario: sinatra test deploy app containing gems specifying a ruby platform
+ Given I have deployed my application named sinatra_gem_groups
+ # Verify gem for ruby_18 platform is installed, ruby_19 gem is not
+ Then I should be able to access my application file logs/staging.log and get text including Adding uglifier-1.2.6.gem to app
+ Then I should be able to access my application file logs/staging.log and not get text including Adding yajl-ruby-0.8.3.gem to app
+ Then I should be able to access my application root and see hello from sinatra
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+
View
7 features/step_definitions/appcloud_steps.rb
@@ -691,7 +691,7 @@
end
-Then /^I should be able to access my application file (\S+) and get text including (.+)$/ do |file, expected_contents|
+Then /^I should be able to access my application file (\S+) and( not)? get text including (.+)$/ do |file, not_expected, expected_contents|
@instance = '0'
response = get_app_files @app, @instance, file, @token
response.should_not == nil
@@ -700,7 +700,7 @@
responses.each do |response|
matched = true if response=~ /#{Regexp.escape(expected_contents)}/
end
- matched.should == true
+ matched.should == (not_expected ? false : true)
end
Then /^I should be able to list application files and not find file (\S+)$/ do |file|
@@ -979,6 +979,7 @@
contents.close
end
-Then /^I set (\w+) environment variable (\w+) to (\w+)$/ do |app, env_name, env_value|
+Then /^I set (\w+) environment variable (\w+) to( \S+)?$/ do |app, env_name, env_value|
+ env_value = env_value.strip if env_value
environment_add app, env_name, env_value
end
View
10 features/support/testconfig.yml
@@ -211,6 +211,16 @@ sinatra_autoconfig_disabled_by_gem:
memory: 64
path: "assets/sinatra/autoconfig_disabled_by_gem"
+sinatra_gem_groups:
+ framework: "sinatra"
+ memory: 256
+ path: "assets/sinatra/gem_groups"
+
+sinatra_windows_gemfile:
+ framework: "sinatra"
+ memory: 256
+ path: "assets/sinatra/windows_gemfile"
+
app_node_service:
framework: "node"
runtime: node
Please sign in to comment.
Something went wrong with that request. Please try again.