Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Organize integration tests and update Makefile

Edwin Jose17b1a341c457
diff --git a/Makefile b/Makefile
index aa22e64e8..7e9e2ae6a 100644
--- a/Makefile
+++ b/Makefile
@@ -665,9 +665,11 @@ test-unit: ## Run unit tests only
@echo "$(PURPLE)Unit tests complete.$(NC)"
test-integration: ## Run integration tests (requires infrastructure)
- @echo "$(YELLOW)Running integration tests (requires infrastructure)...$(NC)"
- @echo "$(CYAN)Make sure to run 'make dev-local' first!$(NC)"
- uv run pytest tests/integration/ --ignore=tests/integration/test_sdk.py -v
+ @echo "$(CYAN)════════════════════════════════════════$(NC)"
+ @echo "$(PURPLE) Core Integration Tests$(NC)"
+ @echo "$(CYAN)════════════════════════════════════════$(NC)"
+ @echo "$(YELLOW)Make sure to run 'make dev-local' first!$(NC)"
+ uv run pytest tests/integration/core/ -v
test-ci: ## Start infra, run integration + SDK tests, tear down (uses DockerHub images)
@set -e; \
@@ -752,29 +754,41 @@ test-ci: ## Start infra, run integration + SDK tests, tear down (uses DockerHub
$(COMPOSE_CMD) down -v 2>/dev/null || true; \
exit 1; \
fi; \
- echo "$(PURPLE)Running integration tests$(NC)"; \
+ echo "::group::Core Integration Tests"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) Core Integration Tests$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
LOG_LEVEL=$${LOG_LEVEL:-DEBUG} \
GOOGLE_OAUTH_CLIENT_ID="" \
GOOGLE_OAUTH_CLIENT_SECRET="" \
OPENSEARCH_HOST=localhost OPENSEARCH_PORT=9200 \
OPENSEARCH_USERNAME=admin OPENSEARCH_PASSWORD=$${OPENSEARCH_PASSWORD} \
DISABLE_STARTUP_INGEST=$${DISABLE_STARTUP_INGEST:-true} \
- uv run pytest tests/integration --ignore=tests/integration/test_sdk.py -vv -s -o log_cli=true --log-cli-level=DEBUG; \
+ uv run pytest tests/integration/core -vv -s -o log_cli=true --log-cli-level=DEBUG; \
TEST_RESULT=$$?; \
+ echo "::endgroup::"; \
echo ""; \
echo "$(YELLOW)Waiting for frontend at http://localhost:3000...$(NC)"; \
for i in $$(seq 1 60); do \
curl -s http://localhost:3000/ >/dev/null 2>&1 && break || sleep 2; \
done; \
- echo "$(PURPLE)Running Python SDK integration tests$(NC)"; \
+ echo "::group::SDK Integration Tests (Python)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) SDK Integration Tests (Python)$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
uv pip install -e sdks/python; \
- SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/test_sdk.py -vv -s || TEST_RESULT=1; \
- echo "$(PURPLE)Running TypeScript SDK integration tests$(NC)"; \
+ SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/sdk/ -vv -s || TEST_RESULT=1; \
+ echo "::endgroup::"; \
+ echo "::group::SDK Integration Tests (TypeScript)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) SDK Integration Tests (TypeScript)$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
cd sdks/typescript && \
npm install && npm run build && \
OPENRAG_URL=http://localhost:3000 npm test || TEST_RESULT=1; \
cd ../..; \
- echo "$(CYAN)=================================$(NC)"; \
+ echo "::endgroup::"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
echo ""; \
($(call test_jwt_opensearch)) || TEST_RESULT=1; \
echo "$(YELLOW)Tearing down infra$(NC)"; \
@@ -866,29 +880,41 @@ test-ci-local: ## Same as test-ci but builds all images locally
$(COMPOSE_CMD) down -v 2>/dev/null || true; \
exit 1; \
fi; \
- echo "$(PURPLE)Running integration tests$(NC)"; \
+ echo "::group::Core Integration Tests"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) Core Integration Tests$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
LOG_LEVEL=$${LOG_LEVEL:-DEBUG} \
GOOGLE_OAUTH_CLIENT_ID="" \
GOOGLE_OAUTH_CLIENT_SECRET="" \
OPENSEARCH_HOST=localhost OPENSEARCH_PORT=9200 \
OPENSEARCH_USERNAME=admin OPENSEARCH_PASSWORD=$${OPENSEARCH_PASSWORD} \
DISABLE_STARTUP_INGEST=$${DISABLE_STARTUP_INGEST:-true} \
- uv run pytest tests/integration --ignore=tests/integration/test_sdk.py -vv -s -o log_cli=true --log-cli-level=DEBUG; \
+ uv run pytest tests/integration/core -vv -s -o log_cli=true --log-cli-level=DEBUG; \
TEST_RESULT=$$?; \
+ echo "::endgroup::"; \
echo ""; \
echo "$(YELLOW)Waiting for frontend at http://localhost:3000...$(NC)"; \
for i in $$(seq 1 60); do \
curl -s http://localhost:3000/ >/dev/null 2>&1 && break || sleep 2; \
done; \
- echo "$(PURPLE)Running Python SDK integration tests$(NC)"; \
+ echo "::group::SDK Integration Tests (Python)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) SDK Integration Tests (Python)$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
uv pip install -e sdks/python; \
- SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/test_sdk.py -vv -s || TEST_RESULT=1; \
- echo "$(PURPLE)Running TypeScript SDK integration tests$(NC)"; \
+ SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/sdk/ -vv -s || TEST_RESULT=1; \
+ echo "::endgroup::"; \
+ echo "::group::SDK Integration Tests (TypeScript)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
+ echo "$(PURPLE) SDK Integration Tests (TypeScript)$(NC)"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
cd sdks/typescript && \
npm install && npm run build && \
OPENRAG_URL=http://localhost:3000 npm test || TEST_RESULT=1; \
cd ../..; \
- echo "$(CYAN)=================================$(NC)"; \
+ echo "::endgroup::"; \
+ echo "$(CYAN)════════════════════════════════════════$(NC)"; \
echo ""; \
if [ $$TEST_RESULT -ne 0 ]; then \
echo "$(RED)=== Tests failed, dumping container logs ===$(NC)"; \
@@ -910,12 +936,12 @@ test-os-jwt: ## Test JWT authentication against OpenSearch
@$(call test_jwt_opensearch)
test-sdk: ## Run SDK integration tests (requires running OpenRAG at localhost:3000)
- @echo "$(YELLOW)Running SDK integration tests...$(NC)"
- @echo "$(CYAN)Make sure OpenRAG is running at localhost:3000 (make dev)$(NC)"
- @echo ""
- @echo "$(PURPLE)Running Python SDK tests...$(NC)"
+ @echo "$(CYAN)════════════════════════════════════════$(NC)"
+ @echo "$(PURPLE) SDK Integration Tests (Python)$(NC)"
+ @echo "$(CYAN)════════════════════════════════════════$(NC)"
+ @echo "$(YELLOW)Make sure OpenRAG is running at localhost:3000 (make dev)$(NC)"
uv pip install -e sdks/python
- SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/test_sdk.py -vv -s
+ SDK_TESTS_ONLY=true OPENRAG_URL=http://localhost:3000 uv run pytest tests/integration/sdk/ -vv -s
@echo ""
@echo "$(PURPLE)Running TypeScript SDK tests...$(NC)"
cd sdks/typescript && npm install && npm run build && OPENRAG_URL=http://localhost:3000 npm test
diff --git a/tests/integration/core/__init__.py b/tests/integration/core/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/integration/test_api_endpoints.py b/tests/integration/core/test_api_endpoints.py
similarity index 100%
rename from tests/integration/test_api_endpoints.py
rename to tests/integration/core/test_api_endpoints.py
diff --git a/tests/integration/test_startup_ingest.py b/tests/integration/core/test_startup_ingest.py
similarity index 100%
rename from tests/integration/test_startup_ingest.py
rename to tests/integration/core/test_startup_ingest.py
diff --git a/tests/integration/sdk/__init__.py b/tests/integration/sdk/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/integration/test_sdk.py b/tests/integration/sdk/test_sdk.py
similarity index 100%
rename from tests/integration/test_sdk.py
rename to tests/integration/sdk/test_sdk.py