Skip to content

Conversation

@ivanauth
Copy link
Contributor

This PR makes the backup creation code easier to test by extracting dependencies.

Changes

  • Extract backupCreateImpl that accepts a client and progress tracker as dependencies
  • Add ProgressTracker interface to separate progress file logic from backup logic
  • Now possible to test edge cases like PermissionDenied without spinning up a full server

Also fixes a time.Tick goroutine leak along the way.

Resolves #569

Resolves authzed#569

Signed-off-by: ivanauth <ivan@authzed.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 64.13043% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.18%. Comparing base (7ed5ab0) to head (8437759).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/backup.go 64.13% 18 Missing and 15 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   39.28%   42.18%   +2.90%     
==========================================
  Files          37       37              
  Lines        5448     4805     -643     
==========================================
- Hits         2140     2027     -113     
+ Misses       3063     2520     -543     
- Partials      245      258      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reorganize backupCreate code and refactor tests accordingly

2 participants