Files
danbooru/test/unit/danbooru_maintenance_test.rb
evazion 52bf4a3a6b maintenance: break maintenance tasks into individual jobs.
Break the hourly/daily/weekly/monthly maintenance tasks down into
individual delayed jobs. This way if one task fails, it won't prevent
other tasks from running. Also, jobs can be run in parallel, and can be
individually retried if they fail.
2021-09-26 20:38:30 -05:00

40 lines
786 B
Ruby

require 'test_helper'
class DanbooruMaintenanceTest < ActiveSupport::TestCase
context "hourly maintenance" do
should "work" do
assert_nothing_raised do
DanbooruMaintenance.hourly
perform_enqueued_jobs
end
end
end
context "daily maintenance" do
should "work" do
assert_nothing_raised do
DanbooruMaintenance.daily
perform_enqueued_jobs
end
end
end
context "weekly maintenance" do
should "work" do
assert_nothing_raised do
DanbooruMaintenance.weekly
perform_enqueued_jobs
end
end
end
context "monthly maintenance" do
should "work" do
assert_nothing_raised do
DanbooruMaintenance.monthly
perform_enqueued_jobs
end
end
end
end