2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-09-07 13:46:23 +08:00
|
|
|
# The Rake tasks in this file are designed to be used inside the `discourse/discourse_test:release` image.
|
|
|
|
# Running it anywhere else is not supported.
|
|
|
|
|
|
|
|
def run_or_fail(command)
|
|
|
|
log(command)
|
|
|
|
pid = Process.spawn(command)
|
|
|
|
Process.wait(pid)
|
|
|
|
$?.exitstatus == 0
|
|
|
|
end
|
|
|
|
|
|
|
|
def log(message)
|
|
|
|
puts "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{message}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def setup_postgres(skip_init:)
|
|
|
|
unless skip_init
|
|
|
|
log "Initializing postgres"
|
|
|
|
system("script/start_test_db.rb --skip-run", exception: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
log "Starting postgres"
|
|
|
|
Process.spawn("script/start_test_db.rb --skip-setup --exec")
|
|
|
|
end
|
|
|
|
|
|
|
|
def setup_redis
|
|
|
|
log "Starting background redis"
|
|
|
|
data_directory = "#{Rails.root}/tmp/test_data/redis"
|
|
|
|
`rm -rf #{data_directory} && mkdir -p #{data_directory}`
|
2023-09-07 14:22:14 +08:00
|
|
|
Process.spawn("redis-server --dir #{data_directory}")
|
2023-09-07 13:46:23 +08:00
|
|
|
end
|
|
|
|
|
2023-09-08 10:16:23 +08:00
|
|
|
def setup_test_env(
|
|
|
|
setup_multisite: false,
|
|
|
|
create_db: true,
|
2023-11-22 15:12:02 +08:00
|
|
|
create_parallel_dbs: false,
|
2023-09-08 10:16:23 +08:00
|
|
|
install_all_official: false,
|
|
|
|
update_all_plugins: false,
|
2023-09-08 12:16:02 +08:00
|
|
|
plugins_to_remove: "",
|
2023-09-08 10:16:23 +08:00
|
|
|
load_plugins: false
|
|
|
|
)
|
|
|
|
ENV["RAILS_ENV"] = "test"
|
|
|
|
# this shaves all the creation of the multisite db off
|
|
|
|
# for js tests
|
|
|
|
ENV["SKIP_MULTISITE"] = "1" unless setup_multisite
|
|
|
|
|
|
|
|
success = true
|
|
|
|
success &&= run_or_fail("bundle exec rake db:create") if create_db
|
2023-11-22 15:12:02 +08:00
|
|
|
success &&= run_or_fail("bundle exec rake parallel:create") if create_parallel_dbs
|
2023-09-08 10:16:23 +08:00
|
|
|
success &&= run_or_fail("bundle exec rake plugin:install_all_official") if install_all_official
|
|
|
|
success &&= run_or_fail("bundle exec rake plugin:update_all") if update_all_plugins
|
|
|
|
|
2023-09-08 12:16:02 +08:00
|
|
|
if !plugins_to_remove.blank?
|
2023-09-08 10:16:23 +08:00
|
|
|
plugins_to_remove
|
|
|
|
.split(",")
|
|
|
|
.map(&:strip)
|
|
|
|
.each do |plugin|
|
|
|
|
puts "[SKIP_INSTALL_PLUGINS] Removing #{plugin}"
|
|
|
|
`rm -fr plugins/#{plugin}`
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-11-22 15:12:02 +08:00
|
|
|
success &&= migrate_databases(parallel: create_parallel_dbs, load_plugins: load_plugins)
|
2023-09-08 10:16:23 +08:00
|
|
|
success
|
|
|
|
end
|
|
|
|
|
2023-09-07 13:46:23 +08:00
|
|
|
def migrate_databases(parallel: false, load_plugins: false)
|
|
|
|
migrate_env = load_plugins ? "LOAD_PLUGINS=1" : "LOAD_PLUGINS=0"
|
|
|
|
|
2023-09-08 10:16:23 +08:00
|
|
|
success = true
|
2023-11-17 00:07:36 +08:00
|
|
|
success &&=
|
|
|
|
run_or_fail("#{migrate_env} script/silence_successful_output bundle exec rake db:migrate")
|
|
|
|
success &&=
|
|
|
|
run_or_fail(
|
|
|
|
"#{migrate_env} script/silence_successful_output bundle exec rake parallel:migrate",
|
|
|
|
) if parallel
|
2023-09-07 13:46:23 +08:00
|
|
|
success
|
|
|
|
end
|
|
|
|
|
2024-07-10 11:27:20 +08:00
|
|
|
def number_of_processors
|
|
|
|
Etc.nprocessors
|
|
|
|
end
|
|
|
|
|
2024-08-29 19:00:54 +08:00
|
|
|
def qunit_concurrency
|
|
|
|
# qunit runs all browsers against a single ember-cli (express.js) server, so this will not scale infinitely
|
|
|
|
# therefore, cap at 8
|
|
|
|
[number_of_processors / 2, 8].min
|
|
|
|
end
|
|
|
|
|
2023-11-22 11:51:43 +08:00
|
|
|
def system_tests_parallel_tests_processors_env
|
2024-07-10 11:27:20 +08:00
|
|
|
"PARALLEL_TEST_PROCESSORS=#{number_of_processors / 2}"
|
2023-11-22 11:51:43 +08:00
|
|
|
end
|
|
|
|
|
2023-09-08 10:16:23 +08:00
|
|
|
# Environment Variables (specific to this rake task)
|
2023-11-22 15:12:02 +08:00
|
|
|
# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all official plugins
|
|
|
|
# => UPDATE_ALL_PLUGINS set to 1 to update all plugins
|
|
|
|
# => LOAD_PLUGINS set to 1 to load plugins
|
|
|
|
# => CREATE_PARALLEL_DATABASES set to 1 to setup parallel test databases
|
2023-09-07 13:46:23 +08:00
|
|
|
desc "Setups up the test environment"
|
|
|
|
task "docker:test:setup" do
|
|
|
|
setup_redis
|
|
|
|
setup_postgres(skip_init: false)
|
2023-09-08 10:16:23 +08:00
|
|
|
|
|
|
|
setup_test_env(
|
|
|
|
setup_multisite: true,
|
|
|
|
create_db: true,
|
2023-11-22 15:12:02 +08:00
|
|
|
create_parallel_dbs: !!ENV["CREATE_PARALLEL_DATABASES"],
|
|
|
|
load_plugins: !!ENV["LOAD_PLUGINS"],
|
|
|
|
install_all_official: !!ENV["INSTALL_OFFICIAL_PLUGINS"],
|
|
|
|
update_all_plugins: !!ENV["UPDATE_ALL_PLUGINS"],
|
2023-09-08 10:16:23 +08:00
|
|
|
)
|
2023-09-07 13:46:23 +08:00
|
|
|
end
|
|
|
|
|
2017-07-21 08:59:54 +08:00
|
|
|
# Environment Variables (specific to this rake task)
|
2017-08-22 20:47:29 +08:00
|
|
|
# => SKIP_LINT set to 1 to skip linting (eslint and rubocop)
|
|
|
|
# => SKIP_TESTS set to 1 to skip all tests
|
2017-07-26 21:07:46 +08:00
|
|
|
# => SKIP_CORE set to 1 to skip core tests (rspec and qunit)
|
|
|
|
# => SKIP_PLUGINS set to 1 to skip plugin tests (rspec and qunit)
|
2021-05-21 09:43:47 +08:00
|
|
|
# => SKIP_INSTALL_PLUGINS comma separated list of plugins you want to skip installing
|
2017-07-21 08:59:54 +08:00
|
|
|
# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all core plugins before running tests
|
2023-03-16 05:33:47 +08:00
|
|
|
# => RUN_SYSTEM_TESTS set to 1 to run the system tests as well
|
2017-07-21 08:59:54 +08:00
|
|
|
# => RUBY_ONLY set to 1 to skip all qunit tests
|
2017-07-26 21:07:46 +08:00
|
|
|
# => JS_ONLY set to 1 to skip all rspec tests
|
|
|
|
# => SINGLE_PLUGIN set to plugin name to only run plugin-specific rspec tests (you'll probably want to SKIP_CORE as well)
|
|
|
|
# => BISECT set to 1 to run rspec --bisect (applies to core rspec tests only)
|
|
|
|
# => RSPEC_SEED set to seed to use for rspec tests (applies to core rspec tests only)
|
2018-04-11 14:39:39 +08:00
|
|
|
# => PAUSE_ON_TERMINATE set to 1 to pause prior to terminating redis and pg
|
2019-03-19 00:39:25 +08:00
|
|
|
# => JS_TIMEOUT set timeout for qunit tests in ms
|
2019-10-26 03:31:05 +08:00
|
|
|
# => WARMUP_TMP_FOLDER runs a single spec to warmup the tmp folder and obtain accurate results when profiling specs.
|
2017-07-21 08:59:54 +08:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# this can also be set to a branch, e.g. "origin/tests-passed"
|
|
|
|
#
|
|
|
|
# Example usage:
|
2017-07-26 21:07:46 +08:00
|
|
|
# Run all core and plugin tests:
|
2017-07-21 08:59:54 +08:00
|
|
|
# docker run discourse/discourse_test:release
|
2017-07-25 14:27:09 +08:00
|
|
|
# Run only rspec tests:
|
2017-07-21 08:59:54 +08:00
|
|
|
# docker run -e RUBY_ONLY=1 discourse/discourse_test:release
|
2017-07-26 21:07:46 +08:00
|
|
|
# Run all plugin tests (with a plugin mounted from host filesystem):
|
|
|
|
# docker run -e SKIP_CORE=1 -v $(pwd)/my-awesome-plugin:/var/www/discourse/plugins/my-awesome-plugin discourse/discourse_test:release
|
|
|
|
# Run tests for a specific plugin (with a plugin mounted from host filesystem):
|
|
|
|
# docker run -e SKIP_CORE=1 SINGLE_PLUGIN='my-awesome-plugin' -v $(pwd)/my-awesome-plugin:/var/www/discourse/plugins/my-awesome-plugin discourse/discourse_test:release
|
2014-06-18 15:31:25 +08:00
|
|
|
desc "Run all tests (JS and code in a standalone environment)"
|
|
|
|
task "docker:test" do
|
2023-09-07 13:46:23 +08:00
|
|
|
def run_or_fail_prettier(*patterns)
|
|
|
|
if patterns.any? { |p| Dir[p].any? }
|
|
|
|
patterns = patterns.map { |p| "'#{p}'" }.join(" ")
|
2024-09-03 17:51:07 +08:00
|
|
|
run_or_fail("pnpm pprettier --list-different #{patterns}")
|
2023-09-07 13:46:23 +08:00
|
|
|
else
|
|
|
|
puts "Skipping prettier. Pattern not found."
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-06-18 15:31:25 +08:00
|
|
|
begin
|
2017-08-22 20:47:29 +08:00
|
|
|
@good = true
|
2024-09-03 17:51:07 +08:00
|
|
|
@good &&= run_or_fail("pnpm install")
|
2021-06-03 02:29:47 +08:00
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["SKIP_LINT"]
|
2018-06-08 17:49:31 +08:00
|
|
|
puts "Running linters/prettyfiers"
|
2024-09-03 17:51:07 +08:00
|
|
|
puts "eslint #{`pnpm eslint -v`}"
|
|
|
|
puts "prettier #{`pnpm prettier -v`}"
|
2018-06-21 00:34:49 +08:00
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
if ENV["SINGLE_PLUGIN"]
|
|
|
|
@good &&= run_or_fail("bundle exec rubocop --parallel plugins/#{ENV["SINGLE_PLUGIN"]}")
|
2020-06-04 03:35:08 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
|
|
|
"bundle exec ruby script/i18n_lint.rb plugins/#{ENV["SINGLE_PLUGIN"]}/config/locales/{client,server}.en.yml",
|
2021-11-18 03:52:22 +08:00
|
|
|
)
|
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-09-03 17:51:07 +08:00
|
|
|
"pnpm eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins/#{ENV["SINGLE_PLUGIN"]}",
|
2023-01-09 20:10:19 +08:00
|
|
|
)
|
|
|
|
|
2018-06-08 23:38:29 +08:00
|
|
|
puts "Listing prettier offenses in #{ENV["SINGLE_PLUGIN"]}:"
|
2020-08-20 18:36:52 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail_prettier(
|
|
|
|
"plugins/#{ENV["SINGLE_PLUGIN"]}/**/*.scss",
|
|
|
|
"plugins/#{ENV["SINGLE_PLUGIN"]}/**/*.{js,es6}",
|
|
|
|
)
|
2017-08-22 20:47:29 +08:00
|
|
|
else
|
2019-06-15 01:50:15 +08:00
|
|
|
@good &&= run_or_fail("bundle exec rake plugin:update_all") unless ENV["SKIP_PLUGINS"]
|
2017-08-22 20:47:29 +08:00
|
|
|
@good &&= run_or_fail("bundle exec rubocop --parallel") unless ENV["SKIP_CORE"]
|
2024-09-03 17:51:07 +08:00
|
|
|
@good &&= run_or_fail("pnpm eslint app/assets/javascripts") unless ENV["SKIP_CORE"]
|
2021-11-18 03:52:22 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-09-03 17:51:07 +08:00
|
|
|
"pnpm eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins",
|
2021-11-18 03:52:22 +08:00
|
|
|
) unless ENV["SKIP_PLUGINS"]
|
2023-01-09 20:10:19 +08:00
|
|
|
|
2020-06-04 03:35:08 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
|
|
|
'bundle exec ruby script/i18n_lint.rb "config/locales/{client,server}.en.yml"',
|
|
|
|
) unless ENV["SKIP_CORE"]
|
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
|
|
|
'bundle exec ruby script/i18n_lint.rb "plugins/**/locales/{client,server}.en.yml"',
|
|
|
|
) unless ENV["SKIP_PLUGINS"]
|
|
|
|
|
2018-06-08 23:38:29 +08:00
|
|
|
unless ENV["SKIP_CORE"]
|
|
|
|
puts "Listing prettier offenses in core:"
|
2022-07-07 13:29:14 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-09-03 17:51:07 +08:00
|
|
|
'pnpm pprettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.js"',
|
2022-07-07 13:29:14 +08:00
|
|
|
)
|
2018-06-08 23:38:29 +08:00
|
|
|
end
|
2018-06-08 17:49:31 +08:00
|
|
|
|
2018-06-08 23:38:29 +08:00
|
|
|
unless ENV["SKIP_PLUGINS"]
|
|
|
|
puts "Listing prettier offenses in plugins:"
|
2022-07-07 13:29:14 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-09-03 17:51:07 +08:00
|
|
|
'pnpm pprettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"',
|
2022-07-07 13:29:14 +08:00
|
|
|
)
|
2018-06-08 23:38:29 +08:00
|
|
|
end
|
2017-08-22 20:47:29 +08:00
|
|
|
end
|
|
|
|
end
|
2014-06-19 13:11:55 +08:00
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["SKIP_TESTS"]
|
2023-09-07 13:46:23 +08:00
|
|
|
@redis_pid = setup_redis
|
|
|
|
@pg_pid = setup_postgres(skip_init: ENV["SKIP_DB_CREATE"].present?)
|
2017-07-20 00:17:18 +08:00
|
|
|
|
2023-09-08 10:16:23 +08:00
|
|
|
@good &&=
|
|
|
|
setup_test_env(
|
2023-09-08 12:16:02 +08:00
|
|
|
setup_multisite: !ENV["JS_ONLY"],
|
|
|
|
create_db: !ENV["SKIP_DB_CREATE"],
|
2023-11-22 15:12:02 +08:00
|
|
|
create_parallel_dbs: !!ENV["USE_TURBO"],
|
2023-09-08 12:16:02 +08:00
|
|
|
install_all_official: !!ENV["INSTALL_OFFICIAL_PLUGINS"],
|
|
|
|
update_all_plugins: !!ENV["UPDATE_ALL_PLUGINS"],
|
|
|
|
plugins_to_remove: ENV["SKIP_INSTALL_PLUGINS"] || "",
|
2023-09-08 10:16:23 +08:00
|
|
|
load_plugins: !ENV["SKIP_PLUGINS"],
|
|
|
|
)
|
2018-06-07 15:20:06 +08:00
|
|
|
|
2018-09-12 23:43:21 +08:00
|
|
|
unless ENV["JS_ONLY"]
|
2023-11-22 11:51:43 +08:00
|
|
|
@good &&= run_or_fail("bin/ember-cli --build") if ENV["RUN_SYSTEM_TESTS"]
|
|
|
|
|
2019-10-26 03:31:05 +08:00
|
|
|
if ENV["WARMUP_TMP_FOLDER"]
|
2019-11-14 05:34:10 +08:00
|
|
|
run_or_fail("bundle exec rspec ./spec/requests/groups_controller_spec.rb")
|
2019-10-26 03:31:05 +08:00
|
|
|
end
|
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["SKIP_CORE"]
|
|
|
|
params = []
|
2019-06-27 00:04:29 +08:00
|
|
|
|
|
|
|
unless ENV["USE_TURBO"]
|
|
|
|
params << "--profile"
|
|
|
|
params << "--fail-fast"
|
|
|
|
params << "--bisect" if ENV["BISECT"]
|
|
|
|
params << "--seed #{ENV["RSPEC_SEED"]}" if ENV["RSPEC_SEED"]
|
2017-08-22 20:47:29 +08:00
|
|
|
end
|
2019-03-01 05:36:22 +08:00
|
|
|
|
2019-06-26 23:54:39 +08:00
|
|
|
if ENV["USE_TURBO"]
|
2020-08-08 00:04:55 +08:00
|
|
|
@good &&=
|
2023-09-12 09:45:49 +08:00
|
|
|
run_or_fail("bundle exec ./bin/turbo_rspec --verbose #{params.join(" ")}".strip)
|
2019-06-26 23:54:39 +08:00
|
|
|
else
|
|
|
|
@good &&= run_or_fail("bundle exec rspec #{params.join(" ")}".strip)
|
|
|
|
end
|
2023-09-12 09:45:49 +08:00
|
|
|
|
|
|
|
if ENV["RUN_SYSTEM_TESTS"]
|
2023-11-22 11:51:43 +08:00
|
|
|
@good &&=
|
|
|
|
if ENV["USE_TURBO"]
|
|
|
|
run_or_fail(
|
|
|
|
"#{system_tests_parallel_tests_processors_env} timeout --verbose 1800 bundle exec ./bin/turbo_rspec spec/system",
|
|
|
|
)
|
|
|
|
else
|
|
|
|
run_or_fail("timeout --verbose 1800 bundle exec rspec spec/system")
|
|
|
|
end
|
2023-09-12 09:45:49 +08:00
|
|
|
end
|
2017-07-21 08:59:54 +08:00
|
|
|
end
|
2017-07-25 14:27:09 +08:00
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["SKIP_PLUGINS"]
|
|
|
|
if ENV["SINGLE_PLUGIN"]
|
|
|
|
@good &&= run_or_fail("bundle exec rake plugin:spec['#{ENV["SINGLE_PLUGIN"]}']")
|
2023-11-22 11:51:43 +08:00
|
|
|
|
2023-10-23 07:41:21 +08:00
|
|
|
if ENV["RUN_SYSTEM_TESTS"]
|
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
|
|
|
"LOAD_PLUGINS=1 timeout --verbose 1600 bundle exec rspec plugins/#{ENV["SINGLE_PLUGIN"]}/spec/system".strip,
|
|
|
|
)
|
|
|
|
end
|
2017-08-22 20:47:29 +08:00
|
|
|
else
|
2019-11-23 02:27:47 +08:00
|
|
|
fail_fast = "RSPEC_FAILFAST=1" unless ENV["SKIP_FAILFAST"]
|
2023-10-04 00:45:35 +08:00
|
|
|
task = ENV["USE_TURBO"] ? "plugin:turbo_spec" : "plugin:spec"
|
|
|
|
@good &&= run_or_fail("#{fail_fast} bundle exec rake #{task}")
|
2023-11-22 11:51:43 +08:00
|
|
|
|
2023-10-23 07:41:21 +08:00
|
|
|
if ENV["RUN_SYSTEM_TESTS"]
|
|
|
|
@good &&=
|
2023-11-22 11:51:43 +08:00
|
|
|
if ENV["USE_TURBO"]
|
|
|
|
run_or_fail(
|
|
|
|
"LOAD_PLUGINS=1 #{system_tests_parallel_tests_processors_env} timeout --verbose 1600 bundle exec ./bin/turbo_rspec plugins/*/spec/system",
|
|
|
|
)
|
|
|
|
else
|
|
|
|
run_or_fail(
|
|
|
|
"LOAD_PLUGINS=1 timeout --verbose 1600 bundle exec rspec plugins/*/spec/system",
|
|
|
|
)
|
|
|
|
end
|
2023-10-23 07:41:21 +08:00
|
|
|
end
|
2023-03-16 05:33:47 +08:00
|
|
|
end
|
2017-08-22 20:47:29 +08:00
|
|
|
end
|
2017-07-26 21:07:46 +08:00
|
|
|
end
|
2017-07-27 23:29:18 +08:00
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["RUBY_ONLY"]
|
2019-03-19 00:39:25 +08:00
|
|
|
js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes
|
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
unless ENV["SKIP_CORE"]
|
2022-10-26 19:00:35 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-09-03 17:51:07 +08:00
|
|
|
"cd app/assets/javascripts/discourse && CI=1 pnpm ember exam --load-balance --parallel=#{qunit_concurrency} --random",
|
2022-10-26 19:00:35 +08:00
|
|
|
)
|
2017-08-22 20:47:29 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
unless ENV["SKIP_PLUGINS"]
|
|
|
|
if ENV["SINGLE_PLUGIN"]
|
2022-06-20 22:33:05 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
|
|
|
"CI=1 bundle exec rake plugin:qunit['#{ENV["SINGLE_PLUGIN"]}','#{js_timeout}']",
|
|
|
|
)
|
2017-08-22 20:47:29 +08:00
|
|
|
else
|
2024-07-10 11:27:20 +08:00
|
|
|
@good &&=
|
|
|
|
run_or_fail(
|
2024-08-29 19:00:54 +08:00
|
|
|
"QUNIT_PARALLEL=#{qunit_concurrency} CI=1 bundle exec rake plugin:qunit['*','#{js_timeout}']",
|
2024-07-10 11:27:20 +08:00
|
|
|
)
|
2021-04-30 01:51:34 +08:00
|
|
|
end
|
|
|
|
end
|
2017-08-22 20:47:29 +08:00
|
|
|
end
|
2014-06-20 07:27:09 +08:00
|
|
|
end
|
2014-06-18 15:31:25 +08:00
|
|
|
ensure
|
|
|
|
puts "Terminating"
|
|
|
|
|
2018-04-11 14:39:39 +08:00
|
|
|
if ENV["PAUSE_ON_TERMINATE"]
|
|
|
|
puts "Pausing prior to termination"
|
2018-04-11 14:46:27 +08:00
|
|
|
sleep
|
2018-04-11 14:39:39 +08:00
|
|
|
end
|
|
|
|
|
2017-08-22 20:47:29 +08:00
|
|
|
Process.kill("TERM", @redis_pid) if @redis_pid
|
|
|
|
Process.kill("TERM", @pg_pid) if @pg_pid
|
|
|
|
Process.wait @redis_pid if @redis_pid
|
|
|
|
Process.wait @pg_pid if @pg_pid
|
2014-06-18 15:31:25 +08:00
|
|
|
end
|
|
|
|
|
2021-06-03 02:29:47 +08:00
|
|
|
exit 1 unless @good
|
2014-06-18 15:31:25 +08:00
|
|
|
end
|