Repository navigation
test(#19): unit tests for pure logic (config merge/validate, manifest diff, disk math, VRage signing) - #59
Conversation
…space math, VRage signing Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 58 minutes and 32 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ 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 |
There was a problem hiding this comment.
Pull request overview
Adds Pester unit coverage for several deterministic/pure-logic components in SEBackup (config validation + deep-merge semantics, manifest build/diff logic, disk-space accounting, and VRage request signing/wiring) while keeping network/remoting boundaries mocked.
Changes:
- Adds request-signing and request-wiring unit tests for
Invoke-SEBVRageRequest(with HTTP mocked) and additional deterministic checks forNew-SEBVRageAuthHeaders. - Adds unit tests for
Get-SEBDiskSpacecovering sentinel-1behavior, local-drive math, and remote-query failure isolation (remote mocked). - Adds unit tests for manifest build/diff (
New-SEBManifest,Compare-SEBManifest) and config merge/validation (Merge-ConfigOverrides,Test-SEBConfig).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/VRageAPI/Invoke-SEBVRageRequest.Signing.Tests.ps1 | Auth-header/signature binding and HTTP wiring tests for VRage request path normalization + failure behavior (mocked). |
| Tests/MetricsCollector/Get-SEBDiskSpace.Tests.ps1 | Disk free/total accounting tests, including -1 sentinel handling and remote-failure isolation (remote mocked). |
| Tests/ManifestManager/New-SEBManifest.Tests.ps1 | Manifest metadata + deleted-file detection tests with the remote scan mocked. |
| Tests/ManifestManager/Compare-SEBManifest.Tests.ps1 | Pure diff classification/counting tests for current vs previous manifests. |
| Tests/ConfigManager/Test-SEBConfig.Validation.Tests.ps1 | Global/node/instance validation matrix coverage for types/ranges/missing keys and clean file-not-found handling. |
| Tests/ConfigManager/Merge-ConfigOverrides.Tests.ps1 | Deep-merge semantics tests (recursive merge, type mismatches, null/array behavior, non-destructive inputs). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Issue #19 -- unit coverage for the request-signing / auth-header ASSEMBLY in Invoke-SEBVRageRequest. | ||
| # New-SEBVRageAuthHeaders.Tests.ps1 already pins the HMAC math (Base64-decoded key, canonical | ||
| # message, pinned known-answer signature, URI binding). This file pins how the CALLER wires that | ||
| # signature into an HTTP request, with the network boundary (Invoke-RestMethod) mocked so no live | ||
| # Torch server is touched: | ||
| # * the endpoint is normalized to the canonical '/vrageremote/v1/...' path WITHOUT double-prefixing; |
…ill vacuous [long]/port assertions; share New-FileEntry (review) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| # Issue #19 -- edge-case validation coverage for Test-SEBConfig beyond the Issue #14 instance-schema | ||
| # tests in Get-SEBInstanceConfig.Tests.ps1. Those pin the instance contract; this file pins the | ||
| # GLOBAL and NODE validators and a handful of cross-cutting type/range checks: | ||
| # * missing required sections/keys at each level produce ERRORS (IsValid = $false); | ||
| # * wrong scalar TYPES (string where int expected, etc.) produce ERRORS; |
|
Note on #19 acceptance: |
Implements #19 — unit tests for pure/deterministic logic. 91 new tests; full suite 900 → 988; build.ps1 BUILD OK.
Coverage before → after
What's tested (pure in/out where possible; only true boundaries mocked)
files) + full/incremental metadata (chain_id continuity, seq, parent_manifest from_source_filename).-1sentinels, node-failure isolation (mocked remote query).$nullon bad key / HTTP failure.The live-Torch field-order verification is left as a
-Tag 'Integration' -Skipplaceholder (issue #29) — no live calls attempted; that lands with the Torch harness.Closes #19.
🤖 Generated with Claude Code