Permalink
Browse files

Restructure YETIs, remove all tags [#46161019]

  • Loading branch information...
Bleicke and Tim Labeeuw
Bleicke and Tim Labeeuw committed Mar 22, 2013
1 parent 8bafb08 commit f8abe5b1890d9ed4c3061327553d5b8d1e1b4df0
Showing with 207 additions and 319 deletions.
  1. +0 −4 Gemfile
  2. +5 −25 Gemfile.lock
  3. +0 −3 README.md
  4. +12 −89 Rakefile
  5. +1 −1 config/assets.yml
  6. +2 −2 lib/harness/app.rb
  7. +2 −2 lib/harness/cfsession.rb
  8. +6 −2 lib/harness/logger_helper.rb
  9. +0 −2 lib/harness/rake_helper.rb
  10. +17 −24 lib/harness/user.rb
  11. 0 spec/{simple → apps}/async_staging_spec.rb
  12. 0 spec/{simple → apps}/domain_spec.rb
  13. +1 −1 spec/{simple → apps}/file_range_spec.rb
  14. 0 spec/{simple → apps}/info_spec.rb
  15. +3 −3 spec/{simple → apps}/java_java_web_spec.rb
  16. +2 −2 spec/{simple → apps}/java_spec.rb
  17. 0 spec/{simple → apps}/lifecycle_spec.rb
  18. 0 spec/{simple → apps}/name_collision_spec.rb
  19. +4 −5 spec/{simple → apps}/node_spec.rb
  20. +3 −3 spec/{simple → apps}/ruby_gems_spec.rb
  21. 0 spec/{simple → apps}/ruby_rails3_spec.rb
  22. +1 −1 spec/{simple → apps}/ruby_spec.rb
  23. +1 −1 spec/{simple → apps}/space_spec.rb
  24. +3 −3 spec/{simple → apps}/update_spec.rb
  25. +0 −3 spec/cfcore/cfcore_helper.rb
  26. +1 −1 spec/{performance → core}/app_performance_spec.rb
  27. +1 −1 spec/{mcf → core}/app_response_timeout_spec.rb
  28. +2 −4 spec/{cfcore → core}/debug_spec.rb
  29. +2 −2 spec/{cfcore → core}/service_versions_spec.rb
  30. +11 −3 spec/spec_helper.rb
  31. +1 −3 spec/{cfcore/service_matcher.rb → support/service_helper.rb}
  32. +113 −0 spec/support/uaa_helper.rb
  33. +6 −6 spec/tools/rails_console_spec.rb
  34. +2 −3 spec/user/admin_user_spec.rb
  35. +2 −2 spec/user/normal_user_spec.rb
  36. +3 −118 spec/user/uaa_spec.rb
  37. BIN vendor/cache/cf-uaac-1.3.3.gem
View
@@ -11,15 +11,11 @@ gem "bson_ext"
gem "yajl-ruby"
gem "nokogiri"
-gem "fuubar"
-gem "progressbar", "~> 0.11.0"
-
group :vcap do
gem "interact"
gem "caldecott"
gem "vcap_logging", ">= 1.0"
- gem "cf-uaac", "= 1.3.3"
gem "cfoundry", :github => "cloudfoundry/vmc-lib", :submodules => true
gem "tunnel-vmc-plugin", :github => "cloudfoundry/tunnel-vmc-plugin"
gem "console-vmc-plugin", :github => "cloudfoundry/console-vmc-plugin"
View
@@ -18,11 +18,11 @@ GIT
GIT
remote: git://github.com/cloudfoundry/vmc-lib.git
- revision: e11ddf5d7e9fce165a1f917bd4a9dbd4ecb0739f
+ revision: d315077a450b97738e88b8155ab46d9446355bbc
submodules: true
specs:
- cfoundry (0.5.1.rc2)
- cf-uaa-lib (~> 1.3.3)
+ cfoundry (0.5.3.rc6)
+ cf-uaa-lib (~> 1.3.10)
multi_json (~> 1.3)
multipart-post (~> 1.1)
rubyzip (~> 0.9)
@@ -50,15 +50,8 @@ GEM
uuidtools (~> 2.1.2)
caldecott-client (0.0.2)
multi_json (~> 1.3)
- cf-uaa-lib (1.3.3)
+ cf-uaa-lib (1.3.10)
multi_json
- cf-uaac (1.3.3)
- cf-uaa-lib (>= 1.3.3, <= 1.3.3)
- em-http-request (= 0.3.0)
- eventmachine
- highline
- json_pure
- launchy
diff-lcs (1.1.3)
em-http-request (0.3.0)
addressable (>= 2.0.0)
@@ -69,21 +62,13 @@ GEM
eventmachine (>= 0.12.9)
escape_utils (0.2.4)
eventmachine (1.0.0)
- fuubar (1.1.0)
- rspec (~> 2.0)
- rspec-instafail (~> 0.2.0)
- ruby-progressbar (~> 1.0.0)
- highline (1.6.15)
i18n (0.6.1)
interact (0.5.0)
json (1.6.7)
- json_pure (1.7.5)
- launchy (2.1.0)
- addressable (~> 2.2.6)
mime-types (1.20.1)
mongo (1.8.0)
bson (~> 1.8.0)
- multi_json (1.5.0)
+ multi_json (1.7.1)
multipart-post (1.2.0)
nokogiri (1.5.5)
progressbar (0.11.0)
@@ -100,11 +85,9 @@ GEM
rspec-core (2.12.1)
rspec-expectations (2.12.0)
diff-lcs (~> 1.1.3)
- rspec-instafail (0.2.4)
rspec-mocks (2.12.0)
rspec_parallel (0.1.6)
progressbar (>= 0.11.0)
- ruby-progressbar (1.0.2)
rubyzip (0.9.9)
sinatra (1.3.4)
rack (~> 1.4)
@@ -122,14 +105,11 @@ PLATFORMS
DEPENDENCIES
bson_ext
caldecott
- cf-uaac (= 1.3.3)
cfoundry!
console-vmc-plugin!
- fuubar
interact
mongo
nokogiri
- progressbar (~> 0.11.0)
rake
rest-client
rspec
View
@@ -176,9 +176,6 @@ Rake Tasks:
<br>run core tests for verifying that an installation meets minimal Cloud Foundry
compatibility requirements
<br>e.g. rake core\[5\] (default to 10, max = 16)
-- mcf
-<br>run Micro Cloud Foundry tests
-<br>e.g. rake mcf\[5\] (default to 10, max = 16)
- rerun
<br>rerun failed cases of the last run
<br>e.g. rake rerun\[5\] (default to 10, max = 16)
View
101 Rakefile
@@ -4,39 +4,9 @@ require "harness"
include BVT::Harness
include BVT::Harness::ColorHelpers
-task :default => [:help]
+task :default => [:full]
-desc "List help commands"
-task :help do
- puts "Usage: rake [command]"
- puts " admin\t\trun admin test cases"
- puts " tests\t\trun core tests in parallel, e.g. rake test[5] (default to 10, max = 16)\n"
- puts " \t\tOptions: VCAP_BVT_LONGEVITY=N can loop this task.\n"
- puts " \t\te.g. rake tests[8] VCAP_BVT_LONGEVITY=10"
- puts " \t\tVCAP_BVT_CONFIG_FILE=[path_to_config_file] to specify config file.\n"
- puts " \t\te.g. rake tests VCAP_BVT_CONFIG_FILE=/home/czhang/my_test.yml\n"
- puts " \t\tAbove options are also usable in other tasks."
- puts " full\t\trun full tests in parallel, e.g. rake full[5] (default to 10, max = 16)"
- puts " random\trun all bvts randomly, e.g. rake random[1023] to re-run seed 1023"
- puts " java\t\trun java tests (spring, java_web) in parallel\n" +
- "\t\te.g. rake java[5] (default to 10, max = 16)"
- puts " jvm\t\trun jvm tests (spring, java_web, grails, lift) in parallel\n" +
- "\t\te.g. rake jvm[5] (default to 10, max = 16)"
- puts " ruby\t\trun ruby tests (rails3, sinatra, rack) in parallel\n" +
- "\t\te.g. rake ruby[5] (default to 10, max = 16)"
- puts " services\trun service tests (mongodb/redis/mysql/postgres/rabbitmq/neo4j/vblob) in parallel\n" +
- "\t\te.g. rake services[5] (default to 10, max = 16)"
- puts " core\t\trun core tests for verifying that an installation meets\n" +
- "\t\tminimal Cloud Foundry compatibility requirements"
- puts " mcf\t\trun Micro Cloud Foundry tests\n"
- puts " clean\t\tclean up test environment(only run this task after interruption).\n" +
- "\t\t 1, Remove all apps and services under test user\n" +
- "\t\t 2, Remove all apps and services under parallel users"
- puts " rerun\t\trerun failed cases of the previous run\n"
- puts " help\t\tlist help commands"
-end
-
-desc "run full tests (not include admin cases)"
+desc "run full tests in parallel, e.g. rake full[5] (default to 10, max = 16)"
task :full, :thread_number do |t, args|
RakeHelper.sync_assets
threads = 10
@@ -46,46 +16,7 @@ task :full, :thread_number do |t, args|
longevity(threads, {'tags' => '~admin'})
end
-desc "run tests (don't include admin and slow cases)"
-task :fast, :thread_number do |t, args|
- RakeHelper.sync_assets
- threads = 10
- threads = args[:thread_number].to_i if args[:thread_number]
- RakeHelper.prepare_all(threads)
- create_reports_folder
- longevity(threads, {'tags' => '~admin,~slow'})
-end
-
-desc "run tests subset"
-task :tests, :thread_number do |t, args|
- RakeHelper.sync_assets
- threads = 10
- threads = args[:thread_number].to_i if args[:thread_number]
- RakeHelper.prepare_all(threads)
- create_reports_folder
- longevity(threads, {'tags' => 'p1,~admin,~slow'})
-end
-
-desc "Run all bvts randomly, add [N] to specify a seed"
-task :random, :seed do |t, args|
- RakeHelper.sync_assets
- if args[:seed] != nil
- sh "bundle exec rspec spec/ --tag ~admin --tag ~slow" +
- " --seed #{args[:seed]} --format d -c"
- else
- sh "bundle exec rspec spec/ --tag ~admin --tag ~slow" +
- " --order rand --format d -c"
- end
-end
-
-desc "Run admin test cases"
-task :admin do
- RakeHelper.prepare_all
- create_reports_folder
- longevity(1, {'tags' => 'admin'})
-end
-
-desc "Run java tests (spring, java_web)"
+desc "run java tests (spring, java_web) in parallel, e.g. rake java[5] (default to 10, max = 16)"
task :java, :thread_number, :longevity, :fail_fast do |t, args|
RakeHelper.sync_assets
threads = 10
@@ -95,7 +26,7 @@ task :java, :thread_number, :longevity, :fail_fast do |t, args|
longevity(threads, {'pattern' => /_(spring|java_web)_spec\.rb/})
end
-desc "Run jvm tests (spring, java_web, grails, lift)"
+desc "tests (spring, java_web, grails, lift) in parallel e.g. rake jvm[5] (default to 10, max = 16)"
task :jvm, :thread_number do |t, args|
RakeHelper.sync_assets
threads = 10
@@ -105,7 +36,7 @@ task :jvm, :thread_number do |t, args|
longevity(threads, {'pattern' => /_(spring|java_web|grails|lift)_spec\.rb/})
end
-desc "Run ruby tests (rails3, sinatra, rack)"
+desc "run ruby tests (rails3, sinatra, rack) in parallel e.g. rake ruby[5] (default to 10, max = 16)"
task :ruby, :thread_number do |t, args|
threads = 10
threads = args[:thread_number].to_i if args[:thread_number]
@@ -114,7 +45,7 @@ task :ruby, :thread_number do |t, args|
longevity(threads, {'pattern' => /ruby_.+_spec\.rb/})
end
-desc "Run service tests (mongodb, redis, mysql, postgres, rabbitmq, neo4j, vblob)"
+desc "run service tests (mongodb/redis/mysql/postgres/rabbitmq/neo4j/vblob) in parallel e.g. rake services[5] (default to 10, max = 16)"
task :services, :thread_number do |t, args|
RakeHelper.sync_assets
threads = 10
@@ -128,7 +59,11 @@ task :services, :thread_number do |t, args|
end
end
-desc "Clean up test environment"
+desc <<-CLEAN
+clean up test environment(only run this task after interruption).
+ 1, Remove all apps and services under test user
+ 2, Remove all apps and services under parallel users
+CLEAN
task :clean do
RakeHelper.cleanup!
end
@@ -166,16 +101,6 @@ task :delete_orgs do
sh "./tools/scripts/yeti-hunter.rb"
end
-desc 'run core tests for verifying that an installation meets minimal Cloud Foundry compatibility requirements'
-RSpec::Core::RakeTask.new(:core) do |t|
- t.rspec_opts = '--tag cfcore'
-end
-
-desc 'run Micro Cloud Foundry tests'
-RSpec::Core::RakeTask.new(:mcf) do |t|
- t.rspec_opts = '--tag mcf'
-end
-
def create_reports_folder
output = `ls .`
if output.include? 'reports'
@@ -186,8 +111,7 @@ def create_reports_folder
end
def get_longevity_number
- return ENV['VCAP_BVT_LONGEVITY'].to_i if ENV['VCAP_BVT_LONGEVITY']
- return 1
+ ENV['VCAP_BVT_LONGEVITY'] ? ENV['VCAP_BVT_LONGEVITY'].to_i : 1
end
def longevity(threads, filter, rerun=false)
@@ -241,4 +165,3 @@ def longevity(threads, filter, rerun=false)
exit(0)
end
end
-
View
@@ -5,7 +5,7 @@
# Since we have switched to buildpacks staging time has increased
# so until we start caching gems, bins, etc. timeout is 5min
-timeout_secs: 900
+timeout_secs: 120
job_timeout_secs: 30
sleep_secs: 1
View
@@ -10,7 +10,7 @@ def initialize(app, session, domain=nil)
@session = session
@client = @session.client
@log = @session.log
- @domain = domain
+ @domain = domain
end
def inspect
@@ -379,7 +379,7 @@ def logs
raise RuntimeError, "Fail to get logs for Application: #{@app.name}!" +
"\n#{e.to_s}\n#{@session.print_client_logs}"
end
- @log.debug("Get Application #{@app.name}, logs contents: #{body}")
+ @log.debug("=============== Get Application #{@app.name}, logs contents: #{body}")
body
end
View
@@ -43,7 +43,7 @@ def inspect
end
def login
- @log.debug("Login in, target: #{@TARGET}, email = #{@email}")
+ @log.info("Login in, target: #{@TARGET}, email = #{@email}")
@client = CFoundry::Client.new(@TARGET)
@client.trace = true if ENV['VCAP_BVT_TRACE']
@client.log = []
@@ -362,4 +362,4 @@ def is_user_admin?(email, passwd)
end
end
end
-end
+end
@@ -1,4 +1,3 @@
-
module BVT::Harness
module LoggerHelper
attr_reader :logfile
@@ -9,10 +8,15 @@ def set_logger(target)
filename = target ? "bvt.#{target_without_http(target)}.log" : "bvt.log"
logfile = File.join(VCAP_BVT_HOME, filename)
loglevel = :debug
- config = {:level => loglevel, :file => logfile}
+ config = {
+ :level => loglevel,
+ :file => logfile
+ }
+
Dir.mkdir(VCAP_BVT_HOME) unless Dir.exist?(VCAP_BVT_HOME)
VCAP::Logging.reset
VCAP::Logging.setup_from_config(config)
+ VCAP::Logging.add_sink(:warn, nil, VCAP::Logging::Sink::StdioSink.new(STDOUT, VCAP::Logging::FORMATTER))
end
def target_without_http(target)
@@ -23,8 +23,6 @@ def prepare_all(threads=nil)
if threads == nil
get_admin_user
get_admin_user_passwd
- admin_user = {'email' => @config['admin']['email'],
- 'passwd' => @config['admin']['passwd']}
elsif threads < 1 || threads > VCAP_BVT_PARALLEL_MAX_USERS
puts red("threads number must be within 1~#{VCAP_BVT_PARALLEL_MAX_USERS}")
exit(1)
View
@@ -17,38 +17,31 @@ def inspect
def create(passwd)
@log.info("Create User: #{@email} via Admin User: #{@session.email}")
- begin
- @session.register(@email, passwd)
- @passwd = passwd
- rescue
- @log.error("Failed to create user: #{@email}")
- raise RuntimeError, "Failed to create user: #{@email}"
- end
+ @session.register(@email, passwd)
+ @passwd = passwd
+ rescue
+ @log.error("Failed to create user: #{@email}")
+ raise
end
def delete
- @log.info("Delete User: #{@email} via Admin User:#{@session.email}")
- begin
- @user.delete!
- rescue Exception => e
- # if @user has been deleted, ignore the exception
- unless @user
- @log.error("Failed to delete user")
- raise RuntimeError, "Failed to delete user.\n#{e.to_s}"
- end
+ @log.info("Delete User: #{@email} via Admin User:#{@session.email}")
+ @user.delete!
+ rescue
+ # if @user has been deleted, ignore the exception
+ unless @user
+ @log.error("Failed to delete user")
+ raise
end
end
def change_passwd(new_passwd)
@log.info "Change User: #{@email} password, new passwd = #{new_passwd}"
- begin
- @user.password = new_passwd
- @user.update!
- rescue
- @log.error("Fail to change password for user: #{@email}")
- raise RuntimeError,
- "Fail to change passsword for user = #{@email}"
- end
+ @user.password = new_passwd
+ @user.update!
+ rescue
+ @log.error("Fail to change password for user: #{@email}")
+ raise
end
end
end
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit f8abe5b

Please sign in to comment.