Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from maxlinc/test_runner
Browse files Browse the repository at this point in the history
Merged KNIFE-289 A framework for integration tests
  • Loading branch information
Matt Ray committed Jun 7, 2013
2 parents 5ac439b + ec305a8 commit c51061f
Show file tree
Hide file tree
Showing 13 changed files with 1,554 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .chef/knife.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
#node_name "knife-rackspace"
#client_key "#{current_dir}/knife-rackspace.pem"
#validation_client_name "knife-rackspace-validator"
#validation_key "#{current_dir}/knife-rackspace-validator.pem"
#chef_server_url "https://api.opscode.com/organizations/knife-rackspace"
#cache_type 'basicfile'
#cache_options( :path => "#{ENV['home']}/.chef/checksums" )
#cookbook_path ["#{current_dir}/../cookbooks"]

knife[:rackspace_api_username] = "#{ENV['OS_USERNAME']}"
knife[:rackspace_api_key] = "#{ENV['OS_PASSWORD']}"

#https_proxy 'https://localhost:8888'
#knife[:ssl_verify_peer] = false

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ spec/reports
.config
InstalledFiles
.bundle
.rackspace_cloud_credentials*
*.lock

# YARD artifacts
.yardoc
Expand Down
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
language: ruby
rvm:
- 2.0.0
- 1.9.3
- 1.8.7
env:
global:
- secure: ! 'eEsikE/p2yz7/cFvCN/NOoljxBqjzsTWnKC7iZ+fEGGsyhKVJgWn4AasBusZ
mhtQcOqwakRulzVc+EZN4pqWHgaMC7SnSwhqRU5u1E+BPI4iWNsu+7rjiXhE
cJK1vE8YodgsgRDQ6evZVQLkwJpRk0qq2tM2LDqpzvy2MeQJIGc='
- secure: ! 'V3ohIIF3I8lD05zTUs2nu+CcIzBYcvt1c1euRJ+SPcAH493b4cPquw1NZNFy
WDIW+1qDQi1DXr8C3Yq8bL4+pY66SukHtxyLhx0V26lGUvI8naq3IqageBQK
pkb2zZwVYO0a5mLEKOI/7omExBVHDxxX9Bw45vCHLKId3Wt21HE='
- secure: ! 'OyKQU1muVBijz2/EkLUgBWbwPKG2UqRhIfpB1ZFkfdQ/06+Vaf82ZEQk3DvY
2lYFrzvSN1yWrKTMU3XES/dPlVlH87LDOrRhNhgW/NeHhC5BzdwrtvBm08RN
64ACuFG8fch9zIbx2VTkyLV8xsFXPPSaKMbEXrnikLwqnl5M8PQ='
- secure: ! 'DoDVG0HwFg2a7Fj72tlxb8KJto+cBEh7J9YQZ35hK2cmeTsBAcZ4oSOUeAFg
s2MvBhX0man0zjYPStbL1vcpuS1Ecea3kGzefG0lYhHAzvK7wqqRqhKNFsnd
FPEVgZrcj3/Lc7mlkbigZouDM7BJLQbMGOv/KOS6f3nYzIhkOfE='
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
source "http://rubygems.org"

group :development, :test do
gem "knife-dsl", :git => 'git://github.com/maxlinc/knife-dsl.git', :branch => 'io_capture_fix'
end

# Specify your gem's dependencies in knife-rackspace.gemspec
gemspec
30 changes: 30 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,33 @@

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => [:credentials, :spec, 'integration:live']

task :credentials do
if ENV['TRAVIS_SECURE_ENV_VARS'] == 'false'
puts "Setting vars"
ENV['OS_USERNAME'] = '_RAX_USERNAME_'
ENV['OS_PASSWORD'] = '_RAX_PASSWORD_'
ENV['RS_TENANT_ID'] = '000000'
ENV['RS_CDN_TENANT_NAME'] = '_CDN-TENANT-NAME_'
end
fail "Not all required variables detected" unless ENV['OS_USERNAME'] && ENV['OS_PASSWORD'] && ENV['RS_CDN_TENANT_NAME'] && ENV['RS_TENANT_ID']
end

namespace :integration do
desc 'Run the integration tests'
RSpec::Core::RakeTask.new(:test) do |t|
t.pattern = 'spec/integration/**'
end

desc 'Run the integration tests live (no VCR cassettes)'
task :live do
unless ENV['TRAVIS'] == 'true' && ENV['TRAVIS_SECURE_ENV_VARS'] == 'false'
ENV['INTEGRATION_TESTS'] = 'live'
Rake::Task['integration:test'].invoke
end
end
end
6 changes: 6 additions & 0 deletions knife-rackspace.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ Gem::Specification.new do |s|
s.add_dependency "chef", ">= 0.10.10"
s.require_paths = ["lib"]

# In Gemfile because I'm using a fork on Github. Hopefully pull request will be merged and a new gem will be released soon.
# s.add_development_dependency "knife-dsl"
s.add_development_dependency "rspec"
s.add_development_dependency "vcr"
s.add_development_dependency "ansi"
s.add_development_dependency "rake"
end
123 changes: 123 additions & 0 deletions spec/cassettes/v1/should_list_images.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c51061f

Please sign in to comment.