-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
58 lines (49 loc) · 1.38 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# frozen_string_literal: true
require "bundler/gem_tasks"
require "minitest/test_task"
require "azure_blob"
require_relative "test/support/app_service_vpn"
require_relative "test/support/azure_vm_vpn"
Minitest::TestTask.create(:test_rails) do
self.test_globs = [ "test/rails/**/test_*.rb",
"test/rails/**/*_test.rb", ]
end
Minitest::TestTask.create(:test_client) do
self.test_globs = [ "test/client/**/test_*.rb",
"test/client/**/*_test.rb", ]
end
task default: %i[test]
task :test do
Rake::Task["test_client"].execute
Rake::Task["test_rails"].execute
end
task :test_app_service do |t|
vpn = AppServiceVpn.new
ENV["IDENTITY_ENDPOINT"] = vpn.endpoint
ENV["IDENTITY_HEADER"] = vpn.header
Rake::Task["test_entra_id"].execute
ensure
vpn.kill
end
task :test_azure_vm do |t|
vpn = AzureVmVpn.new
Rake::Task["test_entra_id"].execute
ensure
vpn.kill
end
task :test_entra_id do |t|
ENV["AZURE_ACCESS_KEY"] = nil
Rake::Task["test"].execute
end
task :flush_test_container do |t|
AzureBlob::Client.new(
account_name: ENV["AZURE_ACCOUNT_NAME"],
access_key: ENV["AZURE_ACCESS_KEY"],
container: ENV["AZURE_PRIVATE_CONTAINER"],
).delete_prefix ""
AzureBlob::Client.new(
account_name: ENV["AZURE_ACCOUNT_NAME"],
access_key: ENV["AZURE_ACCESS_KEY"],
container: ENV["AZURE_PUBLIC_CONTAINER"],
).delete_prefix ""
end