File: docker_test.rb

package info (click to toggle)
ruby-train 3.13.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,208 kB
  • sloc: ruby: 10,002; sh: 17; makefile: 8
file content (23 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require_relative "docker_run"
tests = ARGV

def test_container(container, tests)
  puts "--> run test on docker #{container.id}"
  pid = Process.fork do
    ENV["CONTAINER"] = container.id
    require_relative "docker_test_container"
    Process.exit
  end

  _, status = Process.waitpid2(pid)
  status.exitstatus == 0
end

results = DockerRunner.new.run_all do |name, container|
  status = test_container(container, tests)
  status ? nil : "Failed to run tests on #{name}"
end

failures = results.compact
failures.each { |f| puts "\033[31;1m#{f}\033[0m\n\n" }
failures.empty? || raise("Test failures")