From ce21205d398662020ed9f75eae7c18797d3db78d Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 20 Sep 2022 18:11:26 +0100 Subject: [PATCH] DEV: Add support for running plugin qunit in parallel (#18291) For example, to run in three concurrent browsers and assemble the results: ``` QUNIT_PARALLEL=3 bin/rake "plugin:qunit[discourse-chat]" ``` --- lib/tasks/qunit.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tasks/qunit.rake b/lib/tasks/qunit.rake index a4941c8e932..98a99993586 100644 --- a/lib/tasks/qunit.rake +++ b/lib/tasks/qunit.rake @@ -108,7 +108,10 @@ task "qunit:test", [:timeout, :qunit_path] do |_, args| test_page = "#{qunit_path}?#{query}&testem=1" cmd += ["yarn", "testem", "ci", "-f", "testem.js", "-t", test_page] else - cmd += ["yarn", "ember", "test", "--query", query] + cmd += ["yarn", "ember", "exam", "--query", query] + if parallel = ENV["QUNIT_PARALLEL"] + cmd += ["--load-balance", "--parallel", parallel] + end end system(*cmd, chdir: "#{Rails.root}/app/assets/javascripts/discourse")