Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions scripts/gen_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import ast
from pathlib import Path

DIRECTORIES = ["src", "tests/unit", "tests/integration", "tests/e2e"]


def generate_docfile(directory):
"""Generate README.md in the CWD."""
Expand Down Expand Up @@ -48,10 +50,17 @@ def generate_documentation_on_path(path):

def main():
"""Entry point to this script, regenerates documentation in all directories."""
generate_documentation_on_path("src/")
for path in Path("src").rglob("*"):
if path.is_dir():
generate_documentation_on_path(path)
for directory in DIRECTORIES:
generate_documentation_on_path(f"{directory}/")
for path in Path(directory).rglob("*"):
if path.is_dir():
if (
path.name == "lightspeed_stack.egg-info"
or path.name == "__pycache__"
or ".ruff_cache" in str(path)
):
continue
generate_documentation_on_path(path)


if __name__ == "__main__":
Expand Down
11 changes: 11 additions & 0 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List of source files stored in `tests/e2e/` directory

## [__init__.py](__init__.py)
End-to-end tests for the lightspeed-stack REST API service.

## [gen_scenario_list.py](gen_scenario_list.py)
Scenario list generator.

## [test_api.py](test_api.py)
End-to-end tests for basic REST API endpoints.

2 changes: 1 addition & 1 deletion tests/e2e/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""End to end tests for the lightspeed-stack REST API service."""
"""End-to-end tests for the lightspeed-stack REST API service."""
2 changes: 2 additions & 0 deletions tests/e2e/configs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# List of source files stored in `tests/e2e/configs` directory

2 changes: 2 additions & 0 deletions tests/e2e/configuration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# List of source files stored in `tests/e2e/configuration` directory

5 changes: 5 additions & 0 deletions tests/e2e/features/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List of source files stored in `tests/e2e/features` directory

## [environment.py](environment.py)
Code to be called before and after certain events during testing.

29 changes: 29 additions & 0 deletions tests/e2e/features/steps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# List of source files stored in `tests/e2e/features/steps` directory

## [__init__.py](__init__.py)
Implementation of end-to-end tests steps.

## [auth.py](auth.py)
Implementation of common test steps.

## [common.py](common.py)
Implementation of common test steps.

## [common_http.py](common_http.py)
Common steps for HTTP-related operations.

## [conversation.py](conversation.py)
Implementation of common test steps.

## [feedback.py](feedback.py)
Implementation of common test steps for the feedback API.

## [health.py](health.py)
Implementation of common test steps.

## [info.py](info.py)
Implementation of common test steps.

## [llm_query_response.py](llm_query_response.py)
LLM query and response steps.

2 changes: 1 addition & 1 deletion tests/e2e/features/steps/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Implementation of end to end tests steps."""
"""Implementation of end-to-end tests steps."""
2 changes: 1 addition & 1 deletion tests/e2e/features/steps/common_http.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Common steps for HTTP related operations."""
"""Common steps for HTTP-related operations."""

import json

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_api.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Integration tests for basic REST API endpoints."""
"""End-to-end tests for basic REST API endpoints."""
5 changes: 5 additions & 0 deletions tests/e2e/utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List of source files stored in `tests/e2e/utils` directory

## [utils.py](utils.py)
Unsorted utility functions to be used from other sources and test step definitions.

17 changes: 17 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# List of source files stored in `tests/integration/` directory

## [__init__.py](__init__.py)
Integration tests.

## [conftest.py](conftest.py)
Shared fixtures for integration tests.

## [test_configuration.py](test_configuration.py)
Integration tests for configuration loading and handling.

## [test_openapi_json.py](test_openapi_json.py)
Tests the OpenAPI specification that is to be stored in docs/openapi.json.

## [test_version.py](test_version.py)
Test if version is handled correctly.

14 changes: 14 additions & 0 deletions tests/integration/endpoints/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# List of source files stored in `tests/integration/endpoints` directory

## [__init__.py](__init__.py)
Integration tests for API endpoints.

## [test_config_integration.py](test_config_integration.py)
Integration tests for the /config endpoint.

## [test_health_integration.py](test_health_integration.py)
Integration tests for the /health endpoint.

## [test_info_integration.py](test_info_integration.py)
Integration tests for the /info endpoint.

26 changes: 26 additions & 0 deletions tests/unit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# List of source files stored in `tests/unit/` directory

