Fix orbit nudge test mdm connection fidelity#48423
Conversation
The non-eligible MDM status nudge test drove its two variations through IsHostConnectedToFleetMDMFunc, but GetOrbitConfig now derives the Fleet-MDM connection state from GetHostMDM().ConnectedToFleet and no longer calls IsHostConnectedToFleetMDM. That left the isHostConnectedToFleet toggle dead: both variations resolved to connected=false (GetHostMDM returned NotFound), so the 'connected but not osquery-enrolled' variation no longer exercised the osquery-enrollment gate. Drive the connection state through GetHostMDM (ConnectedToFleet) so the second variation is genuinely connected, restoring coverage of the not-osquery-enrolled gate, and drop the now-dead IsHostConnectedToFleetMDMFunc mock. Claude-Session: https://claude.ai/code/session_018vexp83A6iFZ6V53HSJAaR
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Pull request overview
This PR updates Orbit service tests to reflect the recent change where GetOrbitConfig derives “connected to Fleet MDM” from GetHostMDM().ConnectedToFleet (rather than calling IsHostConnectedToFleetMDM). This ensures the nudge config tests differentiate between MDM connectivity and osquery enrollment state.
Changes:
- Update
TestGetOrbitConfigNudgeto drive MDM connectivity viaGetHostMDMmock data (includingConnectedToFleet). - Remove the
IsHostConnectedToFleetMDMmock in the affected test section and adjust host-variation assertions accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48423 +/- ##
==========================================
+ Coverage 67.46% 67.50% +0.03%
==========================================
Files 3675 3675
Lines 233402 233533 +131
Branches 12230 12230
==========================================
+ Hits 157476 157635 +159
+ Misses 61783 61748 -35
- Partials 14143 14150 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #44629 Test fix only. Test now distinguishes between being connected to Fleet MDM and being connected but not osquery-enrolled. [ ] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **Tests** * Improved validation of host configuration nudge behavior by refining how Fleet MDM connection states are simulated. * Test scenarios now better cover: enrolled but not connected to Fleet MDM, and connected to Fleet MDM without enrollment. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Related issue: Resolves #44629
Test fix only. Test now distinguishes between being connected to Fleet MDM and being connected but not osquery-enrolled.
[ ] QA'd all new/changed functionality manually
Summary by CodeRabbit
Summary by CodeRabbit