Refactor `ee/spec/services/security/security_orchestration_policies/scan_pipeline_service_spec.rb` to looks for list of jobs from the template
Why are we doing this work
From !106255 (comment 1205195163):
As a follow-up issue I believe we could refactor this test to check list of included jobs based on the jobs defined in the CI template.
🤔
In scope of this issue we want to refactor scan_pipeline_service_spec.rb
file to check for jobs from the security template instead of hardcoding them.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
-
backend refactor ee/spec/services/security/security_orchestration_policies/scan_pipeline_service_spec.rb
to verify list of jobs added inpipeline_scan_jobs
argument to read from CI Template (ie. https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml)
Example:
it_behaves_like 'creates scan jobs',
pipeline_scan_job_templates: %w[Jobs/Secret-Detection.gitlab-ci.tml Jobs/Container-Scanning.gitlab-ci.yml, Jobs/SAST.gitlab-ci.yml],
on_demand_jobs: %i[dast-on-demand-0],
template_count: 3
Verification steps
Edited by Alan (Maciej) Paruszewski