Browse files

cleaned up blobstore server tests

- they were really functional, not integration
- added Rake task to run (ci and cov)
- updated Gems to be on par with director

Change-Id: I4129fa2f713d6d0355d77866728e662eca586583
  • Loading branch information...
1 parent 9159611 commit bce60900df82733301b75d4d8e30aecf0c25a939 Vadim Spivak committed Feb 19, 2012
Showing with 108 additions and 22 deletions.
  1. +3 −1 simple_blobstore_server/Gemfile
  2. +29 −21 simple_blobstore_server/Gemfile.lock
  3. +57 −0 simple_blobstore_server/Rakefile
  4. 0 simple_blobstore_server/spec/{integration → functional}/simple_blogstore_server_spec.rb
  5. +19 −0 simple_blobstore_server/spec/spec_helper.rb
  6. BIN simple_blobstore_server/vendor/cache/builder-2.1.2.gem
  7. BIN simple_blobstore_server/vendor/cache/builder-3.0.0.gem
  8. BIN simple_blobstore_server/vendor/cache/ci_reporter-1.6.3.gem
  9. BIN simple_blobstore_server/vendor/cache/ci_reporter-1.6.4.gem
  10. BIN simple_blobstore_server/vendor/cache/daemons-1.1.0.gem
  11. BIN simple_blobstore_server/vendor/cache/daemons-1.1.5.gem
  12. BIN simple_blobstore_server/vendor/cache/rack-1.2.1.gem
  13. BIN simple_blobstore_server/vendor/cache/rack-1.4.0.gem
  14. BIN simple_blobstore_server/vendor/cache/rack-test-0.5.6.gem
  15. BIN simple_blobstore_server/vendor/cache/rack-test-0.5.7.gem
  16. BIN simple_blobstore_server/vendor/cache/rcov-0.9.9.gem
  17. BIN simple_blobstore_server/vendor/cache/rspec-2.0.0.gem
  18. BIN simple_blobstore_server/vendor/cache/rspec-2.5.0.gem
  19. BIN simple_blobstore_server/vendor/cache/rspec-core-2.0.0.gem
  20. BIN simple_blobstore_server/vendor/cache/rspec-core-2.5.1.gem
  21. BIN simple_blobstore_server/vendor/cache/rspec-expectations-2.0.0.gem
  22. BIN simple_blobstore_server/vendor/cache/rspec-expectations-2.5.0.gem
  23. BIN simple_blobstore_server/vendor/cache/rspec-mocks-2.0.0.gem
  24. BIN simple_blobstore_server/vendor/cache/rspec-mocks-2.5.0.gem
  25. BIN simple_blobstore_server/vendor/cache/simplecov-0.4.2.gem
  26. BIN simple_blobstore_server/vendor/cache/simplecov-clover-0.0.1.gem
  27. BIN simple_blobstore_server/vendor/cache/simplecov-html-0.4.5.gem
  28. BIN simple_blobstore_server/vendor/cache/simplecov-rcov-0.2.3.gem
  29. BIN simple_blobstore_server/vendor/cache/sinatra-1.0.gem
  30. BIN simple_blobstore_server/vendor/cache/sinatra-1.2.3.gem
  31. BIN simple_blobstore_server/vendor/cache/thin-1.2.7.gem
  32. BIN simple_blobstore_server/vendor/cache/thin-1.3.1.gem
  33. BIN simple_blobstore_server/vendor/cache/tilt-1.2.2.gem
  34. BIN simple_blobstore_server/vendor/cache/uuidtools-2.1.1.gem
  35. BIN simple_blobstore_server/vendor/cache/uuidtools-2.1.2.gem
