Skip to content
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

Run Kiali tests in OSSMC #357

Merged
merged 12 commits into from
Sep 19, 2024
Merged

Run Kiali tests in OSSMC #357

merged 12 commits into from
Sep 19, 2024

Conversation

ferhoyos
Copy link
Collaborator

@ferhoyos ferhoyos commented Aug 19, 2024

Describe the change

When we reused Kiali's source code as the foundation for the OSSMC plugin, we assumed that Kiali's Cypress tests would also be valid for OSSMC. In that case, we only needed to create Cypress tests for specific OSSMC pages, such as the Istio config list page or specific navigation scenarios. However, recent issues (see issue #330) have shown that the same test scenarios can behave differently in Kiali and OSSMC.

To address this, we have modified the OSSMC Cypress test infrastructure to run the same Kiali test scenarios in OSSMC. We have introduced the @ossmc Cypress tag to run only those Kiali tests that are applicable to OSSMC (excluding multi-cluster, wizards, etc.).

Actions performed to enable running Kiali tests:

  • Defined the same environment variables used in Kiali Cypress tests (USERNAME, PASSWD, AUTH_PROVIDER, etc.)
  • Created the @ossmc Cypress tag to include a Cypress test in the OSSMC test suite.
  • Created the @skip-ossmc Cypress tag to exclude specific Cypress tests from features included in OSSMC.
  • Organized Kiali and OSSMC Cypress tests into their respective test folders (similar structure to the code, withkiali and openshift folders)
  • Overrode the visit and request Cypress commands since there are slight differences in page URLs and APIs between Kiali and OSSMC.

Steps to test the PR

  1. Execute yarn cypress:run and verify that OSSMC cypress test pass

Issue reference

#356

@ferhoyos ferhoyos self-assigned this Aug 19, 2024
@ferhoyos ferhoyos added the test: front-end/cypress PR adds/updates front-end tests (unit and/or cypress automation ) label Aug 22, 2024
@ferhoyos ferhoyos mentioned this pull request Sep 3, 2024
5 tasks
@ferhoyos ferhoyos force-pushed the copy-kiali-tests branch 2 times, most recently from 5fe65e0 to a66f35f Compare September 9, 2024 17:12
@ferhoyos ferhoyos marked this pull request as ready for review September 12, 2024 16:02
@ScriptingShrimp
Copy link
Contributor

testing via upstream-istio-pipeline/2165

export CYPRESS_OC_CLUSTER_USER=<value> # defaults to jenkins, opt. kubeadmin
export CYPRESS_OC_CLUSTER_PASS=<value> # no defaults
export CYPRESS_OC_IDP=<value> # defaults to my_htpasswd_provider
export CYPRESS_USERNAME=<value> # defaults to jenkins, opt. kubeadmin
Copy link
Contributor

@ScriptingShrimp ScriptingShrimp Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I chose different variable names to be double sure that settings from kiali/kiali will not interfere with OSSMC suite. This is no longer a concern

Copy link
Contributor

@ScriptingShrimp ScriptingShrimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

'cypress-react-selector': {
root: '#root'
},
OSSMC: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nitpick, but this is why I would prefer to have two different configs, so there is no risk for them to be overwritten when copying the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there are two configs, the cypress.config from Kiali repo and cypress.config from OSSMC repo. What I don't see is to have two configs just for OSSMC.

@ferhoyos ferhoyos merged commit 10db6ff into kiali:main Sep 19, 2024
2 checks passed
@ferhoyos ferhoyos deleted the copy-kiali-tests branch September 19, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test: front-end/cypress PR adds/updates front-end tests (unit and/or cypress automation )
Projects
Development

Successfully merging this pull request may close these issues.

2 participants