File: podman_test_container.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-- 544 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 "train"
require_relative "helper"

(container_id = ENV["CONTAINER"]) ||
  raise("You must provide a container ID via CONTAINER env")

podman_url = ENV["CONTAINER_HOST"]

tests = ARGV
puts ["Running tests:", tests].flatten.join("\n- ")
puts ""

backends = {}
backends[:podman] = proc { |*args|
  opt = Train.target_config({ host: container_id, podman_url: podman_url })
  Train.create("podman", opt).connection(args[0])
}

backends.each do |type, get_backend|
  tests.each do |test|
    instance_eval(File.read(test), test, 1)
  end
end