Conversation
VCR now defaults to playback-only (record_mode="none"). Tests will never fall through to the real API, even if env vars leak. Recording requires explicitly setting GARTH_RECORD_CASSETTES=true. - Replace GARTH_HOME-based VCR mode with GARTH_RECORD_CASSETTES - Autouse _clean_env fixture clears GARTH_HOME, GARTH_TOKEN, and disables telemetry for all tests - Use GARTH_RECORD_CASSETTES_HOME for authed_client token loading - Document recording workflow in CLAUDE.md Closes #202 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughRenames and expands the autouse test fixture to clear GARTH_HOME and GARTH_TOKEN, makes VCR playback-only unless GARTH_RECORD_CASSETTES=true, adjusts authed_client/loading for cassette recording, removes an unused logging setup from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #208 +/- ##
==========================================
- Coverage 99.97% 99.97% -0.01%
==========================================
Files 68 68
Lines 3556 3555 -1
==========================================
- Hits 3555 3554 -1
Misses 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/conftest.py`:
- Around line 79-83: The code uses garth_home unconditionally when the
GARTH_RECORD_CASSETTES_HOME env var is set, which can alter test behavior even
when recording is disabled; change the branch so client.load(garth_home) only
runs when both garth_home is set AND recording mode is enabled, otherwise fall
back to client.configure(...). Implement the recording check by using the
existing test recording flag (preferably the project's pytest/fixture flag) or
by checking a dedicated env var (e.g., a boolean like GARTH_RECORDING_ENABLED)
and update the block around garth_home, client.load, and client.configure
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0404dfc4-e7e2-49cd-a2a6-fd552078f88f
📒 Files selected for processing (3)
CLAUDE.mdsrc/garth/http.pytests/conftest.py
💤 Files with no reviewable changes (1)
- src/garth/http.py
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
VCR now defaults to playback-only (
record_mode="none"). Tests will never fall through to the real Garmin API, even if env vars leak from the runner environment.Previously, VCR switched to recording mode based on whether
GARTH_HOMEwas set, which caused intermittent CI failures when VCR couldn't match a cassette and hit the real API (returning 401).Changes
GARTH_HOME-based VCR mode with explicitGARTH_RECORD_CASSETTES=true_clean_envfixture clearsGARTH_HOME,GARTH_TOKEN, and disables telemetry for all testsGARTH_RECORD_CASSETTES_HOMEforauthed_clienttoken loading during recordingloggerfrom http.pyTest plan
Closes #202
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Tests
Chores