This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. change service manifest to {:vendor => '', :version => ''} 2. enable ENV vars for each service manifest 3. add service_versions_helper to manage multiple versions for specific service 4. insert specific service cases in @Queue, therefore, all cases including different service version cases can be run in parallel 5. print failed cases with environment variables 6. since cfoundry cannot support new service version API, therefore, one cfoundry monkey patch is committed. And this patch only is required when environment variable VCAP_BVT_SERVICES_MANIFEST is set. 7. add VCAP_BVT_SERVICES_VERSIONS=true to README.md Change-Id: Ic82a82a22d5c493d654dab48fcd9d3c4d777142a Signed-off-by: Pin Xie <pxie@vmware.com> Reviewed-on: http://reviews.cloudfoundry.org/7831 Tested-by: CI Master <cf-ci@rbcon.com> Reviewed-by: Nicholas Kushmerick <nicholask@vmware.com> Reviewed-by: Michael Zhang <zhangcheng@rbcon.com>
- Loading branch information
Showing
19 changed files
with
188 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
module CFoundry::V1 | ||
class Base < CFoundry::BaseClient | ||
|
||
def system_services | ||
get("services", "v1", "offerings", :json => :json) | ||
end | ||
end | ||
|
||
class Client | ||
|
||
def services | ||
services = [] | ||
|
||
@base.system_services.each do |type, vendors| | ||
vendors.each do |vendor, provider| | ||
provider[:core].each do |num, meta| | ||
services << Service.new(vendor.to_s, num, meta[:description], type) | ||
meta[:supported_versions].delete(num) | ||
meta[:supported_versions].each do |v| | ||
services << | ||
Service.new(vendor.to_s, v, meta[:description], type) | ||
end | ||
end | ||
end | ||
end | ||
|
||
services | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
module BVT::Spec | ||
|
||
TESTED_SERVICES = [{:vendor => 'mongodb', :versions => %w(1.8 2.0)}] | ||
|
||
|
||
MYSQL_MANIFEST = ENV['VCAP_BVT_MYSQL_MANIFEST'] ? eval(ENV['VCAP_BVT_MYSQL_MANIFEST']) : | ||
{:vendor=>"mysql", :version=>"5.1"} | ||
REDIS_MANIFEST = ENV['VCAP_BVT_REDIS_MANIFEST'] ? eval(ENV['VCAP_BVT_REDIS_MANIFEST']) : | ||
{:vendor => "redis", :version=>"2.2"} | ||
MONGODB_MANIFEST = ENV['VCAP_BVT_MONGODB_MANIFEST'] ? eval(ENV['VCAP_BVT_MONGODB_MANIFEST']) : | ||
{:vendor => "mongodb", :version=>"1.8"} | ||
RABBITMQ_MANIFEST = ENV['VCAP_BVT_RABBITMQ_MANIFEST'] ? eval(ENV['VCAP_BVT_RABBITMQ_MANIFEST']) : | ||
{:vendor => "rabbitmq", :version=>"2.4"} | ||
POSTGRESQL_MANIFEST = ENV['VCAP_BVT_POSTGRESQL_MANIFEST'] ? eval(ENV['VCAP_BVT_POSTGRESQL_MANIFEST']) : | ||
{:vendor => "postgresql", :version=>"9.0"} | ||
NEO4J_MANIFEST = ENV['VCAP_BVT_NEO4J_MANIFEST'] ? eval(ENV['VCAP_BVT_NEO4J_MANIFEST']) : | ||
{:vendor => "neo4j", :version=>"1.4"} | ||
VBLOB_MANIFEST = ENV['VCAP_BVT_VBLOB_MANIFEST'] ? eval(ENV['VCAP_BVT_VBLOB_MANIFEST']) : | ||
{:vendor => "vblob", :version=>"1.0"} | ||
MEMCACHED_MANIFEST = ENV['VCAP_BVT_MEMCACHED_MANIFEST'] ? eval(ENV['VCAP_BVT_MEMCACHED_MANIFEST']) : | ||
{:vendor => "memcached",:version=>"1.4"} | ||
COUCHDB_MANIFEST = ENV['VCAP_BVT_COUCHDB_MANIFEST'] ? eval(ENV['VCAP_BVT_COUCHDB_MANIFEST']) : | ||
{:vendor => "couchdb",:version=>"1.2"} | ||
ELASTICSSEARCH_MANIFEST = ENV['VCAP_BVT_ELASTICSSEARCH_MANIFEST'] ? eval(ENV['VCAP_BVT_ELASTICSSEARCH_MANIFEST']) : | ||
{:vendor => "elasticsearch", :version=>"0.19"} | ||
|
||
SERVICES_MANIFEST = [MYSQL_MANIFEST, REDIS_MANIFEST, MONGODB_MANIFEST, RABBITMQ_MANIFEST, | ||
POSTGRESQL_MANIFEST, NEO4J_MANIFEST, VBLOB_MANIFEST, MEMCACHED_MANIFEST, | ||
COUCHDB_MANIFEST, ELASTICSSEARCH_MANIFEST] | ||
|
||
module ServiceVersions | ||
module_function | ||
|
||
def get_tested_services() | ||
SERVICES_MANIFEST.each do |manifest| | ||
TESTED_SERVICES.each do |m| | ||
next unless m[:vendor] == manifest[:vendor] | ||
m[:versions].delete(manifest[:version]) | ||
end | ||
end | ||
TESTED_SERVICES.delete_if {|x| x[:versions].empty?} | ||
end | ||
|
||
def set_environment_variables(envs) | ||
res = {} | ||
case envs[:vendor] | ||
when 'mysql' | ||
res["VCAP_BVT_MYSQL_MANIFEST"] = envs.to_s | ||
when 'postgresql' | ||
res["VCAP_BVT_POSTGRESQL_MANIFEST"] = envs.to_s | ||
when 'mongodb' | ||
res["VCAP_BVT_MONGODB_MANIFEST"] = envs.to_s | ||
when 'redis' | ||
res["VCAP_BVT_REDIS_MANIFEST"] = envs.to_s | ||
when 'rabbitmq' | ||
res["VCAP_BVT_RABBITMQ_MANIFEST"] = envs.to_s | ||
when 'vblob' | ||
res["VCAP_BVT_VBLOB_MANIFEST"] = envs.to_s | ||
when 'memcached' | ||
res["VCAP_BVT_MEMCACHED_MANIFEST"] = envs.to_s | ||
when 'couchdb' | ||
res["VCAP_BVT_COUCHDB_MANIFEST"] = envs.to_s | ||
when 'elasticsearch' | ||
res["VCAP_BVT_ELASTICSEARCH_MANIFEST"] = envs.to_s | ||
else | ||
raise RuntimeError, "service vendor: #{envs[:vendor]}," + | ||
" is not supported to set proper Environment variables. " | ||
end | ||
res | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.