2020-01-29 01:43:28 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-10 23:42:40 +08:00
|
|
|
require 'resque/tasks'
|
2021-08-31 05:46:52 +08:00
|
|
|
require 'rake/testtask'
|
2017-07-10 23:42:40 +08:00
|
|
|
|
2020-01-29 01:43:28 +08:00
|
|
|
task 'resque:setup' => :environment do
|
2017-07-10 23:42:40 +08:00
|
|
|
props = BigBlueButton.read_props
|
2017-07-14 04:48:02 +08:00
|
|
|
redis_host = props['redis_workers_host'] || props['redis_host']
|
|
|
|
redis_port = props['redis_workers_port'] || props['redis_port']
|
2017-07-10 23:42:40 +08:00
|
|
|
Resque.redis = "#{redis_host}:#{redis_port}"
|
2017-07-14 04:48:20 +08:00
|
|
|
|
|
|
|
# Make sure we're in the right directory because several rap scripts assume
|
|
|
|
# they are being executed from there and will fail otherwise
|
2020-01-29 01:43:28 +08:00
|
|
|
Dir.chdir(File.expand_path('scripts', __dir__))
|
2017-07-10 23:42:40 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
task :environment do
|
2020-01-29 01:43:28 +08:00
|
|
|
require_relative 'lib/boot'
|
|
|
|
require 'recordandplayback/workers'
|
2017-07-10 23:42:40 +08:00
|
|
|
end
|
2021-08-31 05:46:52 +08:00
|
|
|
|
|
|
|
Rake::TestTask.new(:test) do |t|
|
|
|
|
t.libs << 'test'
|
|
|
|
t.libs << 'lib'
|
|
|
|
t.test_files = FileList['test/**/test_*.rb']
|
|
|
|
end
|