-
Notifications
You must be signed in to change notification settings - Fork 0
Add smoke tests for IDVs and vehicles to production suite #9
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
base: issue-1328/vehicles-idvs
Are you sure you want to change the base?
Conversation
- Add production test suite with smoke tests against live API - Add test_production.py script for running production smoke tests - Add pr_review.py script for PR validation (smoke, quick, full, production modes) - Add production test marker to pytest configuration - Update integration tests with cursor pagination support - Add VCR cassettes for production and integration tests - Update scripts README with documentation for new scripts - Update .gitignore to exclude .cursor directory - Minor improvements to client and models for test compatibility
- Add production_client fixture and error handling decorators to conftest.py - Add test_list_idvs_basic and test_get_idv for IDV endpoints - Add test_list_vehicles_basic and test_get_vehicle for vehicle endpoints - All tests follow existing smoke test patterns with proper validation
scripts/pr_review.py
Outdated
| check=False, | ||
| ) | ||
| if result.returncode == 0: | ||
| current_branch = result.stdout.strip() |
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.
Fixed: Removed unused current_branch variable assignment. The function now directly calls get_pr_info_from_gh_cli(None) without storing the branch name.
tests/production/conftest.py
Outdated
| """ | ||
|
|
||
| @wraps(func) | ||
| def wrapper(*args, **kwargs): |
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.
Fixed: Added explicit return statement after pytest.skip() in handle_auth_error wrapper to make control flow explicit. Also added proper type annotations.
tests/production/conftest.py
Outdated
| """ | ||
|
|
||
| @wraps(func) | ||
| def wrapper(*args, **kwargs): |
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.
Fixed: Added explicit return statement after pytest.skip() in handle_rate_limit wrapper to make control flow explicit. Also added proper type annotations.
scripts/pr_review.py
Outdated
| url=pr.get("html_url"), | ||
| state=pr.get("state"), | ||
| ) | ||
| except Exception: |
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.
Fixed: Added diagnostic logging to the empty except clause. Now prints a warning to stderr when reading/parsing the GitHub event file fails, while maintaining the same fallback behavior.
| ) | ||
| except (json.JSONDecodeError, KeyError): | ||
| pass | ||
| except FileNotFoundError: |
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.
Fixed: Added comment explaining that FileNotFoundError is expected when gh CLI is not available. This is intentional fallback behavior.
scripts/pr_review.py
Outdated
| pass | ||
| except FileNotFoundError: | ||
| pass | ||
| except Exception: |
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.
Fixed: Added diagnostic logging to the empty except clause. Now prints a warning to stderr when getting PR info from gh CLI fails, while maintaining the same fallback behavior.
scripts/pr_review.py
Outdated
| current_branch = result.stdout.strip() | ||
| # Try to get PR info for this branch | ||
| return get_pr_info_from_gh_cli(None) | ||
| except Exception: |
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.
Fixed: Added diagnostic logging to the empty except clause. Now prints a warning to stderr when detecting PR from branch fails, while maintaining the same fallback behavior.
- Remove unused current_branch variable in detect_pr_from_branch - Add explicit return statements after pytest.skip() in decorators - Add diagnostic logging to empty except clauses - Add type annotations to production test fixtures and decorators
This PR adds comprehensive support for Vehicles and IDV endpoints, including implementation, integration tests, production smoke tests, and development tooling.
Core Features
Vehicles and IDV Endpoints
list_vehicles()andget_vehicle()methods for Vehicles endpointslist_idvs(),get_idv(), andget_idv_summary()methods for IDV endpointsShapeConfigwith default shapes for IDVs and vehiclestango/shapes/explicit_schemas.pyIntegration Tests
tests/integration/test_vehicles_idvs_integration.pywith full test coverageProduction Smoke Tests
tests/production/directory with production API smoke testsproduction_clientfixture and error handling decoratorsDevelopment Tooling
scripts/pr_review.py- PR validation script with multiple modes:smoke: Production API smoke tests onlyquick: Linting + type checking (no tests)full: All checks (linting + type checking + all tests)production: Production API smoke tests + linting + type checkingCode Quality Improvements
detect_pr_from_branch()pytest.skip()in decoratorsDocumentation
docs/API_REFERENCE.mdwith Vehicles and IDV endpoint documentationscripts/README.mdwith PR review script usageCHANGELOG.mdwith new featuresTesting
test_client.pyto integration test suiteRelated to PR #7 (Vehicles endpoints).