Inject initFatal as a package-level var (#33370)#45343
Conversation
Replace the initFatal function with a package-level var so tests can swap it without terminating the test binary via os.Exit. Add a test for getTLSConfig's default case to exercise the new seam.
WalkthroughThis PR makes 🚥 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 unit tests (beta)
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 |
|
Hello @getvictor - Do you mind taking a look, please? Thanks! 🙏 🙇 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #45343 +/- ##
==========================================
- Coverage 66.81% 66.70% -0.12%
==========================================
Files 2724 2728 +4
Lines 219027 218328 -699
Branches 10590 10590
==========================================
- Hits 146342 145631 -711
+ Misses 59521 59483 -38
- Partials 13164 13214 +50
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:
|
Second PR in the staged plan from #33370. Per @getvictor's confirmation, takes the package-level var approach so tests can swap
initFatalwithout terminating the test binary.The new
TestGetTLSConfigInvalidProfilecoversgetTLSConfig's default case (previously unreachable in tests because it callsinitFatal)Related issue: Part of #33370.
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Testing
Database migrations
N/A — no database migrations in this PR.
New Fleet configuration settings
N/A — no new configuration settings.
fleetd/orbit/Fleet Desktop
N/A — no agent code changes.
Summary by CodeRabbit