Sha256: 8d4a578aac4d737fb7b5b48a4849fb001cd81a05646ba4ab2d651ed7b878643a

Contents?: true

Size: 1.7 KB

Versions: 10

Compression:

Stored size: 1.7 KB

Contents

begin
  require 'bundler/gem_tasks'
rescue LoadError
  task :gem
end

begin
  require 'rspec/core/rake_task'
  RSpec::Core::RakeTask.new(:spec) do |task|
    if @jenkins
      task.rspec_opts = [
        '--format', 'RspecJunitFormatter', '--out', 'target/rspec.xml',
        '--format', 'documentation'
      ]
    end
  end
rescue LoadError
  task :spec
end

begin
  require 'rspec/core/rake_task'
  RSpec::Core::RakeTask.new(:integration) do |task|
    task.pattern = 'integration/**/*_spec.rb'
    if @jenkins
      task.rspec_opts = [
        '--format', 'RspecJunitFormatter', '--out', 'target/integration.xml',
        '--format', 'documentation'
      ]
    end
  end
rescue LoadError
  task :integration
end

begin
  require 'rubocop/rake_task'
  RuboCop::RakeTask.new do |task|
    if @jenkins
      task.requires = [
        'rubocop/formatter/checkstyle_formatter'
      ]
      task.formatters = [
        'simple',
        'RuboCop::Formatter::CheckstyleFormatter'
      ]
      task.options = %w(--out target/rubocop.xml)
      task.fail_on_error = false
    end
  end
rescue LoadError
  task :rubocop
end

desc 'Run all (quick) tests'
task test: [:spec, :rubocop]

desc 'Run all tests including long running integration tests'
task test_integration: [:test, :integration]

desc 'Run all tests for jenkins'
task :jenkins_prepare do
  ENV['JENKINS'] = '1'
  # cleanup target
  FileUtils.rm_rf 'target'
  FileUtils.mkdir 'target'

  @jenkins = true
end

desc 'Run all quick tests from jenkins'
task jenkins: :jenkins_prepare do
  Rake::Task[:test].invoke
end

desc 'Run all tests (including integration) from jenkins'
task jenkins_integration: :jenkins_prepare do
  Rake::Task[:test_integration].invoke
end

task default: :test

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
picsolve_docker_builder-0.5.5 Rakefile
picsolve_docker_builder-0.5.4 Rakefile
picsolve_docker_builder-0.5.3 Rakefile
picsolve_docker_builder-0.5.2 Rakefile
picsolve_docker_builder-0.5.1 Rakefile
picsolve_docker_builder-0.5.0 Rakefile
picsolve_docker_builder-0.4.0 Rakefile
picsolve_docker_builder-0.3.2 Rakefile
picsolve_docker_builder-0.3.1 Rakefile
picsolve_docker_builder-0.3.0 Rakefile