1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
require 'bundler/gem_tasks'
require 'puppetlabs_spec_helper/tasks/fixtures'
task :default => :spec
#### RUBOCOP ####
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names']
end
#### RSPEC ####
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
# thanks to the fixtures/modules/ symlinks this needs to exclude fixture modules explicitely
excludes = ['fixtures/**/*.rb,fixtures/modules/*/**/*.rb']
if RUBY_PLATFORM == 'java'
excludes += ['acceptance/**/*.rb', 'integration/**/*.rb', 'puppet/resource_api/*_context_spec.rb', 'puppet/util/network_device/simple/device_spec.rb']
t.rspec_opts = '--tag ~agent_test'
t.rspec_opts << ' --tag ~j17_exclude' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
end
t.exclude_pattern = "spec/{#{excludes.join ','}}"
end
task :spec => :spec_prep
namespace :spec do
desc 'Run RSpec code examples with coverage collection'
task :coverage do
ENV['SIMPLECOV'] = 'yes'
Rake::Task['spec'].execute
end
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "spec/puppet/**/*_spec.rb,spec/integration/**/*_spec.rb"
end
task :unit => :spec_prep
end
#### LICENSE_FINDER ####
desc 'Check for unapproved licenses in dependencies'
task(:license_finder) do
system('license_finder --decisions-file=.dependency_decisions.yml') || raise(StandardError, 'Unapproved license(s) found on dependencies')
end
#### CHANGELOG ####
begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
require 'puppet/resource_api/version'
config.future_release = "#{Puppet::ResourceApi::VERSION}"
config.header = "# Changelog\n\n" \
"All significant changes to this repo will be summarized in this file.\n"
# config.include_labels = %w[enhancement bug]
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
config.user = 'puppetlabs'
config.project = 'puppet-resource_api'
config.exclude_tags = ['v1.8.14']
end
rescue LoadError
desc 'Install github_changelog_generator to get access to automatic changelog generation'
task :changelog do
raise 'Install github_changelog_generator to get access to automatic changelog generation'
end
end
|