Commit aa3e991d authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'qa-autodevops-templates-spec' into 'master'

Re-add AutoDevOps Templates spec

Closes gitlab-org/quality/team-tasks#608

See merge request gitlab-org/gitlab!38744
parents 255d4edf 6b28dd08
......@@ -17,7 +17,8 @@ gem 'knapsack', '~> 1.17'
gem 'parallel_tests', '~> 2.29'
gem 'rotp', '~> 3.1.0'
gem 'timecop', '~> 0.9.1'
gem "parallel", "~> 1.19"
gem 'parallel', '~> 1.19'
gem 'rspec-parameterized', '~> 0.4.2'
group :development do
gem 'pry-byebug', '~> 3.5.1', platform: :mri
......
GEM
remote: https://rubygems.org/
specs:
abstract_type (0.0.7)
activesupport (6.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
airborne (0.3.4)
......@@ -15,6 +19,8 @@ GEM
rack-test (>= 1.1.0, < 2.0)
rest-client (>= 2.0.2, < 3.0)
rspec (~> 3.8)
ast (2.4.1)
binding_ninja (0.2.3)
byebug (9.1.0)
capybara (3.29.0)
addressable
......@@ -29,6 +35,9 @@ GEM
launchy
childprocess (3.0.0)
coderay (1.1.2)
concord (0.1.5)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.6)
debase (0.2.4.1)
debase-ruby_core_source (>= 0.10.2)
......@@ -36,6 +45,7 @@ GEM
diff-lcs (1.3)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
equalizer (0.0.11)
faker (1.9.3)
i18n (>= 0.7)
gitlab-qa (4.0.0)
......@@ -44,10 +54,13 @@ GEM
domain_name (~> 0.5)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
knapsack (1.17.1)
rake
launchy (2.4.3)
addressable (~> 2.3)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (0.9.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
......@@ -61,6 +74,13 @@ GEM
parallel (1.17.0)
parallel_tests (2.29.0)
parallel
parser (2.7.1.4)
ast (~> 2.4.1)
proc_to_ast (0.1.0)
coderay
parser
unparser
procto (0.0.3)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
......@@ -71,7 +91,7 @@ GEM
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (12.3.0)
rake (12.3.3)
regexp_parser (1.6.0)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
......@@ -91,6 +111,12 @@ GEM
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-parameterized (0.4.2)
binding_ninja (>= 0.2.3)
parser
proc_to_ast
rspec (>= 2.13, < 4)
unparser
rspec-retry (0.6.1)
rspec-core (> 3.3)
rspec-support (3.9.3)
......@@ -109,6 +135,14 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unparser (0.4.7)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
concord (~> 0.1.5)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
parser (>= 2.6.5)
procto (~> 0.0.2)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.3.0)
......@@ -133,6 +167,7 @@ DEPENDENCIES
rest-client (~> 2.1.0)
rotp (~> 3.1.0)
rspec (~> 3.7)
rspec-parameterized (~> 0.4.2)
rspec-retry (~> 0.6.1)
rspec_junit_formatter (~> 0.4.1)
ruby-debug-ide (~> 0.7.0)
......
# frozen_string_literal: true
module QA
RSpec.describe 'Configure' do
describe 'AutoDevOps Templates', only: { subdomain: :staging } do
# specify jobs to be disabled in the pipeline.
# CANARY_ENABLED will allow the pipeline to be
# blocked by a manual job, rather than fail
# during the production run
let(:optional_jobs) do
%w[
LICENSE_MANAGEMENT_DISABLED
SAST_DISABLED DAST_DISABLED
DEPENDENCY_SCANNING_DISABLED
CONTAINER_SCANNING_DISABLED
CANARY_ENABLED
]
end
where(:template) do
%w[rails spring express]
end
with_them do
let!(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = "#{template}-autodevops-project-template"
project.template_name = template
project.description = "Let's see if the #{template} project works..."
project.auto_devops_enabled = true
end
end
let(:pipeline) do
Resource::Pipeline.fabricate_via_api! do |pipeline|
pipeline.project = project
pipeline.variables =
optional_jobs.map do |job|
{ key: job, value: '1', variable_type: 'env_var' }
end
end
end
before do
Flow::Login.sign_in
end
it 'works with Auto DevOps' do
%w[build code_quality test].each do |job|
pipeline.visit!
Page::Project::Pipeline::Show.perform do |show_page|
show_page.click_job(job)
end
Page::Project::Job::Show.perform do |show|
expect(show).to have_passed(timeout: 360)
end
end
end
end
end
end
end
......@@ -2,6 +2,7 @@
require_relative '../qa'
require 'rspec/retry'
require 'rspec-parameterized'
if ENV['CI'] && QA::Runtime::Env.knapsack? && !ENV['NO_KNAPSACK']
require 'knapsack'
......
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