## [__init__.py](__init__.py)
Unit tests.

## [conftest.py](conftest.py)
Shared pytest fixtures for unit tests.

## [test_client.py](test_client.py)
Unit tests for functions defined in src/client.py.

## [test_configuration.py](test_configuration.py)
Unit tests for functions defined in src/configuration.py.

## [test_configuration_unknown_fields.py](test_configuration_unknown_fields.py)
Test configuration validation for unknown fields.

## [test_lightspeed_stack.py](test_lightspeed_stack.py)
Unit tests for functions defined in src/lightspeed_stack.py.

## [test_llama_stack_configuration.py](test_llama_stack_configuration.py)
Unit tests for functions defined in src/llama_stack_configuration.py.

## [test_log.py](test_log.py)
Unit tests for functions defined in src/log.py.

11 changes: 11 additions & 0 deletions tests/unit/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List of source files stored in `tests/unit/app` directory

## [__init__.py](__init__.py)
Init of tests/unit/app.

## [test_database.py](test_database.py)
Unit tests for app.database module.

## [test_routers.py](test_routers.py)
Unit tests for routers.py.

53 changes: 53 additions & 0 deletions tests/unit/app/endpoints/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# List of source files stored in `tests/unit/app/endpoints` directory

## [__init__.py](__init__.py)
Unit tests for endpoints implementations.

## [test_authorized.py](test_authorized.py)
Unit tests for the /authorized REST API endpoint.

## [test_config.py](test_config.py)
Unit tests for the /config REST API endpoint.

## [test_conversations.py](test_conversations.py)
Unit tests for the /conversations REST API endpoints.

## [test_conversations_v2.py](test_conversations_v2.py)
Unit tests for the /conversations REST API endpoints.

## [test_feedback.py](test_feedback.py)
Unit tests for the /feedback REST API endpoint.

## [test_health.py](test_health.py)
Unit tests for the /health REST API endpoint.

## [test_info.py](test_info.py)
Unit tests for the /info REST API endpoint.

## [test_metrics.py](test_metrics.py)
Unit tests for the /metrics REST API endpoint.

## [test_models.py](test_models.py)
Unit tests for the /models REST API endpoint.

## [test_providers.py](test_providers.py)
Unit tests for the /providers REST API endpoints.

## [test_query.py](test_query.py)
Unit tests for the /query REST API endpoint.

## [test_query_v2.py](test_query_v2.py)
Unit tests for the /query (v2) REST API endpoint using Responses API.

## [test_root.py](test_root.py)
Unit tests for the / endpoint handler.

## [test_shields.py](test_shields.py)
Unit tests for the /shields REST API endpoint.

## [test_streaming_query.py](test_streaming_query.py)
Unit tests for the /streaming-query REST API endpoint.

## [test_tools.py](test_tools.py)
Unit tests for tools endpoint.

23 changes: 23 additions & 0 deletions tests/unit/authentication/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# List of source files stored in `tests/unit/authentication` directory

## [__init__.py](__init__.py)
Authentication unit tests package.

## [test_auth.py](test_auth.py)
Unit tests for functions defined in authentication/__init__.py

## [test_jwk_token.py](test_jwk_token.py)
Unit tests for functions defined in authentication/jwk_token.py

## [test_k8s.py](test_k8s.py)
Unit tests for authentication/k8s module.

## [test_noop.py](test_noop.py)
Unit tests for functions defined in authentication/noop.py

## [test_noop_with_token.py](test_noop_with_token.py)
Unit tests for functions defined in authentication/noop_with_token.py

## [test_utils.py](test_utils.py)
Unit tests for functions defined in authentication/utils.py

11 changes: 11 additions & 0 deletions tests/unit/authorization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List of source files stored in `tests/unit/authorization` directory

## [__init__.py](__init__.py)
Unit tests for authorization module.

## [test_middleware.py](test_middleware.py)
Unit tests for the authorization middleware.

## [test_resolvers.py](test_resolvers.py)
Unit tests for the authorization resolvers.

17 changes: 17 additions & 0 deletions tests/unit/cache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# List of source files stored in `tests/unit/cache` directory

## [__init__.py](__init__.py)
Test cases for conversation history cache implementations.

## [test_cache_factory.py](test_cache_factory.py)
Unit tests for CacheFactory class.

