-
Notifications
You must be signed in to change notification settings - Fork 8
COO-362: [Chore] Add Cypress tests for Tracing UI plugin testing. #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/retest |
ce5ed3f
to
4a7026c
Compare
@IshwarKanse: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: IshwarKanse, vprashar2929 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@IshwarKanse: This pull request references COO-362 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/label ux-approved |
@IshwarKanse: This pull request references COO-362 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/cherry-pick release-0.4 |
@IshwarKanse: new pull request created: #92 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The PR adds Cypress tests for testing the Tracing UI plugin. Part of https://issues.redhat.com/browse/COO-362
Openshift Distributed Tracing UI Plugin Tests
These console tests install the Openshift Cluster Observability Operator with the Distributed Tracing UI Plugin, Tempo and OpenTelemetry Operators in the specified cluster and then run a series of tests against the UI.
Prerequisite
Install dependencies
All required dependencies are defined in
package.json
in order to run Cypress tests, runnpm install
so that dependencies will be installed innode_modules
folder$ npm install $ ls -ltr node_modules/ -> dependencies will be installed at runtime here
Directory structure
After dependencies are installed successfully and before we run actual tests, please confirm if we have correct structure as below.
Export necessary variables
in order to run Cypress tests, we need to export some environment variables that Cypress can read then pass down to our tests, currently we have following environment variables defined and used.
Using a non-admin user.
Using kubeadmin user.
Set the var to skip Cluster Observability and all the required operators installation.
export CYPRESS_SKIP_COO_INSTALL=true
Set the var to install Cluster Observability, OpenTelemetry and Tempo operators from redhat-operators catalog source.
export CYPRESS_COO_UI_INSTALL=true
Set the var to install Cluster Observability Operator using Konflux bundle. Tempo and OpenTelemetry operators will be installed from redhat-operators catalog source.
Set the var to use custom Cluster Observability Operator bundle image. Tempo and OpenTelemetry operators will be installed from redhat-operators catalog source.
Set the following var to use custom Distributed Tracing UI plugin image. The image will be patched in Cluster Observability Operator CSV.
Start Cypress
We can either open Cypress GUI(open) or run Cypress in headless mode(run) to run the tests.
There are currently two tests:
Test run.
`% npx cypress run
DevTools listening on ws://127.0.0.1:56223/devtools/browser/6d69f6c3-977d-4606-a3b8-04153ec67395
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 13.17.0 │
│ Browser: Electron 118 (headless) │
│ Node Version: v20.11.0 (/usr/local/bin/node) │
│ Specs: 1 found (dt-plugin-tests.cy.ts) │
│ Searched: tests/**/*.cy.{js,jsx,ts,tsx} │
│ Experiments: experimentalMemoryManagement=true,experimentalModifyObstructiveThirdPartyCode… │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: dt-plugin-tests.cy.ts (1 of 1)
OpenShift Distributed Tracing UI Plugin tests
Logging in as kubeadmin
✓ (Test Distributed Tracing UI plugin page without any Tempo instances) (190337ms)
Command "oc delete UIPlugin distributed-tracing --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
Command "oc delete project chainsaw-multitenancy chainsaw-monolithic-multitenancy --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
Command "oc delete namespace openshift-cluster-observability-operator --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
Command "oc delete namespace openshift-opentelemetry-operator --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
Command "oc delete namespace openshift-tempo-operator --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
Command "oc adm policy remove-cluster-role-from-user cluster-admin kubeadmin --kubeconfig /Users/ikanse/icloud-drive/ocp/cluster/auth/kubeconfig" executed successfully
✓ (Test Distributed Tracing UI plugin) (173086ms)
2 passing (7m)
[mochawesome] Report JSON saved to /Users/ikanse/distributed-tracing-console-plugin/tests/gui_test_screenshots/cypress_report_001.json
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 2 │
│ Passing: 2 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: 7 minutes, 28 seconds │
│ Spec Ran: dt-plugin-tests.cy.ts │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ dt-plugin-tests.cy.ts 07:28 2 2 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 07:28 2 2 - - -
`