Commit 94c53bcf authored by Jose Vargas's avatar Jose Vargas

Move cluster_health to core

This moves the frontend components as
well as the QA tests to core
parent 460a3e7c
import ClustersBundle from '~/clusters/clusters_bundle'; import ClustersBundle from '~/clusters/clusters_bundle';
import initClusterHealth from '~/pages/projects/clusters/show/cluster_health';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
new ClustersBundle(); // eslint-disable-line no-new new ClustersBundle(); // eslint-disable-line no-new
initClusterHealth();
}); });
import ClustersBundle from '~/clusters/clusters_bundle'; import ClustersBundle from '~/clusters/clusters_bundle';
import initClusterHealth from '~/pages/projects/clusters/show/cluster_health';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
new ClustersBundle(); // eslint-disable-line no-new new ClustersBundle(); // eslint-disable-line no-new
initClusterHealth();
}); });
import initCeBundle from '~/monitoring/monitoring_app'; import monitoringApp from '~/monitoring/monitoring_app';
export default () => { export default () => {
const el = document.getElementById('prometheus-graphs'); const el = document.getElementById('prometheus-graphs');
if (el && el.dataset) { if (el && el.dataset) {
initCeBundle({ monitoringApp({
...el.dataset, ...el.dataset,
showLegend: false, showLegend: false,
showHeader: false, showHeader: false,
......
import ClustersBundle from '~/clusters/clusters_bundle'; import ClustersBundle from '~/clusters/clusters_bundle';
import initGkeNamespace from '~/create_cluster/gke_cluster_namespace'; import initGkeNamespace from '~/create_cluster/gke_cluster_namespace';
import initClusterHealth from './cluster_health';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
new ClustersBundle(); // eslint-disable-line no-new new ClustersBundle(); // eslint-disable-line no-new
initGkeNamespace(); initGkeNamespace();
initClusterHealth();
}); });
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
%ul.nav-links.mobile-separator.nav.nav-tabs{ role: 'tablist' } %ul.nav-links.mobile-separator.nav.nav-tabs{ role: 'tablist' }
= render 'details_tab' = render 'details_tab'
= render_if_exists 'clusters/clusters/environments_tab' = render_if_exists 'clusters/clusters/environments_tab'
= render_if_exists 'clusters/clusters/health_tab' = render 'clusters/clusters/health_tab'
= render 'applications_tab' = render 'applications_tab'
= render 'advanced_settings_tab' = render 'advanced_settings_tab'
......
import '~/pages/admin/clusters/show';
import initClusterHealth from '../../../projects/clusters/show/cluster_health';
document.addEventListener('DOMContentLoaded', initClusterHealth);
import '~/pages/projects/clusters/show';
import initClusterHealth from '../../../projects/clusters/show/cluster_health';
document.addEventListener('DOMContentLoaded', initClusterHealth);
import '~/pages/projects/clusters/show';
import initClusterHealth from './cluster_health';
document.addEventListener('DOMContentLoaded', initClusterHealth);
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
module EE module Page
module Page module Project
module Project module Operations
module Operations module Kubernetes
module Kubernetes module Show
module Show extend QA::Page::PageConcern
extend QA::Page::PageConcern
def self.prepended(base)
def self.prepended(base) super
super
base.class_eval do
base.class_eval do view 'app/views/clusters/clusters/_health.html.haml' do
view 'ee/app/views/clusters/clusters/_health.html.haml' do element :cluster_health_section
element :cluster_health_section
end
view 'ee/app/views/clusters/clusters/_health_tab.html.haml' do
element :health, required: true
end
end end
end
def wait_for_cluster_health view 'app/views/clusters/clusters/_health_tab.html.haml' do
wait_until(max_duration: 120, sleep_interval: 3, reload: true) do element :health, required: true
has_cluster_health_graphs?
end end
end end
end
def open_health def wait_for_cluster_health
has_element?(:health, wait: 30) wait_until(max_duration: 120, sleep_interval: 3, reload: true) do
click_element :health has_cluster_health_graphs?
end end
end
def has_cluster_health_graphs? def open_health
within_cluster_health_section do has_element?(:health, wait: 30)
has_text?('CPU Usage') click_element :health
end end
def has_cluster_health_graphs?
within_cluster_health_section do
has_text?('CPU Usage')
end end
end
def within_cluster_health_section def within_cluster_health_section
within_element :cluster_health_section do within_element :cluster_health_section do
yield yield
end
end end
end end
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