Skip to content

(janitor/test-prune): remove tautological triage-service test file - #5845

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
kilo/cheerful-fable-405
Open

(janitor/test-prune): remove tautological triage-service test file#5845
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
kilo/cheerful-fable-405

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Deletes apps/web/src/lib/security-agent/services/triage-service.test.ts (236 lines, 12 tests). The file imports only @jest/globals and never imports or calls any code from triage-service.ts (or any other production module). Every assertion targets a value constructed locally in the same test — either the createMockFinding() factory's own defaults or an inline object literal.

Why these tests cannot detect a regression

  • No production behavior is exercised. There are no imports of buildTriagePrompt, extractJsonContent, parseTriageResult, createFallbackTriage, or triageSecurityFinding, which are the actual functions in triage-service.ts. Changing or breaking any of them cannot affect these tests.
  • Assertions are tautological. Examples: expect(finding.package_name).toBe('lodash') where createMockFinding() sets package_name: 'lodash'; expect(parseFloat('9.8')).toBeGreaterThan(9); expect(Array.isArray(['CWE-1321'])).toContain('CWE-1321'). Each passes by construction, independent of any repository code.
  • The file's header comment claims it tests "helper functions and parsing logic", but no such functions are referenced anywhere in the body.

Surviving coverage

No behavioral coverage is lost, because none existed. Relevant triage logic that is genuinely tested elsewhere:

  • Worker-side triageSecurityFinding and its fallback/parsing paths: services/security-auto-analysis/src/triage.test.ts.
  • Web-side triageSecurityFinding as a mocked collaborator: apps/web/src/lib/security-agent/services/analysis-service.test.ts and analysis-service.token-source.test.ts.

Validation

  • oxlint on apps/web/src/lib/security-agent/services: 0 warnings, 0 errors.
  • Confirmed no remaining references to the deleted test file.
  • Could not run the Jest suite: the repository's Jest global setup (workerSetup.ts) requires a PostgreSQL connection (cleanupDbForTest), which is unavailable in this environment. The failure was at DB setup, not at test assertions.

The file imports only @jest/globals and asserts on locally-constructed
fixtures, never on triage-service.ts. No production regression can make
any of its 12 assertions fail.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 3, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • apps/web/src/lib/security-agent/services/triage-service.test.ts

Reviewed by grok-4.6 · Input: 34.5K · Output: 5.8K · Cached: 388.4K

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants