-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
32 lines (27 loc) · 938 Bytes
/
Rakefile
File metadata and controls
32 lines (27 loc) · 938 Bytes
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
require 'rake'
require 'rspec/core/rake_task'
# Enable Docker BuildKit for faster builds with better caching
ENV['DOCKER_BUILDKIT'] = '1'
task :spec => 'spec:all'
task :default => :spec
namespace :spec do
targets = []
Dir.glob('./spec/*').each do |dir|
next unless File.directory?(dir)
target = File.basename(dir)
target = "_#{target}" if target == "default"
targets << target
end
# Use multitask for parallel execution
multitask :all => targets
task :default => :all
targets.each do |target|
original_target = target == "_default" ? target[1..-1] : target
desc "Run serverspec tests to #{original_target}"
task target.to_sym do
# Run RSpec in a separate process with environment variable set
# This ensures each parallel task has its own isolated environment
sh "TARGET_HOST=#{original_target} bundle exec rspec spec/#{original_target}/*_spec.rb"
end
end
end