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



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ci_helper/commands/run_specs.rb', line 6

def call
  files_to_run = job_files
  return if files_to_run.empty?

  create_and_migrate_database! if with_database?
  create_and_migrate_clickhouse_database! if with_clickhouse?
  execute("bundle exec rspec #{Shellwords.join(files_to_run)}")
  return 0 unless split_resultset?

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