diff options
Diffstat (limited to 'qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb')
-rw-r--r-- | qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb | 111 |
1 files changed, 64 insertions, 47 deletions
diff --git a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb index 45273655bb6..a9ed6651069 100644 --- a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb +++ b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb @@ -1,11 +1,16 @@ # frozen_string_literal: true module QA - context 'Monitor', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217705', type: :flaky } do - describe 'with Prometheus Gitlab-managed cluster', :orchestrated, :kubernetes, :docker, :runner do + context 'Monitor' do + describe 'with Prometheus in a Gitlab-managed cluster', :orchestrated, :kubernetes do before :all do - Flow::Login.sign_in - @project, @runner = deploy_project_with_prometheus + @cluster = Service::KubernetesCluster.new.create! + @project = Resource::Project.fabricate_via_api! do |project| + project.name = 'monitoring-project' + project.auto_devops_enabled = true + end + + deploy_project_with_prometheus end before do @@ -14,7 +19,6 @@ module QA end after :all do - @runner.remove_via_api! @cluster.remove! end @@ -27,81 +31,94 @@ module QA it 'duplicates to create dashboard to custom' do Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - dashboard.duplicate_dashboard + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + on_dashboard.duplicate_dashboard - expect(dashboard).to have_metrics - expect(dashboard).to have_edit_dashboard_enabled + expect(on_dashboard).to have_metrics + expect(on_dashboard).to have_edit_dashboard_enabled end end it 'verifies data on filtered deployed environment' do Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - dashboard.filter_environment + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + on_dashboard.filter_environment - expect(dashboard).to have_metrics + expect(on_dashboard).to have_metrics end end it 'filters using the quick range' do Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - dashboard.show_last('30 minutes') - expect(dashboard).to have_metrics + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + on_dashboard.show_last('30 minutes') + expect(on_dashboard).to have_metrics - dashboard.show_last('3 hours') - expect(dashboard).to have_metrics + on_dashboard.show_last('3 hours') + expect(on_dashboard).to have_metrics - dashboard.show_last('1 day') - expect(dashboard).to have_metrics + on_dashboard.show_last('1 day') + expect(on_dashboard).to have_metrics end end private def deploy_project_with_prometheus - project = Resource::Project.fabricate_via_api! do |project| - project.name = 'cluster-with-prometheus' - project.description = 'Cluster with Prometheus' + %w[ + CODE_QUALITY_DISABLED TEST_DISABLED LICENSE_MANAGEMENT_DISABLED + SAST_DISABLED DAST_DISABLED DEPENDENCY_SCANNING_DISABLED + CONTAINER_SCANNING_DISABLED PERFORMANCE_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 - runner = Resource::Runner.fabricate_via_api! do |runner| - runner.project = project - runner.name = project.name - end - - @cluster = Service::KubernetesCluster.new.create! + Flow::Login.sign_in - cluster_props = Resource::KubernetesCluster::ProjectCluster.fabricate! do |cluster_settings| - cluster_settings.project = project + Resource::KubernetesCluster::ProjectCluster.fabricate! do |cluster_settings| + cluster_settings.project = @project cluster_settings.cluster = @cluster cluster_settings.install_helm_tiller = true + cluster_settings.install_runner = true cluster_settings.install_ingress = true cluster_settings.install_prometheus = true end - Resource::CiVariable.fabricate_via_api! do |ci_variable| - ci_variable.project = project - ci_variable.key = 'AUTO_DEVOPS_DOMAIN' - ci_variable.value = cluster_props.ingress_ip - ci_variable.masked = false - end - Resource::Repository::ProjectPush.fabricate! do |push| - push.project = project + push.project = @project push.directory = Pathname .new(__dir__) - .join('../../../../fixtures/monitored_auto_devops') + .join('../../../../fixtures/auto_devops_rack') push.commit_message = 'Create AutoDevOps compatible Project for Monitoring' end Page::Project::Menu.perform(&:click_ci_cd_pipelines) - Page::Project::Pipeline::Index.perform(&:wait_for_latest_pipeline_success_or_retry) + Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline) + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_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.click_job('production') + end + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 1200) - [project, runner] + job.click_element(:pipeline_path) + end end def verify_add_custom_metric @@ -115,8 +132,8 @@ module QA Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - expect(dashboard).to have_custom_metric('HTTP Requests Total') + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + expect(on_dashboard).to have_custom_metric('HTTP Requests Total') end end @@ -130,8 +147,8 @@ module QA Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - expect(dashboard).to have_custom_metric('Throughput') + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + expect(on_dashboard).to have_custom_metric('Throughput') end end @@ -146,8 +163,8 @@ module QA Page::Project::Menu.perform(&:go_to_operations_metrics) - Page::Project::Operations::Metrics::Show.perform do |dashboard| - expect(dashboard).not_to have_custom_metric('Throughput') + Page::Project::Operations::Metrics::Show.perform do |on_dashboard| + expect(on_dashboard).not_to have_custom_metric('Throughput') end end end |