Class: Fluence::Ci::Tools::Runner

Inherits:
Object
  • Object
show all
Includes:
Steps
Defined in:
lib/fluence/ci/tools/runner.rb

Overview

Minimal orchestrator that mirrors the step(label, command) interface of ActiveSupport::ContinuousIntegration so the same Steps mixin composes against either host. Used by the rake task installed in pure gems (where ActiveSupport::ContinuousIntegration isn't available).

Examples:

Run the full catalog from a rake task

require 'fluence/ci/tools/runner'
namespace :fluence_ci do
  task :check do
    runner = Fluence::Ci::Tools::Runner.new
    runner.all
    runner.report!
  end
end

Constant Summary

Constants included from Steps

Steps::REPORT_DIR

Instance Method Summary collapse

Methods included from Steps

#all, #codequality, #docs, #lint, #security, #tests

Constructor Details

#initialize(io: $stdout) ⇒ Runner

Build a fresh runner with no recorded steps yet.

Parameters:

  • io (IO) (defaults to: $stdout)

    stream for human-readable progress output

Instance Method Details

#report!void

This method returns an undefined value.

Print the final report and raise SystemExit(1) on failure so the rake task / CLI propagates a non-zero exit status to CI. No-op return on success.

Raises:

  • (SystemExit)

    when at least one step failed

#step(label, command) ⇒ void

This method returns an undefined value.

Run a single command as a CI step. Tracks success/failure in @failures so #report! can decide whether to exit 1.

Parameters:

  • label (String)

    short human-readable name of the step

  • command (String)

    shell command to execute via system

#success?Boolean

Whether every recorded step succeeded so far.

Returns:

  • (Boolean)

    true when every recorded step succeeded