Skip to content

test: remove 18 low-value runtime file and Jira tests - #34436

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-602-runtime-file-jira
Oct 27, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-602-runtime-file-jira

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​485 $\color{#cf222e}{\Huge{\mathbf{−}}}$​484
Prod 0 0 0 0

Remove 18 low-value tests from the runtime file and Jira detail suites. These cases echo supplied mock results, inventory wrapper arguments, or replay path normalization already covered directly.

Keep the cases that exercise SSH/remote ownership rejection, host-grant routing, truncated-read safety, typed binary fallback, attachment-store routing, legacy Jira migration and permission-safe fallback. Production code is unchanged.

Audit scope: four suites, 45 authored test registrations; 18 removed and 27 retained. The image-cache and pending-status-publication suites were reviewed and kept unchanged for their concurrency, resource limits, cancellation, stale-status and cache replacement behavior.

Validation: isolated formatting, lint, syntax, retained callback preservation, test discovery, and reliability/baseline reference checks passed. Runtime validation runs in PR CI; no local apps or test runtimes were launched.

@OrcaWin
OrcaWin force-pushed the test-audit-602-runtime-file-jira branch from 4a3383c to 052207d Compare October 27, 2026 14:47
@OrcaWin OrcaWin changed the title test: remove 19 low-value runtime file and Jira tests test: remove 18 low-value runtime file and Jira tests Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7cf52f1d-0ce0-4eba-8a67-337c7c96e250
Commits

Reviewing files that changed from the base of the PR and between 4a3383c and 052207d.

Files selected for processing: 1
  • src/renderer/src/runtime/runtime-file-client.test.ts
Files with no reviewable changes: 1
  • src/renderer/src/runtime/runtime-file-client.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The changes remove runtime file-client tests for mutations, read and directory routing, preview fallback, and WSL wake behavior. They also remove Jira detail image tests for local IPC and remote short-reference reads, along with related test setup.

Priority: Low

Merge Risk: Minimal · up to 05220

No actionable merge-blocking issue is established; merge after normal CI checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the main change, rationale, retained coverage, scope, and validation. It does not include the required Linked Issue, Visual Proof statement, checklist status, review notes, or… Add the required template sections and complete them. Include an actual issue link after "Fixes #", state "N/A" with a reason for Visual Proof because this is a test-only change, complete the Testing and Checklist items, provide Review and …
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the removal of 18 low-value tests from the runtime file and Jira suites.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description explains the main change, rationale, retained coverage, scope, and validation. It does not include the required Linked Issue, Visual Proof statement, checklist status, review notes, or AI disclosure information.

Resolution

Add the required template sections and complete them. Include an actual issue link after "Fixes #", state "N/A" with a reason for Visual Proof because this is a test-only change, complete the Testing and Checklist items, provide Review and Notes content, and include AI Disclosure details when applicable.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Nitpick comments: 2
src/renderer/src/runtime/runtime-file-client.test.ts: 1

41-46: Trivial · Functional Correctness · Quick win

Retain direct-boundary assertions for write and rename.

The deleted test was the only direct window.api.fs test that checked SSH target and connection generation for writeRuntimeFile and renameRuntimePath. The delete path still has equivalent coverage in remote-host-file-delete-repro.test.ts, but the retained write and rename tests do not check these fields.

Suggested fix
+it('binds direct SSH writes and renames to the captured target and generation', async () => {
+  const context = {
+    target: { kind: 'local' as const },
+    worktreeId: 'wt-1',
+    worktreePath: '/repo',
+    connectionId: 'ssh-1',
+    expectedExecutionHostId: 'ssh:ssh-1' as const,
+    expectedSshTargetId: 'ssh-1',
+    expectedSshConnectionGeneration: 5
+  }
+
+  await writeRuntimeFile(context, '/repo/a.ts', 'a')
+  await renameRuntimePath(context, '/repo/a.ts', '/repo/b.ts')
+
+  expect(fsWriteFile).toHaveBeenCalledWith(expect.objectContaining({
+    expectedSshTargetId: 'ssh-1',
+    expectedSshConnectionGeneration: 5
+  }))
+  expect(fsRename).toHaveBeenCalledWith(expect.objectContaining({
+    expectedSshTargetId: 'ssh-1',
+    expectedSshConnectionGeneration: 5
+  }))
+})
src/renderer/src/runtime/runtime-jira-detail-images.test.ts: 1

47-52: Trivial · Functional Correctness · Quick win

Restore the remote short-reference read test.

The remaining tests in this file never reach the reference branch. Each one uses statusWithoutImages(), which removes JIRA_IMAGE_CAPABILITY. When that capability is absent, the client skips the mediaFormat argument and uses the stream or fallback path. When the capability is present, jiraGetIssueForTarget and jiraIssueCommentsForTarget send mediaFormat: 'reference' through a direct callRuntimeRpc. No remaining test in this file checks that call. A change that drops mediaFormat or inverts the references condition would not fail any test in this file.

Suggested fix
 const target = { kind: 'environment' as const, environmentId: 'issue-owner' }
+const image = '![shot](orca-jira-image://attachment/12345678-1234-1234-1234-123456789012)'
 const localIssue = vi.fn()
 describe('captured Jira detail owners', () => {
+  it('checks the captured remote owner capability and reads short image references there', async () => {
+    runtimeCall.mockImplementation(async (args: { method: string }) =>
+      args.method === 'status.get'
+        ? createCompatibleRuntimeStatusResponse()
+        : {
+            id: 'detail',
+            ok: true,
+            result:
+              args.method === 'jira.getIssue'
+                ? { key: 'JIR-1', description: image }
+                : [{ id: 'comment', body: image }],
+            _meta: { runtimeId: 'remote-runtime' }
+          }
+    )
+    await expect(jiraGetIssueForTarget(target, 'JIR-1', 'site')).resolves.toMatchObject({
+      description: image
+    })
+    await expect(jiraIssueCommentsForTarget(target, 'JIR-1', 'site')).resolves.toEqual([
+      { id: 'comment', body: image }
+    ])
+    for (const method of ['status.get', 'jira.getIssue', 'jira.issueComments']) {
+      expect(runtimeCall).toHaveBeenCalledWith(
+        expect.objectContaining({
+          selector: 'issue-owner',
+          method
+        })
+      )
+    }
+    expect(runtimeCall).toHaveBeenCalledWith(
+      expect.objectContaining({
+        method: 'jira.getIssue',
+        params: { key: 'JIR-1', siteId: 'site', mediaFormat: 'reference' }
+      })
+    )
+    expect(localIssue).not.toHaveBeenCalled()
+    expect(localComments).not.toHaveBeenCalled()
+    expect(runtimeSubscribe).not.toHaveBeenCalled()
+  })
+
   it('keeps old-host streams and migrated image bytes under their captured owner', async () => {

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 322e9447-1251-4ff9-b254-92d042d6ca6f
Commits

Reviewing files that changed from the base of the PR and between dc57b3d and 4a3383c.

Files selected for processing: 2
  • src/renderer/src/runtime/runtime-file-client.test.ts
  • src/renderer/src/runtime/runtime-jira-detail-images.test.ts
Files with no reviewable changes: 1
  • src/renderer/src/runtime/runtime-jira-detail-images.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@OrcaWin
OrcaWin merged commit c98a2d6 into main Oct 27, 2026
34 checks passed
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.

1 participant