Commit a6f24365 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'am-fix-license-trial-instrumentation-metric' into 'master'

Fix license_trial instrumented metric

See merge request gitlab-org/gitlab!75105
parents 70667ba9 92530d88
......@@ -12,7 +12,7 @@ data_source: license
data_category: subscription
instrumentation_class: LicenseMetric
options:
attribute: id
attribute: license_id
distribution:
- ee
tier:
......
......@@ -12,7 +12,7 @@ data_source: license
data_category: subscription
instrumentation_class: LicenseMetric
options:
attribute: trial
attribute: 'trial?'
distribution:
- ee
tier:
......
......@@ -14,9 +14,9 @@ module Gitlab
# end
ALLOWED_ATTRIBUTES = %w(md5
id
license_id
plan
trial
trial?
starts_at
expires_at
user_count
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::LicenseMetric do
let(:current_license) { ::License.current }
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'trial?' } } do
let(:expected_value) { current_license.trial? }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'license_id' } } do
let(:expected_value) { current_license.license_id }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'expires_at' } } do
let(:expected_value) { current_license.expires_at }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'md5' } } do
let(:expected_value) { current_license.md5 }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'trial_ends_on' } } do
let(:expected_value) { ::License.trial_ends_on }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'plan' } } do
let(:expected_value) { current_license.plan }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'subscription_id' } } do
let(:expected_value) { current_license.subscription_id }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'starts_at' } } do
let(:expected_value) { current_license.starts_at }
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none', options: { attribute: 'user_count' } } do
let(:expected_value) { current_license.restricted_user_count }
end
end
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