diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-23 15:07:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-23 15:07:42 +0000 |
commit | bc0f141f2f073a971aad1eb5349bb718747df028 (patch) | |
tree | 72fcc48dfac8e3f3560e22014eacdd2eaae8bc89 /qa | |
parent | 2c29837ce1692790dedccbc9b36b44dc8aaacbee (diff) | |
download | gitlab-ce-bc0f141f2f073a971aad1eb5349bb718747df028.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/Dockerfile | 6 | ||||
-rw-r--r-- | qa/qa/page/component/custom_metric.rb | 49 | ||||
-rw-r--r-- | qa/qa/page/project/issue/show.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/project/monitor/metrics/show.rb | 134 | ||||
-rw-r--r-- | qa/qa/page/project/settings/services/prometheus.rb | 36 | ||||
-rw-r--r-- | qa/qa/page/project/sub_menus/monitor.rb | 8 |
6 files changed, 4 insertions, 233 deletions
diff --git a/qa/Dockerfile b/qa/Dockerfile index d3662d07a1d..71fc615ac13 100644 --- a/qa/Dockerfile +++ b/qa/Dockerfile @@ -51,8 +51,10 @@ ENTRYPOINT ["bin/test"] # Add ee files when passing the parameter: `--build-arg QA_BUILD_TARGET=ee` FROM foss as ee -ONBUILD COPY ./ee/app/models/license.rb /home/gitlab/ee/app/models/ -ONBUILD COPY ./ee/config/feature_flags /home/gitlab/ee/config/feature_flags/ +# Copy VERSION to ensure the COPY succeeds to copy at least one file since ee/app/models/license.rb isn't present in FOSS +# The [b] part makes ./ee/app/models/license.r[b] a pattern that is allowed to return no files (which is the case in FOSS) +ONBUILD COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/ +ONBUILD COPY VERSION ./ee/config/feature_flag[s] /home/gitlab/ee/config/feature_flags/ # Add JH files when passing the parameter: `--build-arg QA_BUILD_TARGET=jhqa` FROM ee AS jhqa diff --git a/qa/qa/page/component/custom_metric.rb b/qa/qa/page/component/custom_metric.rb deleted file mode 100644 index 094979f5e18..00000000000 --- a/qa/qa/page/component/custom_metric.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Component - module CustomMetric - extend QA::Page::PageConcern - - def self.included(base) - super - - base.view 'app/assets/javascripts/custom_metrics/components/custom_metrics_form_fields.vue' do - element :custom_metric_prometheus_title_field - element :custom_metric_prometheus_query_field - element :custom_metric_prometheus_y_label_field - element :custom_metric_prometheus_unit_label_field - element :custom_metric_prometheus_legend_label_field - end - end - - def add_custom_metric - fill_element :custom_metric_prometheus_title_field, 'HTTP Requests Total' - fill_element :custom_metric_prometheus_query_field, 'rate(http_requests_total[5m])' - fill_element :custom_metric_prometheus_y_label_field, 'Requests/second' - fill_element :custom_metric_prometheus_unit_label_field, 'req/sec' - fill_element :custom_metric_prometheus_legend_label_field, 'HTTP requests' - - save_changes - end - - def save_changes - click_button(class: 'btn-success') - end - - def delete_custom_metric - click_button(class: 'btn-danger') - within('.modal-content') { click_button(class: 'btn-danger') } - end - - def edit_custom_metric - fill_element :custom_metric_prometheus_title_field, '' - fill_element :custom_metric_prometheus_title_field, 'Throughput' - - save_changes - end - end - end - end -end diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb index b1417d9b9db..2f8ffc634ac 100644 --- a/qa/qa/page/project/issue/show.rb +++ b/qa/qa/page/project/issue/show.rb @@ -67,10 +67,6 @@ module QA click_element :close_issue_button end - def has_metrics_unfurled? - has_element?(:prometheus_graph_widgets, wait: 30) - end - def has_reopen_issue_button? has_element?(:reopen_issue_button) end diff --git a/qa/qa/page/project/monitor/metrics/show.rb b/qa/qa/page/project/monitor/metrics/show.rb deleted file mode 100644 index 59602d0fcf7..00000000000 --- a/qa/qa/page/project/monitor/metrics/show.rb +++ /dev/null @@ -1,134 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Project - module Monitor - module Metrics - class Show < Page::Base - EXPECTED_TITLE = 'Memory Usage (Total)' - LOADING_MESSAGE = 'Waiting for performance data' - - view 'app/assets/javascripts/monitoring/components/dashboard.vue' do - element :prometheus_graphs_content - end - - view 'app/assets/javascripts/monitoring/components/dashboard_header.vue' do - element :dashboards_filter_dropdown - element :environments_dropdown - element :range_picker_dropdown - end - - view 'app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue' do - element :actions_menu_dropdown - element :edit_dashboard_button_enabled - end - - view 'app/assets/javascripts/monitoring/components/duplicate_dashboard_form.vue' do - element :duplicate_dashboard_filename_field - end - - view 'app/assets/javascripts/monitoring/components/dashboard_panel.vue' do - element :prometheus_graph_widgets - element :prometheus_widgets_dropdown - element :generate_chart_link_menu_item - end - - view 'app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue' do - element :quick_range_item - end - - view 'app/assets/javascripts/monitoring/components/variables_section.vue' do - element :variables_content - element :variable_item - end - - def wait_for_metrics - wait_for_data - return if has_metrics? - - wait_until(max_duration: 180) do - wait_for_data - has_metrics? - end - end - - def has_metrics? - within_element :prometheus_graphs_content do - has_text?(EXPECTED_TITLE) - end - end - - def has_edit_dashboard_enabled? - click_element :actions_menu_dropdown - - within_element :actions_menu_dropdown do - has_element? :edit_dashboard_button_enabled - end - end - - def duplicate_dashboard(save_as = 'test_duplication.yml', commit_option = 'Commit to default branch') - click_element :actions_menu_dropdown - click_on 'Duplicate current dashboard' - fill_element :duplicate_dashboard_filename_field, "#{SecureRandom.hex(8)}-#{save_as}" - choose commit_option - within('.modal-content') { click_button(class: 'btn-success') } - end - - def select_dashboard(dashboard_name) - click_element :dashboards_filter_dropdown - - within_element :dashboards_filter_dropdown do - click_on dashboard_name - end - end - - def filter_environment(environment = 'production') - click_element :environments_dropdown - - within_element :environments_dropdown do - click_link_with_text environment - end - end - - def show_last(range = '8 hours') - all_elements(:range_picker_dropdown, minimum: 1).first.click - click_element :quick_range_item, text: range - end - - def copy_link_to_first_chart - all_elements(:prometheus_widgets_dropdown, minimum: 1).first.click - find_element(:generate_chart_link_menu_item)['data-clipboard-text'] - end - - def has_custom_metric?(metric) - within_element :prometheus_graphs_content do - has_text?(metric) - end - end - - def has_templating_variable?(variable) - within_element :variables_content do - has_element?(:variable_item, text: variable) - end - end - - def has_template_metric?(metric) - within_element :prometheus_graphs_content do - has_text?(metric) - end - end - - private - - def wait_for_data - wait_until(reload: false) { !has_text?(LOADING_MESSAGE) } if has_text?(LOADING_MESSAGE) - end - end - end - end - end - end -end - -QA::Page::Project::Monitor::Metrics::Show.prepend_mod_with('Page::Project::Monitor::Metrics::Show', namespace: QA) diff --git a/qa/qa/page/project/settings/services/prometheus.rb b/qa/qa/page/project/settings/services/prometheus.rb deleted file mode 100644 index 2e3c385a27d..00000000000 --- a/qa/qa/page/project/settings/services/prometheus.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module QA - module Page - module Project - module Settings - module Services - class Prometheus < Page::Base - include Page::Component::CustomMetric - - view 'app/views/shared/integrations/prometheus/_custom_metrics.html.haml' do - element :custom_metrics_container - element :new_metric_button - end - - def click_on_custom_metric(custom_metric) - within_element :custom_metrics_container do - click_on custom_metric - end - end - - def click_on_new_metric - click_element :new_metric_button - end - - def has_custom_metric?(custom_metric) - within_element :custom_metrics_container do - has_text? custom_metric - end - end - end - end - end - end - end -end diff --git a/qa/qa/page/project/sub_menus/monitor.rb b/qa/qa/page/project/sub_menus/monitor.rb index e3593e0a257..927b4b6970c 100644 --- a/qa/qa/page/project/sub_menus/monitor.rb +++ b/qa/qa/page/project/sub_menus/monitor.rb @@ -15,14 +15,6 @@ module QA end end - def go_to_monitor_metrics - hover_monitor do - within_submenu do - click_element(:sidebar_menu_item_link, menu_item: 'Metrics') - end - end - end - def go_to_monitor_incidents hover_monitor do within_submenu do |