Extract linter in `docker:test` Rake task into `docker:lint`.
This commit is contained in:
parent
6ed65b1ca3
commit
8ecf383c55
|
@ -7,7 +7,6 @@
|
||||||
# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all core plugins before running tests
|
# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all core plugins before running tests
|
||||||
# => RUBY_ONLY set to 1 to skip all qunit tests
|
# => RUBY_ONLY set to 1 to skip all qunit tests
|
||||||
# => JS_ONLY set to 1 to skip all rspec tests
|
# => JS_ONLY set to 1 to skip all rspec tests
|
||||||
# => SKIP_LINT set to 1 to skip rubocop and eslint checks
|
|
||||||
# => SINGLE_PLUGIN set to plugin name to only run plugin-specific rspec tests (you'll probably want to SKIP_CORE as well)
|
# => SINGLE_PLUGIN set to plugin name to only run plugin-specific rspec tests (you'll probably want to SKIP_CORE as well)
|
||||||
# => BISECT set to 1 to run rspec --bisect (applies to core rspec tests only)
|
# => BISECT set to 1 to run rspec --bisect (applies to core rspec tests only)
|
||||||
# => RSPEC_SEED set to seed to use for rspec tests (applies to core rspec tests only)
|
# => RSPEC_SEED set to seed to use for rspec tests (applies to core rspec tests only)
|
||||||
|
@ -32,6 +31,15 @@ def run_or_fail(command)
|
||||||
$?.exitstatus == 0
|
$?.exitstatus == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc 'Run JS and Ruby linters'
|
||||||
|
task 'docker:lint' do
|
||||||
|
success = run_or_fail("bundle exec rubocop --parallel")
|
||||||
|
success = run_or_fail("eslint app/assets/javascripts test/javascripts")
|
||||||
|
success = run_or_fail("eslint --ext .es6 app/assets/javascripts test/javascripts plugins")
|
||||||
|
|
||||||
|
exit 1 if !success
|
||||||
|
end
|
||||||
|
|
||||||
desc 'Run all tests (JS and code in a standalone environment)'
|
desc 'Run all tests (JS and code in a standalone environment)'
|
||||||
task 'docker:test' do
|
task 'docker:test' do
|
||||||
begin
|
begin
|
||||||
|
@ -64,8 +72,6 @@ task 'docker:test' do
|
||||||
unless ENV["JS_ONLY"]
|
unless ENV["JS_ONLY"]
|
||||||
|
|
||||||
unless ENV["SKIP_CORE"]
|
unless ENV["SKIP_CORE"]
|
||||||
@good &&= run_or_fail("bundle exec rubocop --parallel") unless ENV["SKIP_LINT"]
|
|
||||||
|
|
||||||
params = []
|
params = []
|
||||||
if ENV["BISECT"]
|
if ENV["BISECT"]
|
||||||
params << "--bisect"
|
params << "--bisect"
|
||||||
|
@ -78,10 +84,8 @@ task 'docker:test' do
|
||||||
|
|
||||||
unless ENV["SKIP_PLUGINS"]
|
unless ENV["SKIP_PLUGINS"]
|
||||||
if ENV["SINGLE_PLUGIN"]
|
if ENV["SINGLE_PLUGIN"]
|
||||||
@good &&= run_or_fail("bundle exec rubocop --parallel plugins/#{ENV["SINGLE_PLUGIN"]}") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("bundle exec rake plugin:spec['#{ENV["SINGLE_PLUGIN"]}']")
|
@good &&= run_or_fail("bundle exec rake plugin:spec['#{ENV["SINGLE_PLUGIN"]}']")
|
||||||
else
|
else
|
||||||
@good &&= run_or_fail("bundle exec rubocop --parallel plugins") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("bundle exec rake plugin:spec")
|
@good &&= run_or_fail("bundle exec rake plugin:spec")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -90,18 +94,14 @@ task 'docker:test' do
|
||||||
|
|
||||||
unless ENV["RUBY_ONLY"]
|
unless ENV["RUBY_ONLY"]
|
||||||
unless ENV["SKIP_CORE"]
|
unless ENV["SKIP_CORE"]
|
||||||
@good &&= run_or_fail("eslint app/assets/javascripts test/javascripts") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("eslint --ext .es6 app/assets/javascripts test/javascripts") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("bundle exec rake qunit:test['600000']")
|
@good &&= run_or_fail("bundle exec rake qunit:test['600000']")
|
||||||
@good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']")
|
@good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']")
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV["SKIP_PLUGINS"]
|
unless ENV["SKIP_PLUGINS"]
|
||||||
if ENV["SINGLE_PLUGIN"]
|
if ENV["SINGLE_PLUGIN"]
|
||||||
@good &&= run_or_fail("eslint --ext .es6 plugins/#{ENV['SINGLE_PLUGIN']}") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','600000']")
|
@good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','600000']")
|
||||||
else
|
else
|
||||||
@good &&= run_or_fail("eslint --ext .es6 plugins") unless ENV["SKIP_LINT"]
|
|
||||||
@good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']")
|
@good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,4 +12,5 @@ unless ENV['NO_UPDATE']
|
||||||
run_or_fail("bundle")
|
run_or_fail("bundle")
|
||||||
end
|
end
|
||||||
|
|
||||||
run_or_fail("bundle exec rake docker:test")
|
run_or_fail("bundle exec rake docker:lint") unless ENV["SKIP_LINT"]
|
||||||
|
run_or_fail("bundle exec rake docker:test") unless ENV["LINT_ONLY"]
|
||||||
|
|
Loading…
Reference in New Issue