Skip to content

Commit

Permalink
Local e2e Testing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria authored and openshift-merge-bot[bot] committed Feb 7, 2024
1 parent 45c8342 commit ae3912c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ To build the codeflare-sdk pre-commit image run `podman build -f .github/build/C
### Testing

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

#### Unit Testing
- To run the unit tests, run `pytest -v tests/unit_test.py`

#### Local e2e Testing
- Please follow the [e2e documentation](https://https://github.com/project-codeflare/codeflare-sdk/blob/main/docs/e2e.md)

#### Code Coverage

- Run tests with the following command: `coverage run -m --source=src pytest tests/unit_test.py`
Expand Down
38 changes: 38 additions & 0 deletions docs/e2e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Running e2e tests locally
#### Pre-requisites
- We recommend using Python 3.9, along with Poetry.

## On KinD clusters
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)

- Setup Phase:
- Pull the [codeflare-operator repo](https://github.com/project-codeflare/codeflare-operator) and run the following make targets:
```
make kind-e2e
export CLUSTER_HOSTNAME=kind
export CODEFLARE_TEST_TIMEOUT_LONG=20m
make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.1.0
make setup-e2e
```
- Test Phase:
- Once we have the codeflare-operator and kuberay-operator running and ready, we can run the e2e test on the codeflare-sdk repository:
```
poetry install --with test,docs
poetry run pytest -v -s ./tests/e2e/mnist_raycluster_sdk_test.py
```



## On OpenShift clusters
- Setup Phase:
- Pull the [codeflare-operator repo](https://github.com/project-codeflare/codeflare-operator) and run the following make targets:
```
make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.1.0
make setup-e2e
```
- Test Phase:
- Once we have the codeflare-operator and kuberay-operator running and ready, we can run the e2e test on the codeflare-sdk repository:
```
poetry install --with test,docs
poetry run pytest -v -s ./tests/e2e/mnist_raycluster_sdk_test.py
```

0 comments on commit ae3912c

Please sign in to comment.