Class: Perfgate::CLI::CompareCommand
- Inherits:
-
Object
- Object
- Perfgate::CLI::CompareCommand
- Defined in:
- lib/perfgate/cli/compare_command.rb
Overview
Implements baseline compare (spec section 10.3): loads two
already-produced result bundles, runs them through the comparison
engine and policy engine, saves the comparison document, prints a
console (or Markdown, with --format markdown) report, and exits
with the CI exit code from spec section 17.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(argv) ⇒ CompareCommand
constructor
A new instance of CompareCommand.
Constructor Details
#initialize(argv) ⇒ CompareCommand
Returns a new instance of CompareCommand.
19 20 21 22 |
# File 'lib/perfgate/cli/compare_command.rb', line 19 def initialize(argv) @argv = argv.dup @options = { config: "perfgate.yml" } end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/perfgate/cli/compare_command.rb', line 24 def call config = load_configuration comparison_result = compare(config) policy_result = Policy::Engine.evaluate(comparison_result: comparison_result, config: config) comparison_path = save(config, comparison_result) report(comparison_result, policy_result, comparison_path) policy_result.fetch("exit_code") end |