Class: CIRunner::Check::Step
- Inherits:
-
Struct
- Object
- Struct
- CIRunner::Check::Step
- Defined in:
- lib/ci_runner/check/circle_ci.rb
Overview
A Step object represents a CircleCI step. This Struct has eql? and hash implemented in order to check if two steps are the same and remove the duplicates.
Two steps are considered the same if their names are equal and both are successful. The reason this is implemented like this is to avoid downloading too many of the same logfiles.
Project on CircleCI can be configured to run in parallel, the number of steps and therefore log output we have to download increases exponentially.
As an example, imagine this CircleCI configuration:
‘Minitest’:
executor: ruby/default
parallelism: 16
steps:
- setup-ruby
- bundle install
- bin/rails test
CircleCI will create 48 steps (and 48 log download link). Downloading those 48 log, don’t make sense since they will be all similar. Unless they failed, in which case we download the log for that step.
Instance Attribute Summary collapse
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_url ⇒ Object
Returns the value of attribute output_url.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
Used in conjuction with
hashfor unique comparison. -
#hash ⇒ String
Used for unique comparison.
Instance Attribute Details
#failed ⇒ Object
Returns the value of attribute failed
35 36 37 |
# File 'lib/ci_runner/check/circle_ci.rb', line 35 def failed @failed end |
#name ⇒ Object
Returns the value of attribute name
35 36 37 |
# File 'lib/ci_runner/check/circle_ci.rb', line 35 def name @name end |
#output_url ⇒ Object
Returns the value of attribute output_url
35 36 37 |
# File 'lib/ci_runner/check/circle_ci.rb', line 35 def output_url @output_url end |
Instance Method Details
#eql?(other) ⇒ Boolean
Used in conjuction with hash for unique comparison.
41 42 43 44 45 |
# File 'lib/ci_runner/check/circle_ci.rb', line 41 def eql?(other) return false if failed || other.failed name == other.name end |
#hash ⇒ String
Used for unique comparison.
50 51 52 |
# File 'lib/ci_runner/check/circle_ci.rb', line 50 def hash [self.class, name, failed].hash end |