## [test_noop_cache.py](test_noop_cache.py)
Unit tests for NoopCache class.

## [test_postgres_cache.py](test_postgres_cache.py)
Unit tests for PostgreSQL cache implementation.

## [test_sqlite_cache.py](test_sqlite_cache.py)
Unit tests for SQLite cache implementation.

8 changes: 8 additions & 0 deletions tests/unit/metrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List of source files stored in `tests/unit/metrics` directory

## [__init__.py](__init__.py)
Unit tests for metrics.

## [test_utis.py](test_utis.py)
Unit tests for functions defined in metrics/utils.py

5 changes: 5 additions & 0 deletions tests/unit/models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List of source files stored in `tests/unit/models` directory

## [__init__.py](__init__.py)
Unit tests for models.

59 changes: 59 additions & 0 deletions tests/unit/models/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# List of source files stored in `tests/unit/models/config` directory

## [__init__.py](__init__.py)
Unit tests for models defined in config.py.

## [test_authentication_configuration.py](test_authentication_configuration.py)
Unit tests for AuthenticationConfiguration model.

## [test_byok_rag.py](test_byok_rag.py)
Unit tests for ByokRag model.

## [test_conversation_cache.py](test_conversation_cache.py)
Unit tests for ConversationCacheConfiguration model.

## [test_cors.py](test_cors.py)
Unit tests for CORSConfiguration model.

## [test_customization.py](test_customization.py)
Unit tests for Customization model.

## [test_database_configuration.py](test_database_configuration.py)
Unit tests for DatabaseConfiguration model.

## [test_dump_configuration.py](test_dump_configuration.py)
Unit tests checking ability to dump configuration.

## [test_inference_configuration.py](test_inference_configuration.py)
Unit tests for InferenceConfiguration model.

## [test_jwt_role_rule.py](test_jwt_role_rule.py)
Unit tests for JwtRoleRule model.

## [test_llama_stack_configuration.py](test_llama_stack_configuration.py)
Unit tests for LlamaStackConfiguration model.

## [test_model_context_protocol_server.py](test_model_context_protocol_server.py)
Unit tests for ModelContextProtocolServer model.

## [test_postgresql_database_configuration.py](test_postgresql_database_configuration.py)
Unit tests for PostgreSQLDatabaseConfiguration model.

## [test_quota_handlers_config.py](test_quota_handlers_config.py)
Unit tests for QuotaHandlersConfiguration model.

## [test_quota_limiter_config.py](test_quota_limiter_config.py)
Unit tests for QuotaLimiterConfig model.

## [test_quota_scheduler_config.py](test_quota_scheduler_config.py)
Unit tests for QuotaSchedulerConfig model.

## [test_service_configuration.py](test_service_configuration.py)
Unit tests for ServiceConfiguration model.

## [test_tls_configuration.py](test_tls_configuration.py)
Unit tests for TLSConfiguration model.

## [test_user_data_collection.py](test_user_data_collection.py)
Unit tests for UserDataCollection model.

17 changes: 17 additions & 0 deletions tests/unit/models/requests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# List of source files stored in `tests/unit/models/requests` directory

## [__init__.py](__init__.py)
Unit tests for models defined in requests.py.

## [test_attachment.py](test_attachment.py)
Unit tests for Attachment model.

## [test_feedback_request.py](test_feedback_request.py)
Unit tests for FeedbackRequest model.

## [test_feedback_status_update_request.py](test_feedback_status_update_request.py)
Unit tests for FeedbackStatusUpdateRequest model.

## [test_query_request.py](test_query_request.py)
Unit tests for QueryRequest model.

20 changes: 20 additions & 0 deletions tests/unit/models/responses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# List of source files stored in `tests/unit/models/responses` directory

## [__init__.py](__init__.py)
Unit tests for models defined in responses.py.

## [test_authorized_response.py](test_authorized_response.py)
Unit tests for AuthorizedResponse model.

## [test_query_response.py](test_query_response.py)
Unit tests for QueryResponse model.

## [test_rag_chunk.py](test_rag_chunk.py)
Unit tests for RAGChunk model.

## [test_status_response.py](test_status_response.py)
Unit tests for StatusResponse model.

## [test_unauthorized_response.py](test_unauthorized_response.py)
Unit tests for UnauthorizedResponse model.

Loading
Loading