-
Notifications
You must be signed in to change notification settings - Fork 584
feat: add comprehensive integration tests for transport providers #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| .env | ||
| .vscode | ||
| .DS_Store | ||
| *_creds* | ||
| *_creds* | ||
| **/venv/ | ||
| **/__pycache__/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ result, err := bifrost.ChatCompletionRequest( | |
| 2. **Model Selection** | ||
|
|
||
| - Use models with similar capabilities | ||
| - Consider model-specific features (e.g., function calling, streaming) | ||
| - Consider model-specific features (e.g., function calling) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Drop streaming from model-specific features 🤖 Prompt for AI Agents |
||
| - Account for different token limits and pricing | ||
|
|
||
| 3. **Error Handling** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Bifrost Python E2E Test Makefile | ||
| # Provides convenient commands for running tests | ||
|
|
||
| # Get the directory where this Makefile is located | ||
| SCRIPT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
|
||
| .PHONY: help install test test-all test-parallel test-verbose clean lint format check-env | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Expand The current .DEFAULT_GOAL := helpto guide users. 🧰 Tools🪛 checkmake (0.2.2)[warning] 4-4: Missing required phony target "all" (minphony) 🤖 Prompt for AI Agents |
||
|
|
||
|
Comment on lines
+7
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive)
Add all public targets and a default goal: .PHONY: help install check-env test test-parallel test-verbose test-list \
test-openai test-anthropic test-litellm test-langchain test-langgraph \
test-mistral test-genai test-all test-pytest-parallel test-coverage \
lint format clean quick-test all-tests dev-setup
.DEFAULT_GOAL := help🧰 Tools🪛 checkmake (0.2.2)[warning] 7-7: Missing required phony target "all" (minphony) 🤖 Prompt for AI Agents |
||
| # Default target | ||
| help: | ||
| @echo "Bifrost Python E2E Test Commands:" | ||
| @echo "" | ||
| @echo "Setup:" | ||
| @echo " install Install Python dependencies" | ||
| @echo " check-env Check environment variables" | ||
| @echo "" | ||
| @echo "Testing:" | ||
| @echo " test Run all tests using master runner" | ||
| @echo " test-all Run all tests with pytest" | ||
| @echo " test-parallel Run tests in parallel" | ||
| @echo " test-verbose Run tests with verbose output" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| @echo " test-openai Run OpenAI integration tests only" | ||
| @echo " test-anthropic Run Anthropic integration tests only" | ||
| @echo " test-litellm Run LiteLLM integration tests only" | ||
| @echo " test-langchain Run LangChain integration tests only" | ||
| @echo " test-langgraph Run LangGraph integration tests only" | ||
| @echo " test-mistral Run Mistral integration tests only" | ||
| @echo " test-genai Run Google GenAI integration tests only" | ||
| @echo "" | ||
| @echo "Development:" | ||
| @echo " lint Run code linting" | ||
| @echo " format Format code with black" | ||
| @echo " clean Clean up temporary files" | ||
|
|
||
| # Setup commands | ||
| install: | ||
| pip install -r $(SCRIPT_DIR)requirements.txt | ||
|
|
||
| check-env: | ||
| @echo "Checking environment variables..." | ||
| @python -c "import os; print('✓ BIFROST_BASE_URL:', os.getenv('BIFROST_BASE_URL', 'http://localhost:8080'))" | ||
| @python -c "import os; print('✓ OPENAI_API_KEY:', 'Set' if os.getenv('OPENAI_API_KEY') else 'Not set')" | ||
| @python -c "import os; print('✓ ANTHROPIC_API_KEY:', 'Set' if os.getenv('ANTHROPIC_API_KEY') else 'Not set')" | ||
| @python -c "import os; print('✓ MISTRAL_API_KEY:', 'Set' if os.getenv('MISTRAL_API_KEY') else 'Not set')" | ||
| @python -c "import os; print('✓ GOOGLE_API_KEY:', 'Set' if os.getenv('GOOGLE_API_KEY') else 'Not set')" | ||
|
|
||
|
Comment on lines
+39
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add checks for all provider API keys. We currently verify @python -c "import os; print('✓ LITELLM_API_KEY:', 'Set' if os.getenv('LITELLM_API_KEY') else 'Not set')"🤖 Prompt for AI Agents |
||
| # Testing commands using master runner | ||
| test: | ||
| python $(SCRIPT_DIR)run_all_tests.py | ||
|
|
||
| test-parallel: | ||
| python $(SCRIPT_DIR)run_all_tests.py --parallel | ||
|
|
||
| test-verbose: | ||
| python $(SCRIPT_DIR)run_all_tests.py --verbose | ||
|
|
||
| test-list: | ||
| python $(SCRIPT_DIR)run_all_tests.py --list | ||
|
|
||
| # Individual integration tests | ||
| test-openai: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration openai --verbose | ||
|
|
||
| test-anthropic: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration anthropic --verbose | ||
|
|
||
| test-litellm: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration litellm --verbose | ||
|
|
||
| test-langchain: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration langchain --verbose | ||
|
|
||
| test-langgraph: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration langgraph --verbose | ||
|
|
||
| test-mistral: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration mistral --verbose | ||
|
|
||
| test-genai: | ||
| python $(SCRIPT_DIR)run_all_tests.py --integration genai --verbose | ||
|
|
||
| # Pytest commands | ||
| test-all: | ||
| pytest -v | ||
|
|
||
| test-pytest-parallel: | ||
| pytest -v -n auto | ||
|
|
||
| test-coverage: | ||
| pytest --cov=. --cov-report=html --cov-report=term | ||
|
|
||
|
Comment on lines
+83
to
+91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Scope pytest to the integration test folder. Ensure pytest runs against the new tests directory: -test-all:
- pytest -v
+test-all:
+ pytest -v $(MAKEFILE_DIR)This makes it explicit and avoids accidentally running unrelated tests.
🤖 Prompt for AI Agents |
||
| # Development commands | ||
| lint: | ||
| @echo "Running flake8..." | ||
| cd $(SCRIPT_DIR) && flake8 *.py | ||
| @echo "Running mypy..." | ||
| cd $(SCRIPT_DIR) && mypy *.py | ||
|
|
||
| format: | ||
| @echo "Formatting code with black..." | ||
| cd $(SCRIPT_DIR) && black *.py | ||
|
Comment on lines
+93
to
+101
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Lint/format only top-level Replace the glob with a recursive path to cover the whole test suite: lint:
flake8 $(SCRIPT_DIR)
format:
black $(SCRIPT_DIR)🤖 Prompt for AI Agents |
||
|
|
||
| clean: | ||
| @echo "Cleaning up temporary files..." | ||
| cd $(SCRIPT_DIR) && rm -rf __pycache__/ | ||
| cd $(SCRIPT_DIR) && rm -rf .pytest_cache/ | ||
| cd $(SCRIPT_DIR) && rm -rf .coverage | ||
| cd $(SCRIPT_DIR) && rm -rf htmlcov/ | ||
| cd $(SCRIPT_DIR) && rm -rf .mypy_cache/ | ||
| cd $(SCRIPT_DIR) && find . -name "*.pyc" -delete | ||
| cd $(SCRIPT_DIR) && find . -name "*.pyo" -delete | ||
|
|
||
| # Quick commands for common workflows | ||
| quick-test: check-env test | ||
|
|
||
| all-tests: install check-env test-parallel | ||
|
|
||
| dev-setup: install check-env | ||
| @echo "Development environment ready!" | ||
| @echo "Run 'make test' to execute all tests" | ||
|
Comment on lines
+113
to
+120
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add workflow shortcuts to Include 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider adding a root-level
.venv/pattern and byte-code glob**/venv/covers nested folders, but the most common virtual-env name is.venv/in the repo root.Likewise, adding
*.py[cod]ensures all compiled byte-code artefacts (including edge cases outside__pycache__) are ignored.📝 Committable suggestion
🤖 Prompt for AI Agents