Skip to content

Commit

Permalink
logging and errors (#1338)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Căutișanu <andreicautisanu@Andreis-MacBook-Pro.local>
  • Loading branch information
AndreiCautisanu and Andrei Căutișanu authored Feb 21, 2025
1 parent d50e5b8 commit 0341cef
Show file tree
Hide file tree
Showing 13 changed files with 2,022 additions and 637 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/end2end_suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ jobs:
# Run the appropriate test suite
if [ "$SUITE" == "projects" ]; then
pytest -s tests/Projects/test_projects_crud_operations.py --browser chromium --setup-show
pytest -s tests/Projects/test_projects_crud_operations.py --browser chromium
elif [ "$SUITE" == "traces" ]; then
pytest -s tests/Traces/test_traces_crud_operations.py --browser chromium --setup-show
pytest -s tests/Traces/test_traces_crud_operations.py --browser chromium
elif [ "$SUITE" == "datasets" ]; then
pytest -s tests/Datasets/ --browser chromium --setup-show
pytest -s tests/Datasets/ --browser chromium
elif [ "$SUITE" == "experiments" ]; then
pytest -s tests/Experiments/test_experiments_crud_operations.py --browser chromium --setup-show
pytest -s tests/Experiments/test_experiments_crud_operations.py --browser chromium
elif [ "$SUITE" == "prompts" ]; then
pytest -s tests/Prompts/test_prompts_crud_operations.py --browser chromium --setup-show
pytest -s tests/Prompts/test_prompts_crud_operations.py --browser chromium
elif [ "$SUITE" == "feedback_definitions" ]; then
pytest -s tests/FeedbackDefinitions/test_feedback_definitions_crud.py --browser chromium --setup-show
pytest -s tests/FeedbackDefinitions/test_feedback_definitions_crud.py --browser chromium
elif [ "$SUITE" == "sanity" ]; then
pytest -s -m sanity --browser chromium --setup-show
pytest -s -m sanity --browser chromium
elif [ "$SUITE" == "all_features" ]; then
pytest -s tests --browser chromium --setup-show
pytest -s tests --browser chromium
fi
- name: Stop Opik server (Local)
Expand Down
13 changes: 10 additions & 3 deletions tests_end_to_end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,20 @@ pytest -v
# Run tests with live logs
pytest -s

# Run specific test file with setup information
pytest tests/Projects/test_projects_crud_operations.py --setup-show
# Show HTTP requests in test output
pytest --show-requests # Shows all API calls made during tests

# Run tests with specific browser
pytest --browser chromium # default
pytest --browser firefox
pytest --browser webkit

# Combine multiple options
pytest -v -s tests/Datasets/ --browser firefox --setup-show
pytest -v -s tests/Datasets/ --browser firefox --setup-show --show-requests
```

The `--show-requests` flag is particularly useful when:
- Debugging API integration issues
- Understanding which API calls a test makes
- Verifying the correct API endpoints are being called
- Checking request/response patterns
15 changes: 15 additions & 0 deletions tests_end_to_end/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[pytest]
# General pytest configuration
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*

# Logging configuration
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)s] %(message)s
log_cli_date_format = %H:%M:%S

# Other useful defaults
addopts = -v --tb=short --strict-markers
Loading

0 comments on commit 0341cef

Please sign in to comment.