summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 06:08:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-30 06:08:49 +0000
commit6305f1dc00870f6e0635e2e850538a00bbd00bda (patch)
tree8a518cae3805b8d7269bfacc8ae60aa441fadb22 /qa
parent1d388ed855838a2d50588c131f9f23815f148344 (diff)
downloadgitlab-ce-6305f1dc00870f6e0635e2e850538a00bbd00bda.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/resource/project_milestone.rb5
-rw-r--r--qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb108
2 files changed, 42 insertions, 71 deletions
diff --git a/qa/qa/resource/project_milestone.rb b/qa/qa/resource/project_milestone.rb
index 0e2d6a1bb48..4d6b37937b4 100644
--- a/qa/qa/resource/project_milestone.rb
+++ b/qa/qa/resource/project_milestone.rb
@@ -3,10 +3,13 @@
module QA
module Resource
class ProjectMilestone < Base
+ attribute :id
attribute :title
attribute :project do
- Project.fabricate!
+ Project.fabricate_via_api! do |resource|
+ resource.name = 'project-with-milestone'
+ end
end
def initialize
diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
index 7acc9eb37bd..63774d1cdfa 100644
--- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
+++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
@@ -4,93 +4,49 @@ require 'pathname'
module QA
context 'Configure' do
- def disable_optional_jobs(project)
- # Disable code_quality check in Auto DevOps pipeline as it takes
- # too long and times out the test
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'CODE_QUALITY_DISABLED'
- resource.value = '1'
- resource.masked = false
- end
-
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'LICENSE_MANAGEMENT_DISABLED'
- resource.value = '1'
- resource.masked = false
- end
-
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'SAST_DISABLED'
- resource.value = '1'
- resource.masked = false
- end
-
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'DEPENDENCY_SCANNING_DISABLED'
- resource.value = '1'
- resource.masked = false
- end
-
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'CONTAINER_SCANNING_DISABLED'
- resource.value = '1'
- resource.masked = false
+ let(:project) do
+ Resource::Project.fabricate_via_api! do |p|
+ p.name = Runtime::Env.auto_devops_project_name || 'autodevops-project'
+ p.auto_devops_enabled = true
end
+ end
- Resource::CiVariable.fabricate_via_api! do |resource|
- resource.project = project
- resource.key = 'DAST_DISABLED'
- resource.value = '1'
- resource.masked = false
- end
+ before do
+ disable_optional_jobs(project)
end
describe 'Auto DevOps support', :orchestrated, :kubernetes, quarantine: 'https://gitlab.com/gitlab-org/gitlab/issues/118481' do
context 'when rbac is enabled' do
- before(:all) do
- @cluster = Service::KubernetesCluster.new.create!
- end
+ let(:cluster) { Service::KubernetesCluster.new.create! }
- after(:all) do
- @cluster&.remove!
+ after do
+ cluster&.remove!
end
it 'runs auto devops' do
Flow::Login.sign_in
- @project = Resource::Project.fabricate! do |p|
- p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops'
- p.description = 'Project with Auto DevOps'
- end
-
- disable_optional_jobs(@project)
-
# Set an application secret CI variable (prefixed with K8S_SECRET_)
Resource::CiVariable.fabricate! do |resource|
- resource.project = @project
+ resource.project = project
resource.key = 'K8S_SECRET_OPTIONAL_MESSAGE'
resource.value = 'you_can_see_this_variable'
resource.masked = false
end
# Connect K8s cluster
- Resource::KubernetesCluster.fabricate! do |cluster|
- cluster.project = @project
- cluster.cluster = @cluster
- cluster.install_helm_tiller = true
- cluster.install_ingress = true
- cluster.install_prometheus = true
- cluster.install_runner = true
+ Resource::KubernetesCluster.fabricate! do |k8s_cluster|
+ k8s_cluster.project = project
+ k8s_cluster.cluster = cluster
+ k8s_cluster.install_helm_tiller = true
+ k8s_cluster.install_ingress = true
+ k8s_cluster.install_prometheus = true
+ k8s_cluster.install_runner = true
end
# Create Auto DevOps compatible repo
Resource::Repository::ProjectPush.fabricate! do |push|
- push.project = @project
+ push.project = project
push.directory = Pathname
.new(__dir__)
.join('../../../../../fixtures/auto_devops_rack')
@@ -145,20 +101,15 @@ module QA
before do
Flow::Login.sign_in
- @project = Resource::Project.fabricate_via_browser_ui! do |p|
- p.name = "project-with-autodevops-#{SecureRandom.hex(8)}"
- p.description = 'Project with AutoDevOps'
- end
+ project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_auto_devops)
Page::Project::Settings::AutoDevops.perform(&:enable_autodevops)
- @project.visit!
-
# Create AutoDevOps repo
Resource::Repository::ProjectPush.fabricate! do |push|
- push.project = @project
+ push.project = project
push.directory = Pathname
.new(__dir__)
.join('../../../../../fixtures/auto_devops_rack')
@@ -175,5 +126,22 @@ module QA
end
end
end
+
+ private
+
+ def disable_optional_jobs(project)
+ %w[
+ CODE_QUALITY_DISABLED LICENSE_MANAGEMENT_DISABLED
+ SAST_DISABLED DAST_DISABLED DEPENDENCY_SCANNING_DISABLED
+ CONTAINER_SCANNING_DISABLED
+ ].each do |key|
+ Resource::CiVariable.fabricate_via_api! do |resource|
+ resource.project = project
+ resource.key = key
+ resource.value = '1'
+ resource.masked = false
+ end
+ end
+ end
end
end