Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/lint_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/lint_spec.rb45
1 files changed, 19 insertions, 26 deletions
diff --git a/spec/lib/gitlab/ci/lint_spec.rb b/spec/lib/gitlab/ci/lint_spec.rb
index cf07e952f26..b836ca395fa 100644
--- a/spec/lib/gitlab/ci/lint_spec.rb
+++ b/spec/lib/gitlab/ci/lint_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Ci::Lint do
+RSpec.describe Gitlab::Ci::Lint, feature_category: :pipeline_authoring do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
@@ -337,35 +337,28 @@ RSpec.describe Gitlab::Ci::Lint do
end
end
- context 'pipeline logger' do
- let(:counters) do
- {
- 'count' => a_kind_of(Numeric),
- 'avg' => a_kind_of(Numeric),
- 'sum' => a_kind_of(Numeric),
- 'max' => a_kind_of(Numeric),
- 'min' => a_kind_of(Numeric)
- }
- end
-
- let(:loggable_data) do
+ describe 'pipeline logger' do
+ let(:expected_data) do
{
'class' => 'Gitlab::Ci::Pipeline::Logger',
- 'config_build_context_duration_s' => counters,
- 'config_build_variables_duration_s' => counters,
- 'config_compose_duration_s' => counters,
- 'config_expand_duration_s' => counters,
- 'config_external_process_duration_s' => counters,
- 'config_stages_inject_duration_s' => counters,
- 'config_tags_resolve_duration_s' => counters,
- 'config_yaml_extend_duration_s' => counters,
- 'config_yaml_load_duration_s' => counters,
+ 'config_build_context_duration_s' => a_kind_of(Numeric),
+ 'config_build_variables_duration_s' => a_kind_of(Numeric),
+ 'config_root_duration_s' => a_kind_of(Numeric),
+ 'config_root_compose_duration_s' => a_kind_of(Numeric),
+ 'config_root_compose_jobs_factory_duration_s' => a_kind_of(Numeric),
+ 'config_root_compose_jobs_create_duration_s' => a_kind_of(Numeric),
+ 'config_expand_duration_s' => a_kind_of(Numeric),
+ 'config_external_process_duration_s' => a_kind_of(Numeric),
+ 'config_stages_inject_duration_s' => a_kind_of(Numeric),
+ 'config_tags_resolve_duration_s' => a_kind_of(Numeric),
+ 'config_yaml_extend_duration_s' => a_kind_of(Numeric),
+ 'config_yaml_load_duration_s' => a_kind_of(Numeric),
'pipeline_creation_caller' => 'Gitlab::Ci::Lint',
'pipeline_creation_service_duration_s' => a_kind_of(Numeric),
'pipeline_persisted' => false,
'pipeline_source' => 'unknown',
'project_id' => project&.id,
- 'yaml_process_duration_s' => counters
+ 'yaml_process_duration_s' => a_kind_of(Numeric)
}
end
@@ -403,7 +396,7 @@ RSpec.describe Gitlab::Ci::Lint do
end
it 'creates a log entry' do
- expect(Gitlab::AppJsonLogger).to receive(:info).with(loggable_data)
+ expect(Gitlab::AppJsonLogger).to receive(:info).with(a_hash_including(expected_data))
validate
end
@@ -424,11 +417,11 @@ RSpec.describe Gitlab::Ci::Lint do
let(:project) { nil }
let(:project_nil_loggable_data) do
- loggable_data.except('project_id')
+ expected_data.except('project_id')
end
it 'creates a log entry without project_id' do
- expect(Gitlab::AppJsonLogger).to receive(:info).with(project_nil_loggable_data)
+ expect(Gitlab::AppJsonLogger).to receive(:info).with(a_hash_including(project_nil_loggable_data))
validate
end