summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorDan Davison <ddavison@gitlab.com>2019-03-13 01:55:16 +0000
committerDan Davison <ddavison@gitlab.com>2019-03-13 01:55:16 +0000
commitb8ca2fc64a313be332d870438d32c296e4801366 (patch)
treef424022a5da372a5f23762ab18bb59058f912b02 /qa
parente17074139e0c6d91076fc775e50c44d45f956b1f (diff)
parentc6fe5148a0b100d51530207282264ac78a845ed8 (diff)
downloadgitlab-ce-b8ca2fc64a313be332d870438d32c296e4801366.tar.gz
Merge branch 'qa-dd-autodevops-cleanup' into 'master'
Refactor AutoDevOps test to one test with two expectations See merge request gitlab-org/gitlab-ce!25836
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb85
1 files changed, 16 insertions, 69 deletions
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 4212a2b0392..74683adbaf9 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
@@ -13,6 +13,14 @@ module QA
describe 'Auto DevOps support', :orchestrated, :kubernetes, :quarantine do
context 'when rbac is enabled' do
before(:all) do
+ @cluster = Service::KubernetesCluster.new.create!
+ end
+
+ after(:all) do
+ @cluster&.remove!
+ end
+
+ it 'runs auto devops' do
login
@project = Resource::Project.fabricate! do |p|
@@ -28,8 +36,14 @@ module QA
resource.value = '1'
end
- # Create and connect K8s cluster
- @cluster = Service::KubernetesCluster.new.create!
+ # Set an application secret CI variable (prefixed with K8S_SECRET_)
+ Resource::CiVariable.fabricate! do |resource|
+ resource.project = @project
+ resource.key = 'K8S_SECRET_OPTIONAL_MESSAGE'
+ resource.value = 'You can see this application secret'
+ end
+
+ # Connect K8s cluster
Resource::KubernetesCluster.fabricate! do |cluster|
cluster.project = @project
cluster.cluster = @cluster
@@ -47,14 +61,7 @@ module QA
.join('../../../../../fixtures/auto_devops_rack')
push.commit_message = 'Create Auto DevOps compatible rack application'
end
- end
- after(:all) do
- @cluster&.remove!
- end
-
- it 'runs auto devops' do
- @project.visit!
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline)
@@ -92,66 +99,6 @@ module QA
Page::Project::Operations::Environments::Show.perform do |show|
show.view_deployment do
expect(page).to have_content('Hello World!')
- end
- end
- end
-
- it 'user sets application secret variable and Auto DevOps passes it to container' do
- # Set an application secret CI variable (prefixed with K8S_SECRET_)
- Resource::CiVariable.fabricate! do |resource|
- resource.project = @project
- resource.key = 'K8S_SECRET_OPTIONAL_MESSAGE'
- resource.value = 'You can see this application secret'
- end
-
- # Our current Auto DevOps implementation won't update the production
- # app if we only update a CI variable with no code change.
- #
- # Workaround: push new code and use the resultant pipeline.
- Resource::Repository::ProjectPush.fabricate! do |push|
- push.project = @project
- push.commit_message = 'Force a Deployment change by pushing new code'
- push.file_name = 'new_file.txt'
- push.file_content = 'new file contents'
- end
-
- Page::Project::Menu.perform(&:click_ci_cd_pipelines)
- Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline)
-
- Page::Project::Pipeline::Show.perform do |pipeline|
- pipeline.go_to_job('build')
- end
- Page::Project::Job::Show.perform do |job|
- expect(job).to be_successful(timeout: 600)
-
- job.click_element(:pipeline_path)
- end
-
- Page::Project::Pipeline::Show.perform do |pipeline|
- pipeline.go_to_job('test')
- end
- Page::Project::Job::Show.perform do |job|
- expect(job).to be_successful(timeout: 600)
-
- job.click_element(:pipeline_path)
- end
-
- Page::Project::Pipeline::Show.perform do |pipeline|
- pipeline.go_to_job('production')
- end
- Page::Project::Job::Show.perform do |job|
- expect(job).to be_successful(timeout: 1200)
- end
-
- Page::Project::Menu.perform(&:click_operations_environments)
-
- Page::Project::Operations::Environments::Index.perform do |index|
- index.go_to_environment('production')
- end
-
- Page::Project::Operations::Environments::Show.perform do |show|
- show.view_deployment do
- expect(page).to have_content('Hello World!')
expect(page).to have_content('You can see this application secret')
end
end