Skip to content

Commit 16ffc77

Browse files
Document test.sh
1 parent d80a181 commit 16ffc77

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/scripts/tests/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,64 @@ If you wish to keep the resources, add `-skipCleanup=True` in the config above.
9292
$ kubectl delete datasciencepipelinesapplications test-dspa -n test-dspa
9393
datasciencepipelinesapplication.datasciencepipelinesapplications.opendatahub.io "test-dspa" deleted
9494
```
95+
96+
# `tests.sh` details
97+
This Bash script is designed to set up and test environments for Data Science Pipelines Operator (DSPO)
98+
using Kubernetes (K8s) or *OpenShift with RHOAI deployed*. It includes functionalities to deploy dependencies,
99+
configure namespaces, build and deploy images, and execute integration tests.
100+
101+
## **Features**
102+
1. **Environment Variables Declaration**:
103+
The script requires and verifies environment variables such as `GIT_WORKSPACE`, `REGISTRY_ADDRESS`, and `K8SAPISERVERHOST`. These variables define the workspace, registry for container images, and K8s API server address.
104+
105+
2. **Deployment Functions**:
106+
Functions like `deploy_dspo`, `deploy_minio`, and `deploy_mariadb` handle deploying necessary components (e.g., MinIO, MariaDB, PyPI server) to the cluster.
107+
108+
3. **Namespace Configuration**:
109+
Functions like `create_opendatahub_namespace` and `create_dspa_namespace` create and configure Kubernetes namespaces required for DSPO and other dependencies.
110+
111+
4. **Integration Testing**:
112+
The script provides commands to run integration tests for DSPO and its external connections using `run_tests` and `run_tests_dspa_external_connections`.
113+
114+
5. **Cleanup and Resource Removal**:
115+
Includes options like `--clean-infra` to remove namespaces and resources before running tests.
116+
117+
6. **Conditional Execution**:
118+
Supports setting up and testing environments for different targets:
119+
- `kind` (local Kubernetes clusters)
120+
- `rhoai` (Red Hat OpenShift AI)
121+
122+
7. **Customizable Parameters**:
123+
Allows passing values for paths, namespaces, and K8s API server via command-line arguments.
124+
125+
## **Usage**
126+
```bash
127+
./tests.sh [OPTIONS]
128+
```
129+
130+
### **Options**
131+
- `--kind`
132+
Targets local `kind` cluster.
133+
- `--rhoai`
134+
Targets RHOAI
135+
- `--clean-infra`
136+
Cleans existing resources before running tests.
137+
- `--k8s-api-server-host <HOST>`
138+
Specifies the Kubernetes API server host.
139+
- `--dspa-namespace <NAMESPACE>`
140+
Custom namespace for DSPA deployment.
141+
- `--dspa-path <PATH>`
142+
Path to DSPA resource YAML.
143+
- `--endpoint-type <TYPE>`
144+
Specifies endpoint type (`service` or `route`).
145+
146+
### **Example**
147+
To deploy and test DSPA on a local `kind` cluster:
148+
```bash
149+
./tests.sh --kind --clean-infra --k8s-api-server-host "https://localhost:6443"
150+
```
151+
152+
To deploy DSPA on RHOAI:
153+
```bash
154+
./tests.sh --rhoai --dspa-namespace "custom-namespace"
155+
```

0 commit comments

Comments
 (0)