diff --git a/app/assets/javascripts/discourse/testem.js b/app/assets/javascripts/discourse/testem.js index 1fd4b7132e7..04eaf41e4bd 100644 --- a/app/assets/javascripts/discourse/testem.js +++ b/app/assets/javascripts/discourse/testem.js @@ -28,13 +28,13 @@ module.exports = { disable_watching: true, launch_in_ci: ["Chrome"], // launch_in_dev: ["Chrome"] // Ember-CLI always launches testem in 'CI' mode - tap_failed_tests_only: process.env.CI, + tap_failed_tests_only: false, parallel: 1, // disable parallel tests for stability browser_start_timeout: 120, browser_args: { Chrome: [ // --no-sandbox is needed when running Chrome inside a container - process.env.CI || process.env.EMBER_CLI ? "--no-sandbox" : null, + process.env.CI ? "--no-sandbox" : null, "--headless", "--disable-dev-shm-usage", "--disable-software-rasterizer", diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake index 8a914d428fa..0038bfe62a1 100644 --- a/lib/tasks/docker.rake +++ b/lib/tasks/docker.rake @@ -18,8 +18,6 @@ # => PAUSE_ON_TERMINATE set to 1 to pause prior to terminating redis and pg # => JS_TIMEOUT set timeout for qunit tests in ms # => WARMUP_TMP_FOLDER runs a single spec to warmup the tmp folder and obtain accurate results when profiling specs. -# => EMBER_CLI set to 1 to run JS tests using the Ember CLI -# => EMBER_CLI_BROWSERS comma separated list of browsers to test against. Options are Chrome, Firefox, and Headless Firefox. # # Other useful environment variables (not specific to this rake task) # => COMMIT_HASH used by the discourse_test docker image to load a specific commit of discourse @@ -205,23 +203,15 @@ task 'docker:test' do js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes unless ENV["SKIP_CORE"] - @good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}']") - @good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}','/wizard/qunit']") + @good &&= run_or_fail("cd app/assets/javascripts/discourse && CI=1 yarn ember exam --random") + @good &&= run_or_fail("QUNIT_EMBER_CLI=0 bundle exec rake qunit:test['#{js_timeout}','/wizard/qunit']") end unless ENV["SKIP_PLUGINS"] if ENV["SINGLE_PLUGIN"] - @good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','#{js_timeout}']") + @good &&= run_or_fail("CI=1 QUNIT_EMBER_CLI=1 bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','#{js_timeout}']") else - @good &&= run_or_fail("bundle exec rake plugin:qunit['*','#{js_timeout}']") - end - end - - if ENV["EMBER_CLI"] - Dir.chdir("#{Rails.root}/app/assets/javascripts/discourse") do # rubocop:disable Discourse/NoChdir - browsers = ENV["EMBER_CLI_BROWSERS"] || 'Chrome' - @good &&= run_or_fail("yarn install") - @good &&= run_or_fail("yarn ember test --launch #{browsers}") + @good &&= run_or_fail("CI=1 QUNIT_EMBER_CLI=1 bundle exec rake plugin:qunit['*','#{js_timeout}']") end end end