Commit cbf1b264 authored by Dan Davison's avatar Dan Davison

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

Add AutoDevOps template validation spec

Closes gitlab-org/quality/testcases#762

See merge request gitlab-org/gitlab!22254
parents d2eb7d48 4124e8ba
...@@ -16,6 +16,7 @@ gem 'faker', '~> 1.6', '>= 1.6.6' ...@@ -16,6 +16,7 @@ gem 'faker', '~> 1.6', '>= 1.6.6'
gem 'knapsack', '~> 1.17' gem 'knapsack', '~> 1.17'
gem 'parallel_tests', '~> 2.29' gem 'parallel_tests', '~> 2.29'
gem 'rotp', '~> 3.1.0' gem 'rotp', '~> 3.1.0'
gem 'rspec-parameterized', '~> 0.4.2'
group :test do group :test do
gem 'pry-byebug', '~> 3.5.1', platform: :mri gem 'pry-byebug', '~> 3.5.1', platform: :mri
......
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (6.0.3.1) abstract_type (0.0.7)
activesupport (6.0.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
tzinfo (~> 1.1) tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2) zeitwerk (~> 2.2, >= 2.2.2)
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
airborne (0.3.4) airborne (0.3.4)
...@@ -15,6 +19,8 @@ GEM ...@@ -15,6 +19,8 @@ GEM
rack-test (>= 1.1.0, < 2.0) rack-test (>= 1.1.0, < 2.0)
rest-client (>= 2.0.2, < 3.0) rest-client (>= 2.0.2, < 3.0)
rspec (~> 3.8) rspec (~> 3.8)
ast (2.4.1)
binding_ninja (0.2.3)
byebug (9.1.0) byebug (9.1.0)
capybara (3.29.0) capybara (3.29.0)
addressable addressable
...@@ -24,55 +30,93 @@ GEM ...@@ -24,55 +30,93 @@ GEM
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
regexp_parser (~> 1.5) regexp_parser (~> 1.5)
xpath (~> 3.2) xpath (~> 3.2)
capybara-screenshot (1.0.23) capybara-screenshot (1.0.24)
capybara (>= 1.0, < 4) capybara (>= 1.0, < 4)
launchy launchy
childprocess (3.0.0) childprocess (3.0.0)
coderay (1.1.2) coderay (1.1.3)
concord (0.1.5)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.6) concurrent-ruby (1.1.6)
debase (0.2.4.1) debase (0.2.4.1)
debase-ruby_core_source (>= 0.10.2) debase-ruby_core_source (>= 0.10.2)
debase-ruby_core_source (0.10.6) debase-ruby_core_source (0.10.9)
diff-lcs (1.3) diff-lcs (1.4.4)
domain_name (0.5.20190701) domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
faker (1.9.3) equalizer (0.0.11)
faker (1.9.6)
i18n (>= 0.7) i18n (>= 0.7)
gitlab-qa (4.0.0) ffi (1.13.1)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
gitlab (4.11.0)
httparty (~> 0.14, >= 0.14.0)
terminal-table (~> 1.5, >= 1.5.1)
gitlab-qa (5.15.0)
activesupport (~> 6.0.2)
gitlab (~> 4.11.0)
http (= 4.3.0)
nokogiri (~> 1.10)
table_print (= 1.5.6)
http (4.3.0)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
http-parser (~> 1.2.0)
http-accept (1.7.0) http-accept (1.7.0)
http-cookie (1.0.3) http-cookie (1.0.3)
domain_name (~> 0.5) domain_name (~> 0.5)
i18n (1.8.2) http-form_data (2.3.0)
http-parser (1.2.1)
ffi-compiler (>= 1.0, < 2.0)
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.3)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
knapsack (1.17.1) ice_nine (0.11.2)
knapsack (1.18.0)
rake rake
launchy (2.4.3) launchy (2.5.0)
addressable (~> 2.3) addressable (~> 2.7)
method_source (0.9.0) memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (1.0.0)
mime-types (3.3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2020.0425) mime-types-data (3.2020.0512)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.14.1) minitest (5.14.1)
multi_xml (0.6.0)
netrc (0.11.0) netrc (0.11.0)
nokogiri (1.10.9) nokogiri (1.10.10)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
parallel (1.17.0) parallel (1.19.2)
parallel_tests (2.29.0) parallel_tests (2.32.0)
parallel parallel
pry (0.11.3) parser (2.7.1.4)
coderay (~> 1.1.0) ast (~> 2.4.1)
method_source (~> 0.9.0) proc_to_ast (0.1.0)
coderay
parser
unparser
procto (0.0.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.5.1) pry-byebug (3.5.1)
byebug (~> 9.1) byebug (~> 9.1)
pry (~> 0.10) pry (~> 0.10)
public_suffix (4.0.1) public_suffix (4.0.5)
rack (2.2.2) rack (2.2.3)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rake (12.3.0) rake (12.3.3)
regexp_parser (1.6.0) regexp_parser (1.7.1)
rest-client (2.1.0) rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0) http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0) http-cookie (>= 1.0.2, < 2.0)
...@@ -85,23 +129,32 @@ GEM ...@@ -85,23 +129,32 @@ GEM
rspec-mocks (~> 3.9.0) rspec-mocks (~> 3.9.0)
rspec-core (3.9.2) rspec-core (3.9.2)
rspec-support (~> 3.9.3) rspec-support (~> 3.9.3)
rspec-expectations (3.9.1) rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.9.0)
rspec-mocks (3.9.1) rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0) rspec-support (~> 3.9.0)
rspec-retry (0.6.1) rspec-parameterized (0.4.2)
binding_ninja (>= 0.2.3)
parser
proc_to_ast
rspec (>= 2.13, < 4)
unparser
rspec-retry (0.6.2)
rspec-core (> 3.3) rspec-core (> 3.3)
rspec-support (3.9.3) rspec-support (3.9.3)
rspec_junit_formatter (0.4.1) rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
ruby-debug-ide (0.7.2) ruby-debug-ide (0.7.2)
rake (>= 0.8.1) rake (>= 0.8.1)
rubyzip (1.3.0) rubyzip (2.3.0)
selenium-webdriver (3.142.6) selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0) childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2) rubyzip (>= 1.2.2)
table_print (1.5.6)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6) thread_safe (0.3.6)
timecop (0.9.1) timecop (0.9.1)
tzinfo (1.2.7) tzinfo (1.2.7)
...@@ -109,9 +162,18 @@ GEM ...@@ -109,9 +162,18 @@ GEM
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.7) unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
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) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.3.0) zeitwerk (2.3.1)
PLATFORMS PLATFORMS
ruby ruby
...@@ -132,6 +194,7 @@ DEPENDENCIES ...@@ -132,6 +194,7 @@ DEPENDENCIES
rest-client (~> 2.1.0) rest-client (~> 2.1.0)
rotp (~> 3.1.0) rotp (~> 3.1.0)
rspec (~> 3.7) rspec (~> 3.7)
rspec-parameterized (~> 0.4.2)
rspec-retry (~> 0.6.1) rspec-retry (~> 0.6.1)
rspec_junit_formatter (~> 0.4.1) rspec_junit_formatter (~> 0.4.1)
ruby-debug-ide (~> 0.7.0) ruby-debug-ide (~> 0.7.0)
......
# frozen_string_literal: true
module QA
RSpec.describe 'Configure' do
describe 'AutoDevOps Templates', only: { subdomain: :staging } do
let(:optional_jobs) do
%w[
LICENSE_MANAGEMENT_DISABLED
SAST_DISABLED DAST_DISABLED
DEPENDENCY_SCANNING_DISABLED
CONTAINER_SCANNING_DISABLED
]
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 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 @@ ...@@ -2,6 +2,7 @@
require_relative '../qa' require_relative '../qa'
require 'rspec/retry' require 'rspec/retry'
require 'rspec-parameterized'
if ENV['CI'] && QA::Runtime::Env.knapsack? && !ENV['NO_KNAPSACK'] if ENV['CI'] && QA::Runtime::Env.knapsack? && !ENV['NO_KNAPSACK']
require '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