Commit 45927684 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'fix-auto-devops-qa-domain-wait-for-build' into 'master'

Fixes for Auto DevOps QA specs

See merge request gitlab-org/gitlab-ce!25275
parents cd1a907b 8cb772bc
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
.form-group .form-group
%h5= s_('ClusterIntegration|Base domain') %h5= s_('ClusterIntegration|Base domain')
= field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus' = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus qa-base-domain'
.form-text.text-muted .form-text.text-muted
- auto_devops_url = help_page_path('topics/autodevops/index') - auto_devops_url = help_page_path('topics/autodevops/index')
- auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url } - auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url }
...@@ -43,4 +43,4 @@ ...@@ -43,4 +43,4 @@
- if can?(current_user, :update_cluster, @cluster) - if can?(current_user, :update_cluster, @cluster)
.form-group .form-group
= field.submit _('Save changes'), class: 'btn btn-success' = field.submit _('Save changes'), class: 'btn btn-success qa-save-domain'
...@@ -20,15 +20,19 @@ module QA::Page ...@@ -20,15 +20,19 @@ module QA::Page
element :pipeline_path element :pipeline_path
end end
def completed? def loaded?(wait: 60)
COMPLETED_STATUSES.include?(status_badge) has_element?(:build_trace, wait: wait)
end end
def successful?(timeout: 60) # Reminder: You should check #loaded? first
def completed?(timeout: 60)
wait(reload: false, max: timeout) do wait(reload: false, max: timeout) do
completed? && !trace_loading? COMPLETED_STATUSES.include?(status_badge)
end end
end
# Reminder: You should check #completed? and #loaded? first
def successful?
status_badge == PASSED_STATUS status_badge == PASSED_STATUS
end end
......
...@@ -14,6 +14,11 @@ module QA ...@@ -14,6 +14,11 @@ module QA
element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern element :ingress_ip_address, 'id="ingress-ip-address"' # rubocop:disable QA/ElementWithPattern
end end
view 'app/views/clusters/clusters/_form.html.haml' do
element :base_domain
element :save_domain
end
def install!(application_name) def install!(application_name)
within(".js-cluster-application-row-#{application_name}") do within(".js-cluster-application-row-#{application_name}") do
page.has_button?('Install', wait: 30) page.has_button?('Install', wait: 30)
...@@ -32,6 +37,14 @@ module QA ...@@ -32,6 +37,14 @@ module QA
# ip address is assigned for the ingress controller # ip address is assigned for the ingress controller
page.find('#ingress-ip-address', wait: 1200).value page.find('#ingress-ip-address', wait: 1200).value
end end
def set_domain(domain)
fill_element :base_domain, domain
end
def save_domain
click_element :save_domain
end
end end
end end
end end
......
...@@ -12,10 +12,6 @@ module QA ...@@ -12,10 +12,6 @@ module QA
Page::Project::Operations::Kubernetes::Show.perform(&:ingress_ip) Page::Project::Operations::Kubernetes::Show.perform(&:ingress_ip)
end end
attribute :domain do
"#{ingress_ip}.nip.io"
end
def fabricate! def fabricate!
@project.visit! @project.visit!
...@@ -53,6 +49,12 @@ module QA ...@@ -53,6 +49,12 @@ module QA
page.await_installed(:ingress) if @install_ingress page.await_installed(:ingress) if @install_ingress
page.await_installed(:prometheus) if @install_prometheus page.await_installed(:prometheus) if @install_prometheus
page.await_installed(:runner) if @install_runner page.await_installed(:runner) if @install_runner
if @install_ingress
populate(:ingress_ip)
page.set_domain("#{ingress_ip}.nip.io")
page.save_domain
end
end end
end end
end end
......
...@@ -95,7 +95,9 @@ module QA ...@@ -95,7 +95,9 @@ module QA
Page::Project::Pipeline::Show.perform(&:go_to_first_job) Page::Project::Pipeline::Show.perform(&:go_to_first_job)
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_successful, "Job status did not become \"passed\"." expect(job).to be_loaded
expect(job).to be_completed
expect(job).to be_successful
expect(job.output).to include(sha1sum) expect(job.output).to include(sha1sum)
end end
end end
......
...@@ -40,7 +40,7 @@ module QA ...@@ -40,7 +40,7 @@ module QA
# Create and connect K8s cluster # Create and connect K8s cluster
@cluster = Service::KubernetesCluster.new(rbac: rbac).create! @cluster = Service::KubernetesCluster.new(rbac: rbac).create!
kubernetes_cluster = Resource::KubernetesCluster.fabricate! do |cluster| Resource::KubernetesCluster.fabricate! do |cluster|
cluster.project = @project cluster.project = @project
cluster.cluster = @cluster cluster.cluster = @cluster
cluster.install_helm_tiller = true cluster.install_helm_tiller = true
...@@ -49,14 +49,11 @@ module QA ...@@ -49,14 +49,11 @@ module QA
cluster.install_runner = true cluster.install_runner = true
end end
kubernetes_cluster.populate(:ingress_ip)
@project.visit! @project.visit!
Page::Project::Menu.perform(&:click_ci_cd_settings) Page::Project::Menu.perform(&:click_ci_cd_settings)
Page::Project::Settings::CICD.perform do |p| Page::Project::Settings::CICD.perform do |p|
p.enable_auto_devops p.enable_auto_devops
end end
kubernetes_cluster.populate(:domain)
end end
after(:all) do after(:all) do
...@@ -76,7 +73,9 @@ module QA ...@@ -76,7 +73,9 @@ module QA
pipeline.go_to_job('build') pipeline.go_to_job('build')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 600), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 600)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
...@@ -85,7 +84,9 @@ module QA ...@@ -85,7 +84,9 @@ module QA
pipeline.go_to_job('test') pipeline.go_to_job('test')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 600), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 600)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
...@@ -94,7 +95,9 @@ module QA ...@@ -94,7 +95,9 @@ module QA
pipeline.go_to_job('production') pipeline.go_to_job('production')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 1200), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 1200)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
...@@ -137,7 +140,9 @@ module QA ...@@ -137,7 +140,9 @@ module QA
pipeline.go_to_job('build') pipeline.go_to_job('build')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 600), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 600)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
...@@ -146,7 +151,9 @@ module QA ...@@ -146,7 +151,9 @@ module QA
pipeline.go_to_job('test') pipeline.go_to_job('test')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 600), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 600)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
...@@ -155,7 +162,9 @@ module QA ...@@ -155,7 +162,9 @@ module QA
pipeline.go_to_job('production') pipeline.go_to_job('production')
end end
Page::Project::Job::Show.perform do |job| Page::Project::Job::Show.perform do |job|
expect(job).to be_sucessful(timeout: 1200), "Job did not pass" expect(job).to be_loaded
expect(job).to be_completed(timeout: 1200)
expect(job).to be_successful
job.click_element(:pipeline_path) job.click_element(:pipeline_path)
end end
......
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