Skip to content

Commit 1a3d8c3

Browse files
authored
[Graphing Job] Enable the monitoring (#280)
* enable crc monitoring
1 parent 4ef7433 commit 1a3d8c3

File tree

6 files changed

+67
-62
lines changed

6 files changed

+67
-62
lines changed

.zuul.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
description: |
9797
Run the UI Graphing test and tempest smoketests on osp18.
9898
vars:
99+
crc_enable_monitoring: true
99100
cifmw_extras:
100101
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}/scenarios/centos-9/multinode-ci.yml"
101102
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-autoscaling.yml"

ci/run_graphing_test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
environment:
66
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
77
PATH: "{{ cifmw_path }}"
8+
vars:
9+
USERNAME: "{{ cifmw_openshift_user }}"
10+
PASSWORD: "{{ cifmw_openshift_password }}"
811
vars_files:
912
- vars/common.yml
1013
tasks:
1114
- block:
1215
- name: "Run Graphing Console UI tests"
1316
ansible.builtin.import_role:
1417
name: telemetry_graphing
15-
ignore_errors: true
18+
ignore_errors: true

roles/telemetry_graphing/files/cypress.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ module.exports = defineConfig({
44
baseUrl: 'https://console-openshift-console.apps-crc.testing/login',
55
specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}',
66
supportFile: false,
7+
chromeWebSecurity: false,
8+
defaultCommandTimeout: 10000,
9+
pageLoadTimeout: 30000,
10+
viewportWidth: 1280,
11+
viewportHeight: 720,
12+
video: true,
713
},
814
})

roles/telemetry_graphing/files/dashboard-openstack-cloud.js

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
describe('OpenShift Console Dashboard Test', () => {
2+
const username = "{{ USERNAME }}";
3+
const password = "{{ PASSWORD }}";
4+
5+
beforeEach(() => {
6+
cy.session('login', () => {
7+
cy.visit('https://console-openshift-console.apps-crc.testing/login');
8+
cy.origin(
9+
'https://oauth-openshift.apps-crc.testing',
10+
{ args: { username, password } },
11+
({ username, password }) => {
12+
cy.get('input[id="inputUsername"]').invoke('val', username).trigger('input');
13+
cy.get('input[id="inputPassword"]').invoke('val', password).trigger('input');
14+
cy.get('button[type="submit"]').click();
15+
}
16+
);
17+
cy.url().should('include', 'console-openshift-console');
18+
19+
cy.wait(5000);
20+
// Ensure redirected back to the main console
21+
22+
cy.get('body').then($body => {
23+
if ($body.find('button:contains("Skip tour")').length > 0) {
24+
cy.contains('button', 'Skip tour').click(); // Only click if the button is found
25+
}
26+
});
27+
});
28+
});
29+
30+
it('should load and validate the OpenStack dashboards', () => {
31+
32+
const dashboards = [
33+
{ url: '/grafana-dashboard-openstack-cloud', screenshot: 'openstack-cluster' },
34+
{ url: '/grafana-dashboard-openstack-rabbitmq', screenshot: 'openstack-rabbitmq' },
35+
{ url: '/grafana-dashboard-openstack-node', screenshot: 'openstack-node' },
36+
{ url: '/grafana-dashboard-openstack-vm', screenshot: 'openstack-vms' },
37+
{ url: '/grafana-dashboard-openstack-network-traffic', screenshot: 'openstack-network-traffic'}
38+
];
39+
40+
dashboards.forEach(({ url, screenshot }) => {
41+
cy.visit(`https://console-openshift-console.apps-crc.testing/monitoring/dashboards${url}`);
42+
cy.get('div[data-test-id="dashboard"]', { timeout: 20000 }).find('[data-test-id^="panel-"]')
43+
cy.wait(1000);
44+
cy.screenshot(screenshot);
45+
});
46+
});
47+
});

roles/telemetry_graphing/tasks/cypress_test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
mode: '0644'
3838

3939
- name: Add dashboard-openstack-cloud test
40-
ansible.builtin.copy:
41-
src: "{{ role_path }}/files/dashboard-openstack-cloud.js"
40+
ansible.builtin.template:
41+
src: "{{ role_path }}/files/dashboard-openstack-cloud.js.j2"
4242
dest: "{{ cypress_integration_dir }}/dashboard-openstack-cloud.js"
43-
mode: '0644'
43+
mode: '0755'
4444

4545
- name: Create screenshot logs dir
4646
ansible.builtin.file:
@@ -78,6 +78,12 @@
7878
dest: "{{ screenshots_dir }}"
7979
mode: '0644'
8080

81+
- name: Collect the videos
82+
ansible.builtin.copy:
83+
src: "{{ cypress_tests_dir }}/cypress/videos/"
84+
dest: "{{ screenshots_dir }}"
85+
mode: '0644'
86+
8187
- name: Show Cypress test output
8288
ansible.builtin.debug:
8389
var: cypress_run.stdout_lines

0 commit comments

Comments
 (0)