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.
21 22 23 24 25 26 27 |
# File 'lib/osctl/image/operations/test/image.rb', line 21 def initialize(base_dir, image, tests, opts) super() @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.
47 48 49 |
# File 'lib/osctl/image/operations/test/image.rb', line 47 def opts @opts end |
#tests ⇒ Object (readonly, protected)
Returns the value of attribute tests.
47 48 49 |
# File 'lib/osctl/image/operations/test/image.rb', line 47 def tests @tests end |
Instance Method Details
#execute ⇒ Array<Operations::Test::Run::Status>
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/osctl/image/operations/test/image.rb', line 30 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], ip_allocator: opts[:ip_allocator] ) end end |