Run wizard specs in docker:test

This commit is contained in:
Robin Ward 2017-07-27 11:29:18 -04:00
parent 32c9ad6f7f
commit 5cfc2d8972
3 changed files with 9 additions and 6 deletions

View File

@ -3,8 +3,8 @@ require_dependency 'wizard/builder'
class WizardController < ApplicationController
before_filter :ensure_wizard_enabled, only: [:index]
before_filter :ensure_logged_in
before_filter :ensure_admin
before_filter :ensure_logged_in, except: [:qunit]
before_filter :ensure_admin, except: [:qunit]
skip_before_filter :check_xhr, :preload_json
@ -21,6 +21,7 @@ class WizardController < ApplicationController
end
def qunit
raise Discourse::InvalidAccess.new if Rails.env.production?
end
end

View File

@ -92,8 +92,9 @@ task 'docker:test' do
@good &&= run_or_fail("eslint --ext .es6 test/javascripts")
@good &&= run_or_fail("eslint test/javascripts")
@good &&= run_or_fail("bundle exec rake qunit:test['600000']")
@good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']")
end
unless ENV["SKIP_PLUGINS"]
if ENV["SINGLE_PLUGIN"]
@good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','600000']")
@ -101,7 +102,7 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']")
end
end
end
ensure

View File

@ -1,6 +1,6 @@
desc "Runs the qunit test suite"
task "qunit:test", [:timeout] => :environment do |_, args|
task "qunit:test", [:timeout, :qunit_path] => :environment do |_, args|
require "rack"
require "socket"
@ -35,7 +35,8 @@ task "qunit:test", [:timeout] => :environment do |_, args|
begin
success = true
test_path = "#{Rails.root}/vendor/assets/javascripts"
cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}/qunit"
qunit_path = args[:qunit_path] || "/qunit"
cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}#{qunit_path}"
options = {}