end-to-end tests for the Rancher CAPI extension
Go to file
Tomas Hehejik 0fc41cb356
Prevent gh rate-limit in crust-gather-installer.sh (#339)
Signed-off-by: Tomas Hehejik <thehejik@suse.com>
2025-11-05 12:15:03 +01:00
.github Prevent gh rate-limit in crust-gather-installer.sh (#339) 2025-11-05 12:15:03 +01:00
tests Fix failure with deploy-chartmuseum script for upgrade tests and attempt at fixing flaky tests (#328) 2025-10-28 16:06:04 +05:30
.gitignore Terminate early if a crucial test fails (#296) 2025-10-02 12:09:40 +05:30
README.md

README.md

rancher-turtles-e2e

UI-E2E_head_2.11

What tests are doing:

  1. Create the infra stack ( GCP runner, cert-manager, rancher )
  2. Install the Turtles chart with locally built latest chart
  3. Deploy the Turtles UI extension
  4. Test the Turtles menu, namespaces import features
  5. Perform CAPI setup prerequisites
  6. Create & Import CAPI cluster using fleet by cluster, namespace annotation
  7. Create & Import CAPI cluster using ClusterClass UI
  8. Install App on imported CAPI cluster
  9. Scale the imported CAPI cluster
  10. Remove & Delete the imported CAPI cluster

Running the tests locally

Pre-requisites

  1. Install Rancher.
  2. Install Rancher Turtles chart.
  3. Install CAPI UI Extension.

Running the test

  1. cd tests/cypress/latest
  2. Install Cypress and its dependencies: npm install
  3. Export the following ENV VAR: RANCHER_URL (format: https://<FQDN>/dashboard), RANCHER_PASSWORD, RANCHER_USER, CYPRESS_TAGS=@install [@short @full|@vsphere], and provider specific env var:
    1. CAPA - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
    2. CAPG - GCP_CREDENTIALS and GCP_PROJECT
    3. CAPZ - AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_SUBSCRIPTION_ID.
    4. CAPV - VSPHERE_ENDPOINTS_LIST (workflow only, otherwise hardcoded endpoint_ip is part of the following var), VSPHERE_SECRETS_JSON_BASE64, see here for reference.
  4. Start Cypress: ./node_modules/cypress/bin/cypress open -C cypress.config.ts or npx cypress open --env grepTags="@install @short"

The Cypress GUI should now be visible.


Test structure

We categorize our tests using tags such as short, full, vsphere, and install. Tests tagged with short are local (docker-based) tests, while those tagged with vsphere are specific to vSphere. Tests tagged with full are cloud provider-based tests. The install tag is used for initial setup tests ('install' tag is also to be included in setup tests title).

Running tests using Cypress grep

We have implemented tags for more precise selection of tests using a Cypress plugin called cypress-grep

Note: the title can be either at describe, context or it level.

By default, daily runs will run test with the tags@install, @short

To use locally use the tag --env grepTags=tag along with the npx command

For example:

npx cypress run -C cypress.config.ts  --env grepTags="@short" cypress/e2e/*.spec.ts