From f5f4c36795b92652db4b96ddeb89d7d7d36ec5c2 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 2 May 2017 16:02:00 -0400 Subject: [PATCH] Increase autospec qunit timeout to 600 seconds Correct it so it refocuses on correct runner after running a test JS tests can not focus on line so skip in vim mode --- lib/autospec/manager.rb | 22 +++++++++++++++---- lib/autospec/qunit_runner.rb | 3 +++ lib/autospec/run-qunit.js | 4 ++-- .../javascripts/widgets/home-logo-test.js.es6 | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/autospec/manager.rb b/lib/autospec/manager.rb index cd9c779190c..538d2761449 100644 --- a/lib/autospec/manager.rb +++ b/lib/autospec/manager.rb @@ -66,10 +66,17 @@ class Autospec::Manager Autospec::QunitRunner.new end - def ensure_all_specs_will_run + def ensure_all_specs_will_run(current_runner=nil) puts "@@@@@@@@@@@@ ensure_all_specs_will_run" if @debug + + @queue.reject!{|_,s,_| s == "spec"} + + if current_runner + @queue.concat [['spec', 'spec', current_runner]] + end + @runners.each do |runner| - @queue << ['spec', 'spec', runner] unless @queue.any? { |_, s, r| s == "spec" && r == runner } + @queue.concat [['spec', 'spec', runner]] unless @queue.any? { |_, s, r| s == "spec" && r == runner } end end @@ -126,7 +133,7 @@ class Autospec::Manager has_failed = true if result > 0 focus_on_failed_tests(current) - ensure_all_specs_will_run + ensure_all_specs_will_run(runner) end end @@ -186,7 +193,11 @@ class Autospec::Manager # process_change can aquire a mutex and block # the acceptor Thread.new do - process_change([[file,line]]) + if file =~ /(es6|js)$/ + process_change([[file]]) + else + process_change([[file,line]]) + end end "OK" end @@ -290,6 +301,9 @@ class Autospec::Manager else @queue.unshift([file, spec, runner]) end + + # push run all specs to end of queue in correct order + ensure_all_specs_will_run(runner) end puts "@@@@@@@@@@@@ specs queued" if @debug puts "@@@@@@@@@@@@ #{@queue}" if @debug diff --git a/lib/autospec/qunit_runner.rb b/lib/autospec/qunit_runner.rb index 53836c4a799..681d20a210d 100644 --- a/lib/autospec/qunit_runner.rb +++ b/lib/autospec/qunit_runner.rb @@ -152,6 +152,9 @@ module Autospec if m = /moduleForWidget\(['"]([^"']+)/i.match(line) return "widget:#{m[1]}" end + if m = /acceptance\(['"]([^"']+)/i.match(line) + return "Acceptance: #{m[1]}" + end end end diff --git a/lib/autospec/run-qunit.js b/lib/autospec/run-qunit.js index 54635bc399d..fcf10df5c61 100644 --- a/lib/autospec/run-qunit.js +++ b/lib/autospec/run-qunit.js @@ -54,8 +54,8 @@ page.open(args[0], function (status) { page.evaluate(colorizer); page.evaluate(logQUnit); - // wait up to 60 seconds for QUnit to finish - var timeout = 60 * 1000, + // wait up to 600 seconds for QUnit to finish + var timeout = 600 * 1000, start = Date.now(); var interval = setInterval(function() { diff --git a/test/javascripts/widgets/home-logo-test.js.es6 b/test/javascripts/widgets/home-logo-test.js.es6 index 2e9b09d0605..81db555c20b 100644 --- a/test/javascripts/widgets/home-logo-test.js.es6 +++ b/test/javascripts/widgets/home-logo-test.js.es6 @@ -11,7 +11,7 @@ widgetTest('basics', { template: '{{mount-widget widget="home-logo" args=args}}', setup() { this.siteSettings.logo_url = bigLogo; - this.siteSettings.logo_small_url= smallLogo; + this.siteSettings.logo_small_url = smallLogo; this.siteSettings.title = title; this.set('args', { minimized: false }); },