Move tasks under test namespace, accept license

moved lint, and 'test' under the `test:` namespace.
moved 'test' to `test:default`, lint is now `test:lint`.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-05-17 19:32:18 -07:00
parent e4ee7e21f5
commit 2a6e32e7a1

View file

@ -34,13 +34,6 @@ rescue LoadError
puts 'contrib tasks are unavailable because the git gem is not available.'
end
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:lint)
rescue LoadError
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
end
task :install do
inspec_bin_path = ::File.join(::File.dirname(__FILE__), "inspec-bin")
Dir.chdir(inspec_bin_path)
@ -54,18 +47,25 @@ GLOBS = [
]
# run tests
task default: [:lint, :test]
Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = Dir[*GLOBS].sort
t.warning = true
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
task default: ['test:lint', 'test:default']
namespace :test do
Rake::TestTask.new(:default) do |t|
t.libs << 'test'
t.test_files = Dir[*GLOBS].sort
t.warning = true
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
task :default => [:accept_license]
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:lint)
rescue LoadError
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
end
task :list do
puts Dir[*GLOBS].sort
@ -130,7 +130,7 @@ namespace :test do
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
# Inject a prerequisite task
task :functional => [:accept_license]
task :unit => [:accept_license]
task :resources do
tests = Dir['test/unit/resource/*_test.rb']