Class: CIHelper::Commands::RunSpecs

Inherits:
BaseCommand show all
Defined in:
lib/ci_helper/commands/run_specs.rb

Constant Summary collapse

DEFAULT_SPLIT_THRESHOLD =
30.0
TIMINGS_RECORDER_PATH =
File.expand_path("../tools/spec_timings_recorder.rb", __dir__)

Instance Method Summary collapse

Methods inherited from BaseCommand

call!, #execute, #execute_with_env, #initialize, process_stdout

Constructor Details

This class inherits a constructor from CIHelper::Commands::BaseCommand

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ci_helper/commands/run_specs.rb', line 13

def call
  return if all_spec_files.empty?

  create_and_migrate_database! if with_database?
  create_and_migrate_clickhouse_database! if with_clickhouse?

  specs_to_run = job_count == 1 ? job_files : job_examples
  return 0 if specs_to_run.empty?

  run_rspec!(specs_to_run)
  return 0 unless split_resultset?

  execute("mv coverage/.resultset.json coverage/resultset.#{job_index}.json")
end