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
hash
for unique comparison. -
#hash ⇒ String
Used for unique comparison.
Instance Attribute Details
#failed ⇒ Object
Returns the value of attribute failed
34 35 36 |
# File 'lib/ci_runner/check/circle_ci.rb', line 34 def failed @failed end |
#name ⇒ Object
Returns the value of attribute name
34 35 36 |
# File 'lib/ci_runner/check/circle_ci.rb', line 34 def name @name end |
#output_url ⇒ Object
Returns the value of attribute output_url
34 35 36 |
# File 'lib/ci_runner/check/circle_ci.rb', line 34 def output_url @output_url end |
Instance Method Details
#eql?(other) ⇒ Boolean
Used in conjuction with hash
for unique comparison.
40 41 42 43 44 |
# File 'lib/ci_runner/check/circle_ci.rb', line 40 def eql?(other) return false if failed || other.failed name == other.name end |
#hash ⇒ String
Used for unique comparison.
49 50 51 |
# File 'lib/ci_runner/check/circle_ci.rb', line 49 def hash [self.class, name, failed].hash end |