Class: CIHelper::Commands::RunSpecs

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

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



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ci_helper/commands/run_specs.rb', line 9

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?

  execute("bundle exec rspec #{Shellwords.join(specs_to_run)}")
  return 0 unless split_resultset?

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