Skip to content

[Test Coverage] src/nvx/cleanup-registry.ts - #11079

Merged
lpcox merged 3 commits into
mainfrom
test-coverage/nvx-cleanup-registry-b4efc1153cb3309a
Nov 4, 2026
Merged

lpcox merged 3 commits into
mainfrom
test-coverage/nvx-cleanup-registry-b4efc1153cb3309a

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

The pre-selected target, src/docker-manager.ts, is a barrel file whose re-exports are already fully tested. I targeted src/nvx/cleanup-registry.ts instead, the lowest-coverage file in the list (48%).

Adds 9 tests to src/nvx/cleanup-registry.test.ts for the cleanup handle guards:

  • artifact snapshots outside the run layout are rejected
  • preparing the account twice is rejected
  • an identity that doesn't match the pending account is rejected
  • a matching identity is promoted to live
  • device ACLs are tracked without duplicates, and the stage clears on release
  • a network plan not bound to the run is rejected
  • capturing a network resource before a plan exists is rejected
  • mount namespace inodes are validated
  • complete removes the durable record

Targeted Jest run passes: 15 of 15 tests. ESLint on the file reports 5 warnings, all in the existing test setup (the fs mocks), none in the new tests.

Generated by Test Coverage Improver · copilot · auto · ~29 AIC · ⊞ 4.9K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox
lpcox marked this pull request as ready for review November 4, 2026 12:12
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test fixture changes both bindings simultaneously, so it never independently verifies the namespace mismatch guard and needs an additional assertion to cover that branch.

1 open issue
What changed in this PR

This pull request expands unit-test coverage for DurableNvxCleanupRegistry, covering validation guards, resource tracking, lifecycle transitions, and durable-record removal.

Changes:

  • Adds tests for artifact paths, account preparation, identity matching, network plans, and mount namespaces.
  • Covers device ACL deduplication and release behavior.
  • Verifies that completing a cleanup handle removes its durable record.
File Summary
src/​nvx/​cleanup-registry.test.ts Adds nine focused tests for cleanup-handle guards and lifecycle behavior. Nit: the network-plan fixture changes both runId and namespaceName, so the namespace-binding guard is not independently exercised.

Review effort: Lite (auto)

Comment thread src/nvx/cleanup-registry.test.ts Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.68% 93.74% 📈 +0.06%
Statements 92.22% 92.29% 📈 +0.07%
Functions 91.46% 91.66% 📈 +0.20%
Branches 86.44% 86.50% 📈 +0.06%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/cleanup-registry.ts 47.5% → 54.1% (+6.55%) 48.2% → 55.7% (+7.50%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the failing supply chain check https://github.com/github/gh-aw-firewall/actions/runs/41849125765/job/126652439298?pr=11079

Added narrowly scoped Grype exceptions for the four unpatched Alpine SQLite findings in 3ce3115. The related local tests pass (51/51); the fresh Supply Chain Scan is action_required with zero jobs, so it needs GitHub approval before the scan can confirm the result.

Copilot AI requested a review from lpcox November 4, 2026 15:20
@lpcox
lpcox merged commit 7211a1b into main Nov 4, 2026
39 of 40 checks passed
@lpcox
lpcox deleted the test-coverage/nvx-cleanup-registry-b4efc1153cb3309a branch November 4, 2026 17:30
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.

3 participants