Skip to content

test: remove low-value error-copy and primitive schema tests - #35882

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-744-low-value-copy-suites
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-744-low-value-copy-suites

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​395 $\color{#cf222e}{\Huge{\mathbf{−}}}$​392
Prod 0 0 0 0

Remove tests that repeat error-copy catalog lookups, direct fallback guards, and primitive schema/cache behavior. Deletes nine entire suites and trims six others: 21 authored test registrations (23 expanded cases) removed.

Preserves nine substantive cases across eight suites covering plural selection, placeholder preservation, message parsing, PR/MR detail routing, and legacy provider normalization.

Validation: static enumeration and retained-body checks, formatting, lint, and reference/routing scans passed. Full PR CI will validate the change; no local runtime tests were run.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only cleanup appears safe to merge.

Summary

Removes nine test suites and trims six others without changing production code.

  • Renderer error tests drop repeated translation and fallback checks.
  • RPC primitive tests no longer cover schema reuse and parsing.

OrcaWin explicitly describes catalog checks, direct fallback guards, and primitive schema/cache tests as intentional removals.

Reviews (1) · Last reviewed commit: "test: remove low-value error-copy and pr..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change removes tests for renderer error messages, translations, and fallbacks, and removes tests for RPC parameter schema behavior. Two remaining renderer test files have updated imports. These changes affect test coverage; the supplied summaries do not identify runtime behavior changes.

Priority: Low

Merge Risk: Low · up to 7eadf

The PR does not change runtime behavior, but restoring these focused tests would prevent future presentation and RPC schema regressions from going unnoticed.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the test removals and validation performed, but it omits most required template sections, including ELI5, Why, Linked Issue, Visual Proof, Testing checkboxes, AI Disclosure, R… Complete the required template sections. Add an actual linked issue under “Fixes #”, provide the required visual-proof statement such as “N/A” with a reason, document testing and platform coverage, complete the applicable checkboxes, and in…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing low-value error-copy and primitive schema tests.
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 with cyclomatic complexity of at least 2. Documentat…
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 with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description explains the test removals and validation performed, but it omits most required template sections, including ELI5, Why, Linked Issue, Visual Proof, Testing checkboxes, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist.

Resolution

Complete the required template sections. Add an actual linked issue under “Fixes #”, provide the required visual-proof statement such as “N/A” with a reason, document testing and platform coverage, complete the applicable checkboxes, and include the required rationale and compatibility notes.

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/components/automations/automation-run-error-copy.ts: 1

90-97: Trivial · Maintainability & Code Quality · Quick win

Restore the deleted component error-copy suites.

automationRunErrorText remains reachable from three production components, but automation-run-error-copy.test.ts was deleted. No retained test calls this helper or detects its known-code localization, uncoded, unknown, incomplete, or null-error branches. The same coverage gap exists in the other eight deleted component suites.

Suggested fix
diff --git a/src/renderer/src/components/automations/automation-run-error-copy.test.ts b/src/renderer/src/components/automations/automation-run-error-copy.test.ts
new file mode 100644
--- /dev/null
+++ b/src/renderer/src/components/automations/automation-run-error-copy.test.ts
@@
+import { afterEach, describe, expect, it } from 'vitest'
+import { i18n } from '@/i18n/i18n'
+import es from '@/i18n/locales/es.json'
+import { automationRunFailure } from '../../../../shared/automation-run-failure-copy'
+import { automationRunErrorText } from './automation-run-error-copy'
+
+const originalLanguage = i18n.language
+
+afterEach(async () => {
+  await i18n.changeLanguage(originalLanguage)
+})
+
+describe('automationRunErrorText', () => {
+  it('localizes coded run failures, including one sentence per setup state', async () => {
+    i18n.addResourceBundle('es', 'translation', es)
+    await i18n.changeLanguage('es')
+    expect(automationRunErrorText(automationRunFailure('noDispatchHost'))).toBe(
+      es.automations.runFailures.noDispatchHost
+    )
+    expect(
+      automationRunErrorText(
+        automationRunFailure('projectSetupNotReady', { setupState: 'setting-up' })
+      )
+    ).toBe(es.automations.runFailures.projectSetupState.settingUp)
+  })
+
+  it('shows the stored English for uncoded, unknown, or unusable failures', async () => {
+    i18n.addResourceBundle('es', 'translation', es)
+    await i18n.changeLanguage('es')
+    expect(automationRunErrorText({ error: 'Old record text' })).toBe('Old record text')
+    expect(automationRunErrorText({ error: 'Newer host', errorCode: 'futureCode' })).toBe(
+      'Newer host'
+    )
+    expect(automationRunErrorText({ error: 'English', errorCode: 'toString' })).toBe('English')
+    expect(
+      automationRunErrorText({
+        error: 'Project setup on the selected automation host is paused.',
+        errorCode: 'projectSetupNotReady',
+        errorParams: { setupState: 'paused' }
+      })
+    ).toBe('Project setup on the selected automation host is paused.')
+    expect(automationRunErrorText({ error: null, errorCode: 'noDispatchHost' })).toBeNull()
+  })
+})
src/shared/rpc-contract/rpc-param-primitives.ts: 1

62-85: Trivial · Maintainability & Code Quality · Quick win

Restore the focused primitive contract tests.

Deleting this suite removes the only direct checks that requiredNumber rejects numeric strings and that requiredStringAllowingEmpty accepts empty strings while rejecting non-strings. These schemas are used by reachable RPC methods, but retained consumer tests do not detect those regressions.

Suggested fix
+import { describe, expect, it } from 'vitest'
+import { requiredNumber, requiredString, requiredStringAllowingEmpty } from './rpc-param-primitives'
+
+describe('required RPC primitive schemas', () => {
+  it.each([requiredString, requiredStringAllowingEmpty, requiredNumber])(
+    'reuses schemas for the same message without conflating different messages',
+    (factory) => {
+      const first = factory('Missing id')
+      expect(factory('Missing id') === first).toBe(true)
+      expect(factory('Missing name') === first).toBe(false)
+    }
+  )
+
+  it('keeps each factory distinct for an identical message', () => {
+    const strict = requiredString('Missing value')
+    const empty = requiredStringAllowingEmpty('Missing value')
+    const number = requiredNumber('Missing value')
+    expect(strict.safeParse('').success).toBe(false)
+    expect(empty.parse('')).toBe('')
+    expect(empty.safeParse(1).success).toBe(false)
+    expect(number.parse(1)).toBe(1)
+    expect(number.safeParse('1').success).toBe(false)
+  })
+})

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: 29ba704c-499e-4680-99d5-23b1a7b26bb7
Commits

Reviewing files that changed from the base of the PR and between 401468b and 7eadf44.

Files selected for processing: 15
  • src/renderer/src/components/automations/automation-extra-agent-args-error-copy.test.ts
  • src/renderer/src/components/automations/automation-run-error-copy.test.ts
  • src/renderer/src/components/editor/pdf-export-error-copy.test.ts
  • src/renderer/src/components/native-chat/structured-composer-command-error-text.test.ts
  • src/renderer/src/components/plugins/presentation/plugin-error-presentation.test.ts
  • src/renderer/src/components/settings/diagnostics-bundle-error-copy.test.ts
  • src/renderer/src/components/settings/speech-model-description.test.ts
  • src/renderer/src/components/sidebar/repo-create-error-copy.test.ts
  • src/renderer/src/components/tab-bar/native-chat-naming-failure-copy.test.ts
  • src/renderer/src/lib/code-host-error-copy.test.ts
  • src/renderer/src/lib/emulator-error-copy.test.ts
  • src/renderer/src/lib/ephemeral-vm-error-copy.test.ts
  • src/renderer/src/lib/task-provider-error-copy.test.ts
  • src/renderer/src/lib/text-generation-error-copy.test.ts
  • src/shared/rpc-contract/rpc-param-primitives.test.ts
Files with no reviewable changes: 13
  • src/renderer/src/components/plugins/presentation/plugin-error-presentation.test.ts
  • src/renderer/src/components/settings/speech-model-description.test.ts
  • src/renderer/src/components/automations/automation-extra-agent-args-error-copy.test.ts
  • src/renderer/src/lib/code-host-error-copy.test.ts
  • src/renderer/src/components/settings/diagnostics-bundle-error-copy.test.ts
  • src/renderer/src/lib/text-generation-error-copy.test.ts
  • src/shared/rpc-contract/rpc-param-primitives.test.ts
  • src/renderer/src/components/tab-bar/native-chat-naming-failure-copy.test.ts
  • src/renderer/src/components/editor/pdf-export-error-copy.test.ts
  • src/renderer/src/components/sidebar/repo-create-error-copy.test.ts
  • src/renderer/src/components/automations/automation-run-error-copy.test.ts
  • src/renderer/src/components/native-chat/structured-composer-command-error-text.test.ts
  • src/renderer/src/lib/task-provider-error-copy.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.

@OrcaWin
OrcaWin merged commit 03d1e8c into main Oct 29, 2026
40 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