Class: OsCtl::Image::Operations::Test::Image
- Defined in:
- lib/osctl/image/operations/test/image.rb
Instance Attribute Summary collapse
- #base_dir ⇒ String readonly
- #image ⇒ Image readonly
-
#opts ⇒ Object
readonly
protected
Returns the value of attribute opts.
-
#tests ⇒ Object
readonly
protected
Returns the value of attribute tests.
Instance Method Summary collapse
- #execute ⇒ Array<Operations::Test::Run::Status>
-
#initialize(base_dir, image, tests, opts) ⇒ Image
constructor
A new instance of Image.
Methods inherited from Base
Constructor Details
#initialize(base_dir, image, tests, opts) ⇒ Image
Returns a new instance of Image.
20 21 22 23 24 25 |
# File 'lib/osctl/image/operations/test/image.rb', line 20 def initialize(base_dir, image, tests, opts) @base_dir = base_dir @image = image @tests = tests @opts = opts end |
Instance Attribute Details
#base_dir ⇒ String (readonly)
6 7 8 |
# File 'lib/osctl/image/operations/test/image.rb', line 6 def base_dir @base_dir end |
#image ⇒ Image (readonly)
9 10 11 |
# File 'lib/osctl/image/operations/test/image.rb', line 9 def image @image end |
#opts ⇒ Object (readonly, protected)
Returns the value of attribute opts.
43 44 45 |
# File 'lib/osctl/image/operations/test/image.rb', line 43 def opts @opts end |
#tests ⇒ Object (readonly, protected)
Returns the value of attribute tests.
43 44 45 |
# File 'lib/osctl/image/operations/test/image.rb', line 43 def tests @tests end |
Instance Method Details
#execute ⇒ Array<Operations::Test::Run::Status>
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/osctl/image/operations/test/image.rb', line 28 def execute build = Operations::Image::Build.new(base_dir, image, opts) build.execute if opts[:rebuild] || !build.cached? tests.map do |test| Operations::Test::Run.run( base_dir, build, test, keep_failed: opts[:keep_failed], ) end end |