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]"
```
This commit is contained in:
David Taylor 2022-09-20 18:11:26 +01:00 committed by GitHub
parent 496f910f03
commit ce21205d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")