Skip to content

Commit f9b4e79

Browse files
Adds instructions to run E2E tests (#83)
1 parent b57bf26 commit f9b4e79

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

docs/contributing.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,43 @@ Before submitting a pull request, please ensure your changes pass linting and un
4747
```bash
4848
ruff check .
4949
```
50-
- **Testing:** We use [Pytest](https://docs.pytest.org/) for unit tests. Run them with:
50+
- **Unit tests:** We use [Pytest](https://docs.pytest.org/) for unit tests. Run them with:
51+
5152
```bash
5253
pytest
5354
```
5455

56+
- **E2E tests:** End-to-end tests run real workloads against a GKE cluster. They live in `tests/e2e/` and are skipped by default unless explicitly enabled.
57+
58+
**Prerequisites:**
59+
- A GCP project with a provisioned GKE cluster (see [Quick Start](../README.md#quick-start))
60+
- Google Cloud SDK authenticated (`gcloud auth login` and `gcloud auth application-default login`)
61+
- GKE credentials configured: `gcloud container clusters get-credentials <KERAS_REMOTE_CLUSTER> --zone <KERAS_REMOTE_ZONE> --project <KERAS_REMOTE_PROJECT>`
62+
- Test dependencies installed: `pip install -e ".[test,cli]"`
63+
64+
**Required environment variables:**
65+
66+
| Variable | Required | Default | Description |
67+
| ---------------------- | -------- | --------------- | ------------------------------ |
68+
| `E2E_TESTS` | Yes || Set to `1` to enable e2e tests |
69+
| `KERAS_REMOTE_PROJECT` | Yes || Google Cloud project ID |
70+
| `KERAS_REMOTE_ZONE` | No | `us-central1-a` | GKE cluster zone |
71+
| `KERAS_REMOTE_CLUSTER` | No | `keras-remote` | GKE cluster name |
72+
73+
**Run all e2e tests:**
74+
75+
```bash
76+
E2E_TESTS=1 KERAS_REMOTE_PROJECT=my-project python -m pytest tests/e2e/ -v -n auto
77+
```
78+
79+
**Run a specific test file:**
80+
81+
```bash
82+
E2E_TESTS=1 KERAS_REMOTE_PROJECT=my-project python -m pytest tests/e2e/cpu_execution_test.py -v
83+
```
84+
85+
Drop `-n auto` to run tests serially to make it easier to debug.
86+
5587
### Submitting changes
5688

5789
1. Fork the repository

0 commit comments

Comments
 (0)