View
4 simple_blobstore_server/Gemfile
@@ -7,6 +7,8 @@ gem "uuidtools"
group :test do
gem "rack-test"
gem "rspec"
- gem "rcov"
+ gem "simplecov"
+ gem "simplecov-clover"
+ gem "simplecov-rcov"
gem "ci_reporter"
end
View
50 simple_blobstore_server/Gemfile.lock
@@ -1,42 +1,50 @@
GEM
remote: http://rubygems.org/
specs:
- builder (2.1.2)
- ci_reporter (1.6.3)
+ builder (3.0.0)
+ ci_reporter (1.6.4)
builder (>= 2.1.2)
- daemons (1.1.0)
+ daemons (1.1.5)
diff-lcs (1.1.2)
eventmachine (0.12.10)
- rack (1.2.1)
- rack-test (0.5.6)
+ rack (1.4.0)
+ rack-test (0.5.7)
rack (>= 1.0)
- rcov (0.9.9)
- rspec (2.0.0)
- rspec-core (= 2.0.0)
- rspec-expectations (= 2.0.0)
- rspec-mocks (= 2.0.0)
- rspec-core (2.0.0)
- rspec-expectations (2.0.0)
- diff-lcs (>= 1.1.2)
- rspec-mocks (2.0.0)
- rspec-core (= 2.0.0)
- rspec-expectations (= 2.0.0)
- sinatra (1.0)
- rack (>= 1.0)
- thin (1.2.7)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.5.0)
+ simplecov (0.4.2)
+ simplecov-html (~> 0.4.4)
+ simplecov-clover (0.0.1)
+ simplecov (>= 0.4.1)
+ simplecov-html (0.4.5)
+ simplecov-rcov (0.2.3)
+ simplecov (>= 0.4.1)
+ sinatra (1.2.3)
+ rack (~> 1.1)
+ tilt (>= 1.2.2, < 2.0)
+ thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
- uuidtools (2.1.1)
+ tilt (1.2.2)
+ uuidtools (2.1.2)
PLATFORMS
ruby
DEPENDENCIES
ci_reporter
rack-test
- rcov
rspec
+ simplecov
+ simplecov-clover
+ simplecov-rcov
sinatra
thin
uuidtools
View
57 simple_blobstore_server/Rakefile
@@ -0,0 +1,57 @@
+# Copyright (c) 2009-2012 VMware, Inc.
+
+if RUBY_VERSION < "1.9"
+ puts("BOSH Director requires Ruby 1.9+")
+ exit(1)
+end
+
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __FILE__)
+
+require "rubygems"
+require "bundler"
+Bundler.setup(:default, :test)
+
+require "rake"
+require "rspec/core/rake_task"
+require "ci/reporter/rake/rspec"
+
+coverage_dir = File.expand_path("../spec_coverage", __FILE__)
+reports_dir = File.expand_path("../spec_reports", __FILE__)
+
+ENV["CI_REPORTS"] = reports_dir
+
+namespace :spec do
+ gemfile = "Gemfile"
+ spec_opts = %W(--format documentation --colour)
+
+ task :cleanup_cov do
+ FileUtils.rm_rf(coverage_dir)
+ end
+
+ task :cleanup_reports do
+ FileUtils.rm_rf(reports_dir)
+ end
+
+ desc "Run Blobstore Server functional tests"
+ task :functional => %W(spec:functional:run)
+
+ namespace :functional do
+
+ desc ""
+ RSpec::Core::RakeTask.new(:run) do |task|
+ task.gemfile = gemfile
+ task.rspec_opts = spec_opts
+ task.pattern = "spec/functional/**/*_spec.rb"
+ end
+
+ desc "Run Blobstore Server functional tests with code coverage"
+ task :cov do
+ ENV["SIMPLECOV"] = "1"
+ Rake::Task["spec:cleanup_cov"].invoke
+ Rake::Task["spec:functional:run"].invoke
+ end
+
+ desc "Run Blobstore Server functional tests for CI"
+ task :ci => %W(ci:setup:rspec spec:cleanup_reports spec:functional:cov)
+ end
+end
View
0 ...tegration/simple_blogstore_server_spec.rb → ...unctional/simple_blogstore_server_spec.rb
File renamed without changes.
View
19 simple_blobstore_server/spec/spec_helper.rb
@@ -3,6 +3,25 @@
require "rubygems"
Bundler.setup(:default, :test)
+if ENV["SIMPLECOV"]
+ require "simplecov"
+ require "simplecov-rcov"
+ require "simplecov-clover"
+
+ SimpleCov.formatter = Class.new do
+ def format(result)
+ SimpleCov::Formatter::CloverFormatter.new.format(result)
+ SimpleCov::Formatter::RcovFormatter.new.format(result)
+ end
+ end
+
+ SimpleCov.root(File.expand_path("../..", __FILE__))
+ SimpleCov.add_filter("spec")
+ SimpleCov.add_filter("vendor")
+ SimpleCov.coverage_dir(ENV["SIMPLECOV_DIR"] || "spec_coverage")
+ SimpleCov.start
+end
+
require "rack/test"
$LOAD_PATH.unshift(File.dirname(__FILE__) + "/../lib")
View
BIN simple_blobstore_server/vendor/cache/builder-2.1.2.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/builder-3.0.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/ci_reporter-1.6.3.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/ci_reporter-1.6.4.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/daemons-1.1.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/daemons-1.1.5.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rack-1.2.1.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rack-1.4.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rack-test-0.5.6.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rack-test-0.5.7.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rcov-0.9.9.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-2.0.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-2.5.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-core-2.0.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-core-2.5.1.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-expectations-2.0.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-expectations-2.5.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-mocks-2.0.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/rspec-mocks-2.5.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/simplecov-0.4.2.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/simplecov-clover-0.0.1.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/simplecov-html-0.4.5.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/simplecov-rcov-0.2.3.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/sinatra-1.0.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/sinatra-1.2.3.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/thin-1.2.7.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/thin-1.3.1.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/tilt-1.2.2.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/uuidtools-2.1.1.gem
Binary file not shown.
View
BIN simple_blobstore_server/vendor/cache/uuidtools-2.1.2.gem
Binary file not shown.

0 comments on commit bce6090

Please sign in to comment.