mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
improvement: simplify runner configuration
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
29e2ea9fd1
commit
9de015ae2d
3 changed files with 4 additions and 4 deletions
|
@ -71,7 +71,7 @@ class VulcanoCLI < Thor
|
||||||
desc: 'Configure WinRM scans to run via SSL instead of pure HTTP.'
|
desc: 'Configure WinRM scans to run via SSL instead of pure HTTP.'
|
||||||
option :format, type: :string, default: 'progress'
|
option :format, type: :string, default: 'progress'
|
||||||
def exec(*tests)
|
def exec(*tests)
|
||||||
runner = Vulcano::Runner.new(options[:id], options)
|
runner = Vulcano::Runner.new(options)
|
||||||
runner.add_tests(tests)
|
runner.add_tests(tests)
|
||||||
runner.run
|
runner.run
|
||||||
rescue RuntimeError => e
|
rescue RuntimeError => e
|
||||||
|
|
|
@ -14,9 +14,9 @@ require 'vulcano/rspec_json_formatter'
|
||||||
module Vulcano
|
module Vulcano
|
||||||
class Runner
|
class Runner
|
||||||
attr_reader :tests
|
attr_reader :tests
|
||||||
def initialize(profile_id, conf)
|
def initialize(conf = {})
|
||||||
@rules = []
|
@rules = []
|
||||||
@profile_id = profile_id
|
@profile_id = @conf[:id]
|
||||||
@conf = Vulcano::Backend.target_config(normalize_map(conf))
|
@conf = Vulcano::Backend.target_config(normalize_map(conf))
|
||||||
@tests = RSpec::Core::World.new
|
@tests = RSpec::Core::World.new
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class DockerTester
|
||||||
def test_container(container, report)
|
def test_container(container, report)
|
||||||
puts "--> run test on docker #{container.id}"
|
puts "--> run test on docker #{container.id}"
|
||||||
opts = { 'target' => "docker://#{container.id}" }
|
opts = { 'target' => "docker://#{container.id}" }
|
||||||
runner = Vulcano::Runner.new(nil, opts)
|
runner = Vulcano::Runner.new(opts)
|
||||||
runner.add_tests(@tests)
|
runner.add_tests(@tests)
|
||||||
tests = runner.tests.ordered_example_groups
|
tests = runner.tests.ordered_example_groups
|
||||||
tests.map { |g| g.run(report) }
|
tests.map { |g| g.run(report) }
|
||||||
|
|
Loading…
Reference in a new issue