Skip to content

Commit

Permalink
e2e test update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech-Niemkowski committed Oct 1, 2024
1 parent 18a3a6e commit 1887fd7
Showing 1 changed file with 51 additions and 11 deletions.
62 changes: 51 additions & 11 deletions docs/admin/Testing/E2E-tests.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,57 @@
# E2E Tests
This page describes how to run the cypress e2e tests.
# End-to-End (E2E) Tests Documentation

CCX comes with a number of e2e tests that can be used to test and verify a CCX installation.
These tests are recommended to be executed following an upgrade:
This documentation explains how to execute E2E tests using Docker.

production/ccx-production-jobs
### Prerequisites

Please be sure to edit ccx-e2e.secret.yaml (production/ccx-production-jobs/ccx-e2e.secret.yaml) prior to running test.
- Docker installed on your machine
- Access to the necessary environment variables and credentials

To run tests, simply execute
```
kubectl create -f ccx-e2e-test.job.yaml
### How to Execute E2E Tests

You can run the E2E tests with the following Docker command:

```bash
docker run -p 8080:8080 -it --rm \
-e BASE_URL="https://yourULR.net" \
-e CC_URL="https://cc.yourULR.net" \
-e LOGIN="[email protected]" \
-e PASSWORD="xxx" \
-e IP_ADDRESS="<IP_ADDRESS_FOR_FIREWALL_RULE>/32" \
-e CC_USER="cmon-user" \
-e CC_PASSWORD="xxx" \
eu.gcr.io/brave-night-121210/playwright-e2e-tests:#CCX_VERSION# /bin/bash \
-c "npm run test:ui:#YOUR_CLOUD_NAME# || true &&
npm run test -- --grep '(?=.*\[#YOUR_CLOUD_NAME#\].*)(?=.*)' --grep-invert '@long-running|galera' --workers 4 || true &&
npm run report:generate &&
npm run report:open -- --port 8080"
```

*Note*
These tests will take a while, could be several hours.
### Environment Variables

| Variable | Description |
|------------|------------------------------------------------------------------------------------------------------------------|
| BASE_URL | Base URL of CCX |
| LOGIN | CCX user login |
| PASSWORD | CCX user password |
| IP_ADDRESS | IP address with mask for firewall rules, so tests can connect to the database and execute queries |
| CC_URL | (Optional) When provided, if tests fail, it will grab the job logs of the failed cluster and attach them to the report |
| CC_USER | (Optional) CC user login |
| CC_PASSWORD| (Optional) CC user password |

### Commands Overview

- `npm run test:ui:#YOUR_CLOUD_NAME#`: Runs all UI tests for `#YOUR_CLOUD_NAME#` (e.g. `aws`).
- `npm run test -- --grep '(?=.*\[#YOUR_CLOUD_NAME#\].*)(?=.*)' --grep-invert '@long-running|galera' --workers 4`: Runs all API tests excluding Galera's node configuration. The `--workers 4` flag sets the number of datastore tests to run in parallel (you can adjust this value based on your environment capacity).
- `npm run report:generate`: Generates a test report.
- `npm run report:open -- --port 8080`: Opens the report on port 8080. You can change the port to a different value if needed.

### Notes

- The `IP_ADDRESS` variable must include the firewall rule IP with the mask (e.g. `/32`).
- Adjust the number of workers using the `--workers` flag to optimize for your environment.
- Reports will be generated and hosted on the specified port.
- Replace #YOUR_CLOUD_NAME# with the name of CSP you want to run tests on (e.g. `aws`)
- Replace #CCX_VERSION# with version of CCX that you are running tests against (e.g. `1.47.0`)

Feel free to modify this setup to better suit your testing environment and preferences.

0 comments on commit 1887fd7

Please sign in to comment.