Commit e378ebea authored by charlie ablett's avatar charlie ablett

Merge branch 'schedule_requirement_worker' into 'master'

Schedule requirements processing conditionally

See merge request gitlab-org/gitlab!65322
parents 8a619c12 b1ba1aa7
......@@ -8,7 +8,9 @@ module EE
# and `Namespace#namespace_statistics` will return stale data.
::Ci::Minutes::EmailNotificationService.new(build.project.reset).execute if ::Gitlab.com?
RequirementsManagement::ProcessRequirementsReportsWorker.perform_async(build.id)
unless build.project.requirements.empty?
RequirementsManagement::ProcessRequirementsReportsWorker.perform_async(build.id)
end
super
end
......
......@@ -57,7 +57,15 @@ RSpec.describe BuildFinishedWorker do
end
end
it 'processes requirements reports' do
it 'does not schedule processing of requirement reports by default' do
expect(RequirementsManagement::ProcessRequirementsReportsWorker).not_to receive(:perform_async)
subject
end
it 'schedules processing of requirement reports if project has requirements' do
create(:requirement, project: project)
expect(RequirementsManagement::ProcessRequirementsReportsWorker).to receive(:perform_async)
subject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment