Test suite for RHOS Lightspeed in RHOSO environments.
uv venv
uv syncDefault settings are in config/default.yaml:
rhos_lightspeed:
base_url: "http://localhost:8080"
timeout: 30
query:
default_question: "What is OpenStack?"Override the endpoint via environment variable:
export RHOS_LIGHTSPEED_URL=http://rhos-lightspeed:8080If you run the tests outside of OpenShift, you need to have a running port forward
for the lightspeed-app-server service. For example:
oc port-forward -n openstack-lightspeed svc/lightspeed-app-server 8443:8443
# Run all tests
uv run pytest
# Run integration tests only
uv run pytest tests/integration/
# Generate JUnit XML (automatic via pyproject.toml config)
uv run pytest # outputs test-results.xml-
Create test file in appropriate directory:
tests/unit/- Fast, isolated teststests/integration/- Tests requiring deployed servicetests/e2e/- Full end-to-end scenarios
-
Use the shared fixtures from
conftest.py:class TestMyFeature: def test_something(self, client, config): response = client.query("my question") assert response.status_code == 200
-
Run:
uv run pytest tests/integration/test_my_feature.py
rhos-lightspeed-tests/
├── config/
│ └── default.yaml # Default test configuration
├── src/rhos_lightspeed_tests/ # Shared utilities
│ ├── __init__.py
│ ├── client.py # API client (query, health)
│ └── config.py # Reads default.yaml, env var overrides
├── tests/
│ ├── conftest.py # Shared fixtures (config, client)
│ ├── unit/
│ ├── integration/
│ │ └── test_query_endpoint.py # First test: /query endpoint
│ └── e2e/
├── pyproject.toml
└── README.md