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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
commite4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch)
tree2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /spec/lib/gitlab/ci/config/external/file/base_spec.rb
parentffda4e7bcac36987f936b4ba515995a6698698f0 (diff)
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/config/external/file/base_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/external/file/base_spec.rb40
1 files changed, 14 insertions, 26 deletions
diff --git a/spec/lib/gitlab/ci/config/external/file/base_spec.rb b/spec/lib/gitlab/ci/config/external/file/base_spec.rb
index 1c5918f77ca..d6dd75f4b10 100644
--- a/spec/lib/gitlab/ci/config/external/file/base_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/file/base_spec.rb
@@ -106,7 +106,7 @@ RSpec.describe Gitlab::Ci::Config::External::File::Base, feature_category: :pipe
it 'is not a valid file' do
expect(valid?).to be_falsy
expect(file.error_message)
- .to eq('`some/file/xxxxxxxxxxxxxxxx.yml`: content does not have a valid YAML syntax')
+ .to eq('`some/file/xxxxxxxxxxxxxxxx.yml`: Invalid configuration format')
end
end
@@ -128,31 +128,6 @@ RSpec.describe Gitlab::Ci::Config::External::File::Base, feature_category: :pipe
end
end
- context 'when interpolation is disabled but there is a spec header' do
- before do
- stub_feature_flags(ci_includable_files_interpolation: false)
- end
-
- let(:location) { 'some-location.yml' }
-
- let(:content) do
- <<~YAML
- spec:
- include:
- website:
- ---
- run:
- script: deploy $[[ inputs.website ]]
- YAML
- end
-
- it 'returns an error saying that interpolation is disabled' do
- expect(valid?).to be_falsy
- expect(file.errors)
- .to include('`some-location.yml`: can not evaluate included file because interpolation is disabled')
- end
- end
-
context 'when interpolation was unsuccessful' do
let(:location) { 'some-location.yml' }
@@ -275,4 +250,17 @@ RSpec.describe Gitlab::Ci::Config::External::File::Base, feature_category: :pipe
it { is_expected.to eq([{ location: location, content: content }, nil, 'HEAD'].hash) }
end
end
+
+ describe '#load_and_validate_expanded_hash!' do
+ let(:location) { 'some/file/config.yml' }
+ let(:logger) { instance_double(::Gitlab::Ci::Pipeline::Logger, :instrument) }
+ let(:context_params) { { sha: 'HEAD', variables: variables, project: project, logger: logger } }
+
+ it 'includes instrumentation for loading and expanding the content' do
+ expect(logger).to receive(:instrument).once.ordered.with(:config_file_fetch_content_hash).and_yield
+ expect(logger).to receive(:instrument).once.ordered.with(:config_file_expand_content_includes).and_yield
+
+ file.load_and_validate_expanded_hash!
+ end
+ end
end