Skip to content

Commit ae3912c

Browse files
Local e2e Testing documentation
1 parent 45c8342 commit ae3912c

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ To build the codeflare-sdk pre-commit image run `podman build -f .github/build/C
5151
### Testing
5252

5353
- To install codeflare-sdk in editable mode, run `pip install -e .` from the repo root.
54-
- To run the unit tests, run `pytest -v tests/unit_test.py`
5554
- Any new test functions/scripts can be added into the `tests` folder
5655
- NOTE: Functional tests coming soon, will live in `tests/func_test.py`
5756

57+
#### Unit Testing
58+
- To run the unit tests, run `pytest -v tests/unit_test.py`
59+
60+
#### Local e2e Testing
61+
- Please follow the [e2e documentation](https://https://github.com/project-codeflare/codeflare-sdk/blob/main/docs/e2e.md)
62+
5863
#### Code Coverage
5964

6065
- Run tests with the following command: `coverage run -m --source=src pytest tests/unit_test.py`

docs/e2e.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Running e2e tests locally
2+
#### Pre-requisites
3+
- We recommend using Python 3.9, along with Poetry.
4+
5+
## On KinD clusters
6+
Pre-requisite for KinD clusters: please add in your local `/etc/hosts` file `127.0.0.1 kind`. This will map your localhost IP address to the KinD cluster's hostname. This is already performed on [GitHub Actions](https://github.com/project-codeflare/codeflare-common/blob/1edd775e2d4088a5a0bfddafb06ff3a773231c08/github-actions/kind/action.yml#L70-L72)
7+
8+
- Setup Phase:
9+
- Pull the [codeflare-operator repo](https://github.com/project-codeflare/codeflare-operator) and run the following make targets:
10+
```
11+
make kind-e2e
12+
export CLUSTER_HOSTNAME=kind
13+
export CODEFLARE_TEST_TIMEOUT_LONG=20m
14+
make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.1.0
15+
make setup-e2e
16+
```
17+
- Test Phase:
18+
- Once we have the codeflare-operator and kuberay-operator running and ready, we can run the e2e test on the codeflare-sdk repository:
19+
```
20+
poetry install --with test,docs
21+
poetry run pytest -v -s ./tests/e2e/mnist_raycluster_sdk_test.py
22+
```
23+
24+
25+
26+
## On OpenShift clusters
27+
- Setup Phase:
28+
- Pull the [codeflare-operator repo](https://github.com/project-codeflare/codeflare-operator) and run the following make targets:
29+
```
30+
make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.1.0
31+
make setup-e2e
32+
```
33+
- Test Phase:
34+
- Once we have the codeflare-operator and kuberay-operator running and ready, we can run the e2e test on the codeflare-sdk repository:
35+
```
36+
poetry install --with test,docs
37+
poetry run pytest -v -s ./tests/e2e/mnist_raycluster_sdk_test.py
38+
```

0 commit comments

Comments
 (0)