зеркало из
1
0
Форкнуть 0
azure-sdk-for-ruby/Rakefile

88 строки
2.4 KiB
Ruby
Исходник Обычный вид История

2012-06-15 01:45:06 +04:00
require "rake/testtask"
require "rubygems/package_task"
2012-07-07 02:59:00 +04:00
task :doc do
system "yard --plugin yard-tomdoc -o doc/ -"
end
2012-06-15 01:45:06 +04:00
gem_spec = eval(File.read("./azure.gemspec"))
Gem::PackageTask.new(gem_spec) do |pkg|
pkg.need_zip = false
pkg.need_tar = false
end
namespace :test do
2012-07-07 02:59:00 +04:00
task :require_environment do
unset_environment = [
ENV.fetch("AZURE_ACCOUNT_NAME", nil),
ENV.fetch("AZURE_ACCESS_KEY", nil),
ENV.fetch("AZURE_TABLE_HOST", nil),
ENV.fetch("AZURE_BLOB_HOST", nil),
ENV.fetch("AZURE_QUEUE_HOST", nil),
ENV.fetch("AZURE_ACS_NAMESPACE", nil),
ENV.fetch("AZURE_SB_ACCESS_KEY", nil),
ENV.fetch("AZURE_SB_ISSUER", nil)
].include?(nil)
abort "[ABORTING] Configure your environment to run the integration tests" if unset_environment
end
2012-06-15 01:45:06 +04:00
Rake::TestTask.new :unit do |t|
t.pattern = "test/unit/**/*_test.rb"
t.verbose = true
t.libs = ["lib", "test"]
end
Rake::TestTask.new :integration do |t|
t.pattern = "test/integration/**/*_test.rb"
t.verbose = true
t.libs = ["lib", "test"]
end
2012-07-07 02:59:00 +04:00
task :integration => :require_environment
2012-06-15 01:45:06 +04:00
namespace :integration do
def component_task(component)
Rake::TestTask.new component do |t|
t.pattern = "test/integration/#{component}/**/*_test.rb"
t.verbose = true
t.libs = ["lib", "test"]
end
2012-07-07 02:59:00 +04:00
task component => "test:require_environment"
2012-06-15 01:45:06 +04:00
end
component_task :tables
component_task :blobs
component_task :queues
component_task :service_bus
end
2012-07-07 02:59:00 +04:00
task :cleanup => :require_environment do
2012-06-15 01:45:06 +04:00
$:.unshift "lib"
require 'azure'
Azure.configure do |config|
config.access_key = ENV.fetch("AZURE_ACCESS_KEY")
config.account_name = ENV.fetch("AZURE_ACCOUNT_NAME")
config.table_host = ENV.fetch("AZURE_TABLE_HOST")
config.blob_host = ENV.fetch("AZURE_BLOB_HOST")
config.queue_host = ENV.fetch("AZURE_QUEUE_HOST")
config.acs_namespace = ENV.fetch("AZURE_ACS_NAMESPACE")
config.sb_access_key = ENV.fetch("AZURE_SB_ACCESS_KEY")
config.sb_issuer = ENV.fetch("AZURE_SB_ISSUER")
end
Azure::Tables.all.map(&:delete)
Azure::Blobs.containers.map(&:delete)
Azure::Queues.all.map(&:delete)
Azure::ServiceBus::Queues.list.map(&:delete)
Azure::ServiceBus::Topics.list.map(&:delete)
end
end
2012-07-07 02:59:00 +04:00
task :test => ["test:unit", "test:integration"]
2012-06-15 01:45:06 +04:00
task default: :test