diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 12:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 12:09:20 +0300 |
commit | 8ae36d93f1a63874b584f0488fde88c1fee999c4 (patch) | |
tree | f1788ba1a7fb00248ff008f817f6feea89304339 /spec/lib | |
parent | b394e58cc2e52e17e7991e3d7b705aa383c362ee (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/usage/metrics/instrumentations/count_all_ci_builds_metric_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage/metrics/instrumentations/count_all_ci_builds_metric_spec.rb b/spec/lib/gitlab/usage/metrics/instrumentations/count_all_ci_builds_metric_spec.rb new file mode 100644 index 00000000000..93814436395 --- /dev/null +++ b/spec/lib/gitlab/usage/metrics/instrumentations/count_all_ci_builds_metric_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::Usage::Metrics::Instrumentations::CountAllCiBuildsMetric, feature_category: :continuous_integration do + before do + create(:ci_build, created_at: 5.days.ago) + create(:ci_build, created_at: 1.year.ago) + end + + it_behaves_like 'a correct instrumented metric value', { time_frame: 'all', data_source: 'database' } do + let(:expected_value) { 2 } + end + + it_behaves_like 'a correct instrumented metric value', { time_frame: '28d', data_source: 'database' } do + let(:expected_value) { 1 } + end +end |