Commit a7eaa326 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'mc_rocha-fix-default-ci-config-path-355010' into 'master'

Fix default Ci config path

See merge request gitlab-org/gitlab!82827
parents 38ef5592 03dd150a
...@@ -6,7 +6,7 @@ module Security ...@@ -6,7 +6,7 @@ module Security
def initialize(auto_devops_enabled, existing_gitlab_ci_content, ci_config_path = ::Ci::Pipeline::DEFAULT_CONFIG_PATH) def initialize(auto_devops_enabled, existing_gitlab_ci_content, ci_config_path = ::Ci::Pipeline::DEFAULT_CONFIG_PATH)
@auto_devops_enabled = auto_devops_enabled @auto_devops_enabled = auto_devops_enabled
@existing_gitlab_ci_content = existing_gitlab_ci_content || {} @existing_gitlab_ci_content = existing_gitlab_ci_content || {}
@ci_config_path = ci_config_path || ::Ci::Pipeline::DEFAULT_CONFIG_PATH @ci_config_path = ci_config_path.presence || ::Ci::Pipeline::DEFAULT_CONFIG_PATH
end end
def generate def generate
......
...@@ -7,6 +7,7 @@ RSpec.describe Security::CiConfiguration::SastIacBuildAction do ...@@ -7,6 +7,7 @@ RSpec.describe Security::CiConfiguration::SastIacBuildAction do
let(:params) { {} } let(:params) { {} }
shared_examples 'existing .gitlab-ci.yml tests' do
context 'with existing .gitlab-ci.yml' do context 'with existing .gitlab-ci.yml' do
let(:auto_devops_enabled) { false } let(:auto_devops_enabled) { false }
...@@ -104,6 +105,19 @@ RSpec.describe Security::CiConfiguration::SastIacBuildAction do ...@@ -104,6 +105,19 @@ RSpec.describe Security::CiConfiguration::SastIacBuildAction do
end end
end end
end end
end
context 'with existing .gitlab-ci.yml and when the ci config file configuration was not set' do
subject(:result) { described_class.new(auto_devops_enabled, gitlab_ci_content).generate }
it_behaves_like 'existing .gitlab-ci.yml tests'
end
context 'with existing .gitlab-ci.yml and when the ci config file configuration was deleted' do
subject(:result) { described_class.new(auto_devops_enabled, gitlab_ci_content, ci_config_path: '').generate }
it_behaves_like 'existing .gitlab-ci.yml tests'
end
context 'with no .gitlab-ci.yml' do context 'with no .gitlab-ci.yml' do
let(:gitlab_ci_content) { nil } let(:gitlab_ci_content) { nil }
......
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