Commit 5d397c42 authored by Doug Stull's avatar Doug Stull

Add condition for fallback on license scan

- to produce reliable results
parent 5a38c4eb
......@@ -119,9 +119,7 @@ module EE
# handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
license_scan_count = results.delete(:license_scanning_jobs)
if license_scan_count && results[:license_management_jobs]
results[:license_management_jobs] += license_scan_count
end
results[:license_management_jobs] += license_scan_count
results
end
......
......@@ -123,6 +123,12 @@ describe Gitlab::UsageData do
expect(count_data[:sast_jobs]).to eq(1)
end
it 'correctly shows failure for combined license management' do
allow(Gitlab::Database::BatchCount).to receive(:batch_count).and_raise(ActiveRecord::StatementInvalid)
expect(count_data[:license_management_jobs]).to eq(-1)
end
it 'gathers group overview preferences usage data', :aggregate_failures do
expect(subject[:counts][:user_preferences_group_overview_details]).to eq(User.active.count - 2) # we have exactly 2 active users with security dashboard set
expect(subject[:counts][:user_preferences_group_overview_security_dashboard]).to eq 2
......
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