-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
41 lines (32 loc) · 1.1 KB
/
Rakefile
File metadata and controls
41 lines (32 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
37
38
39
40
41
# frozen_string_literal: true
require "bundler/gem_tasks"
require "minitest/test_task"
Minitest::TestTask.create
require "rubocop/rake_task"
RuboCop::RakeTask.new
task default: %i[test:unit test:e2e rubocop]
namespace :test do
task :unit do
system("X=/e2e/ bin/rake test")
end
task :e2e do
require "open3"
unpath_vips = "unpath libvips unpath libvips-tools unpath vips"
statuses = [
["bin/rake test N=/e2e__with_deps/"],
["#{unpath_vips} bin/rake test N=/e2e__with_deps/"],
["apt-get remove -y --purge *imagemagick* libvips libvips-tools && bin/rake test N=/e2e__without_deps/"],
["#{unpath_vips} bin/rake test N=/e2e__with_deps/", "--build-arg IMAGE_MAGICK_VERSION=6.9.13-11"]
].map do |command, build_args|
command = "docker run $(docker build -q #{build_args} .) bash -c '#{command}'"
stdout, stderr, status = Open3.capture3(command)
puts "=" * command.size
puts command
puts "=" * command.size
puts stderr
puts stdout
status
end
raise "Some tests failed" if statuses.map(&:exitstatus).max.positive?
end
end