Class: Onceover::CLI::Run::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/onceover/cli/run.rb

Class Method Summary collapse

Class Method Details

.commandObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/onceover/cli/run.rb', line 37

def self.command
  @command ||= Cri::Command.define do
    name 'spec'
    usage 'spec'
    summary 'Runs spec tests'

    optional :p, :parallel, 'Runs spec tests in parallel. This increases speed at the cost of poorly formatted logs and irrelevant junit output.'
    optional nil, :format, 'Which RSpec formatter to use, valid options are: documentation, progress, FailureCollector, OnceoverFormatter. You also specify this multiple times', multiple: true, default: :defaults
    optional nil, :no_workarounds, 'Disables workarounds that have been added for convenience to get around common RSPec issues such as https://github.com/rodjek/rspec-puppet/issues/665'
    optional :ff, :fail_fast, 'Abort the run after the first failure'
    optional nil, :auto_vendored, 'Attempt to resolve vendored puppet modules. Ex: puppetlabs/cron_core', default: false

    run do |opts, args, cmd|
      repo = Onceover::Controlrepo.new(opts)
      Onceover::Deploy.new.deploy_local(repo, opts)
      runner = Onceover::Runner.new(repo,Onceover::TestConfig.new(repo.onceover_yaml, opts), :spec)
      runner.prepare!
      runner.run_spec!
    end
  end
end