test(firmware): make shared artifact resolution coverage authoritative#3976
test(firmware): make shared artifact resolution coverage authoritative#3976chet wants to merge 1 commit into
Conversation
Make the shared resolver table the owner of files[] selection, location precedence, and error coverage. Keep machine-controller coverage focused on adapter behavior and Scout path handling, then add whitespace normalization cases at the shared boundary. This supports NVIDIA#3974 Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
@coderabbitai full_review, thanks! |
|
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Summary by CodeRabbit
WalkthroughThe PR refactors firmware and machine-controller artifact resolution tests into parameterized case tables, adds shared fixture and error-comparison helpers, and preserves coverage for local, remote, legacy, missing-input, precedence, trimming, and unsafe-path scenarios. ChangesFirmware artifact test consolidation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The shared firmware resolver owns the
files[]selection and location rules, but machine-controller repeated most of those cases around a thin adapter. That split made the shared crate depend on downstream tests for complete coverage and left two test suites to keep aligned.This moves the complete resolver matrix into
carbide-firmware, keeps machine-controller focused on adapter and Scout-specific behavior, and adds explicit coverage for trimmed and blank artifact locations. Production behavior is unchanged.Related issues
This supports #3974.
Part of #3914.
Type of Change
Breaking Changes
Testing
Unit tests added/updated
Integration tests added/updated
Manual testing performed
No testing required (docs, internal refactor, etc.)
cargo test --locked --package carbide-firmware artifact_resolution --libcargo test --locked --package carbide-machine-controller firmware_artifact --libThree
cargo llvm-covcheckpoints forcarbide-firmwareandcarbide-machine-controllercargo make format-nightlycargo make clippycargo make carbide-lintsAdditional Notes
Owner-only coverage for
resolve_files_firmware_artifact:The converted table reaches full stable line and region coverage. The expanded checkpoint adds URL trimming, filename trimming, and whitespace-only location contracts without changing those already-complete counts.
Machine-controller production coverage remains 58/60 lines. The two uncovered lines are the non-UTF-8 error path behind a
&strparameter.