Skip to content

test(proxy): cover the by-spec open that names no platform or lease backend - #4044

Merged
thymikee merged 1 commit into
mainfrom
test/proxy-spec-no-platform-coverage
Oct 29, 2026
Merged

thymikee merged 1 commit into
mainfrom
test/proxy-spec-no-platform-coverage

Conversation

@thymikee

@thymikee thymikee commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Cover the by-spec open that names no platform or lease backend

Follow-up to #3865. It merged at 576fd1a, before this test was pushed.

Problem

CI's changed-line coverage report for #3865 listed src/cli/commands/proxy-lease-device.ts:64 as uncovered. That is the refusal for an open that names a device spec (--os, --image-tag or --physical) without --platform or --lease-backend, so the proxy backend would not know which device family to pick from.

Change

proxy-lease-device-spec.test.ts gets one test: open --os 26 through a proxy connection with no platform fails with INVALID_ARGS before any allocate or device listing. Test-only.

Validation

  • I temporarily changed the throw's error code at line 64, and the new test failed. So it reaches that line, not an earlier INVALID_ARGS.
  • All 13 tests in the file pass.
  • pnpm check:affected --run --head 2918ec1769 passed with exactCommit=true.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

…ackend

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agent-device-website Ready Ready Preview Oct 29, 2026 11:17am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.58 MB 5.58 MB 0 B
Package (unpacked) 5.58 MB 5.58 MB 0 B
Package (download) 1.70 MB 1.70 MB -20 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 33.7 ms 36.0 ms +2.3 ms
CLI --help 67.6 ms 69.3 ms +1.7 ms

@thymikee

Copy link
Copy Markdown
Member Author

The code looks good at 2918ec1. The new test covers the by-spec open that names no platform or lease backend, and from reading the code it would fail if the refusal were removed. CI is green, with all 18 checks passing, and there are no conflicts. I did not run the test or a mutation that removes the refusal, and I only read connection-runtime.ts around lines 335-349 for other INVALID_ARGS throws on this route.

Not blocking: the matcher at https://github.com/callstack/agent-device/blob/2918ec1/src/cli/commands/__tests__/proxy-lease-device-spec.test.ts#L116 is only { code: 'INVALID_ARGS' }, so another INVALID_ARGS thrown earlier on this route would also pass. You can add message: /requires --platform or --lease-backend/ to pin it, or leave it as is.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 29, 2026
@thymikee
thymikee merged commit b01e46a into main Oct 29, 2026
18 checks passed
@thymikee
thymikee deleted the test/proxy-spec-no-platform-coverage branch October 29, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant