-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathRakefile
More file actions
36 lines (28 loc) · 1.1 KB
/
Rakefile
File metadata and controls
36 lines (28 loc) · 1.1 KB
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
# frozen_string_literal: true
require "rake/testtask"
require "shellwords"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = true
end
task default: :test
namespace :features do
desc "Run all devcontainer feature tests via npm"
task :test do
sh "npm test"
end
desc "Run autogenerated tests for one feature (FEATURE=ruby IMAGE=ubuntu:latest)"
task :autogenerated do
feature = ENV["FEATURE"]
abort "Set FEATURE, for example: rake features:autogenerated FEATURE=ruby" if feature.nil? || feature.empty?
image = ENV.fetch("IMAGE", "ubuntu:latest")
sh "cd features && npx devcontainer features test --skip-scenarios -f #{Shellwords.escape(feature)} -i #{Shellwords.escape(image)} ."
end
desc "Run scenario tests for one feature (FEATURE=ruby)"
task :scenarios do
feature = ENV["FEATURE"]
abort "Set FEATURE, for example: rake features:scenarios FEATURE=ruby" if feature.nil? || feature.empty?
sh "cd features && npx devcontainer features test -f #{Shellwords.escape(feature)} --skip-autogenerated --skip-duplicated ."
end
end