You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONSTITUTION.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ All code MUST consider security implications.
79
79
- Avoid running destructive commands without explicit user confirmation
80
80
- Use detect-secrets and gitleaks pre-commit hooks to prevent secret leakage
81
81
- Test code MUST NOT introduce vulnerabilities into the tested systems
82
+
- Use `utilities.path_utils.resolve_repo_path` to resolve and validate any user-supplied or parameterized file paths, preventing path-traversal and symlink-escape outside the repository root
82
83
- JIRA ticket links are allowed in PRs and commit messages (our Jira is public)
83
84
- Do NOT reference internal-only resources (Jenkins, Confluence, Slack threads) in code, PRs, or commit messages
84
85
- Do NOT link embargoed or security-restricted (RH-employee-only) tickets
This directory contains foundational health check tests for OpenDataHub/RHOAI clusters. These tests serve as prerequisites to ensure the cluster and operators are in a healthy state before running more complex integration tests.
4
+
5
+
## Directory Structure
6
+
7
+
```text
8
+
cluster_health/
9
+
├── test_cluster_health.py # Cluster node health validation
10
+
└── test_operator_health.py # Operator and pod health validation
11
+
```
12
+
13
+
### Current Test Suites
14
+
15
+
-**`test_cluster_health.py`** - Validates that all cluster nodes are healthy and schedulable
16
+
-**`test_operator_health.py`** - Validates that DSCInitialization, DataScienceCluster resources are ready, and all pods in operator/application namespaces are running
17
+
18
+
## Test Markers
19
+
20
+
Tests use the following markers defined in `pytest.ini`:
21
+
22
+
-`@pytest.mark.cluster_health` - Tests that verify the cluster is healthy to begin testing
23
+
-`@pytest.mark.operator_health` - Tests that verify OpenDataHub/RHOAI operators are healthy and functioning correctly
24
+
25
+
## Test Details
26
+
27
+
### Cluster Node Health (`test_cluster_health.py`)
28
+
29
+
-**`test_cluster_node_healthy`** - Asserts all cluster nodes have `KubeletReady: True` condition and are schedulable (not cordoned)
30
+
31
+
### Operator Health (`test_operator_health.py`)
32
+
33
+
-**`test_data_science_cluster_initialization_healthy`** - Validates the DSCInitialization resource reaches `READY` status (120s timeout)
34
+
-**`test_data_science_cluster_healthy`** - Validates the DataScienceCluster resource reaches `READY` status (120s timeout)
35
+
-**`test_pods_cluster_healthy`** - Validates all pods in operator and application namespaces reach Running/Completed state (180s timeout). Parametrized across `operator_namespace` and `applications_namespace` from global config
36
+
37
+
## Running Tests
38
+
39
+
### Run All Cluster Health Tests
40
+
41
+
```bash
42
+
uv run pytest tests/cluster_health/
43
+
```
44
+
45
+
### Run by Marker
46
+
47
+
```bash
48
+
# Run cluster node health tests
49
+
uv run pytest -m cluster_health
50
+
51
+
# Run operator health tests
52
+
uv run pytest -m operator_health
53
+
54
+
# Run both
55
+
uv run pytest -m "cluster_health or operator_health"
This directory contains shared pytest fixtures that are used across multiple test modules. These fixtures are automatically loaded via pytest's plugin mechanism, registered in `/tests/conftest.py`.
-**`guardrails.py`** - Fixtures for deploying and configuring the Guardrails Orchestrator, including pods, routes, health checks, and gateway configuration
20
+
-**`inference.py`** - Fixtures for vLLM CPU serving runtimes, InferenceServices (Qwen), LLM-d inference simulator, and KServe controller configuration
21
+
-**`trustyai.py`** - Fixtures for TrustyAI operator deployment and DataScienceCluster LMEval configuration
22
+
-**`vector_io.py`** - Factory fixture for deploying vector database providers (Milvus, Faiss, PGVector, Qdrant) with their backing services and configuration
23
+
24
+
## Registration
25
+
26
+
All fixture modules are registered as pytest plugins in `/tests/conftest.py`:
27
+
28
+
```python
29
+
pytest_plugins = [
30
+
"tests.fixtures.inference",
31
+
"tests.fixtures.guardrails",
32
+
"tests.fixtures.trustyai",
33
+
"tests.fixtures.vector_io",
34
+
"tests.fixtures.files",
35
+
]
36
+
```
37
+
38
+
## Usage
39
+
40
+
Fixtures are automatically available to all tests. Factory fixtures accept parameters via `pytest.mark.parametrize` with `indirect=True`.
When adding shared fixtures, place them in the appropriate module file (or create a new one), and register the new module in `/tests/conftest.py` under `pytest_plugins`. Follow the project's fixture conventions: use noun-based names, narrowest appropriate scope, and context managers for resource lifecycle.
0 commit comments