mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
make qunit at least wait for a network connection
This commit is contained in:
parent
8ec6d0ea6c
commit
85ddf73cf3
@ -20,14 +20,22 @@ task "qunit:test" => :environment do
|
|||||||
test_path = "#{Rails.root}/vendor/assets/javascripts"
|
test_path = "#{Rails.root}/vendor/assets/javascripts"
|
||||||
cmd = "phantomjs #{test_path}/run-qunit.js \"http://localhost:#{port}/qunit\""
|
cmd = "phantomjs #{test_path}/run-qunit.js \"http://localhost:#{port}/qunit\""
|
||||||
|
|
||||||
rake_system(cmd)
|
# wait for server to respond, will exception out on failure
|
||||||
|
tries = 0
|
||||||
|
begin
|
||||||
|
rake_system(cmd)
|
||||||
|
rescue
|
||||||
|
sleep 1
|
||||||
|
tries += 1
|
||||||
|
retry unless tries == 5
|
||||||
|
end
|
||||||
|
|
||||||
# A bit of a hack until we can figure this out on Travis
|
# A bit of a hack until we can figure this out on Travis
|
||||||
tries = 0
|
tries = 0
|
||||||
while tries < 3 && $?.exitstatus === 124
|
while tries < 3 && $?.exitstatus === 124
|
||||||
tries += 1
|
tries += 1
|
||||||
puts "\nTimed Out. Trying again...\n"
|
puts "\nTimed Out. Trying again...\n"
|
||||||
sh(cmd)
|
rake_system(cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
success &&= $?.success?
|
success &&= $?.success?
|
||||||
@ -43,4 +51,4 @@ task "qunit:test" => :environment do
|
|||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user