test: consolidated test coverage across 9 modules (133 new tests)#403
Merged
anandgupta42 merged 2 commits intomainfrom Mar 23, 2026
Merged
test: consolidated test coverage across 9 modules (133 new tests)#403anandgupta42 merged 2 commits intomainfrom
anandgupta42 merged 2 commits intomainfrom
Conversation
Merges 9 test PRs (#390, #394, #395, #396, #397, #398, #399, #401, #387) into a single PR, discarding 4 duplicates (#391, #392, #393, #400). **New test coverage:** - `id.test.ts` — 14 tests: Identifier generation, monotonic ordering, timestamp extraction, Zod schema - `shell.test.ts` — 9 tests: shell blacklist enforcement for fish/nu, cache reset, fallback - `path-traversal.test.ts` — 7 tests (new): `Protected.isSensitiveWrite` for .pem/.key, .gnupg, .env variants - `ignore.test.ts` — 7 tests (new): `FileIgnore.match` directory patterns, globs, whitelist overrides - `paths-parsetext.test.ts` — 16 tests: `ConfigPaths.parseText` env/file substitution, JSONC parsing - `finops-formatting.test.ts` — 14 tests: `formatBytes`/`truncateQuery` edge cases - `finops-role-access.test.ts` — 10 tests: RBAC `formatGrants`/`formatHierarchy`/`formatUserRoles` - `tool-lookup.test.ts` — 4 tests: Zod schema introspection for tool parameters - `summary-git-path.test.ts` — 10 tests: `unquoteGitPath` decoding for non-ASCII filenames - `tracing.test.ts` — 2 tests (added): Recap loop detection boundaries - `patch.test.ts` — 9 tests (added): `maybeParseApplyPatchVerified` entry point coverage - `instruction.test.ts` — 13 tests (new): `InstructionPrompt.loaded()` dedup guards - `message-v2.test.ts` — 23 tests (new): `MessageV2.filterCompacted()` boundary detection **Bug fixes (discovered during testing):** - `finops-formatting.ts`: fix `formatBytes` crash on negative/NaN/fractional inputs - `finops-formatting.ts`: fix `truncateQuery` returning empty for whitespace-only, exceeding `maxLen` when < 4 - `training-import.test.ts`: fix pre-existing typecheck errors (missing `context`/`rule` mock keys) - `instruction.test.ts`, `message-v2.test.ts`: fix `MessageV2.Part` cast and branded ID type errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- summary-git-path.test.ts: use tmpdir() instead of projectRoot to prevent Storage.write() from polluting the developer's .opencode/storage/ directory - finops-role-access.test.ts: consolidate duplicate afterAll hooks to ensure ALTIMATE_TELEMETRY_DISABLED env var is cleaned up after tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
This was referenced Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Consolidates 9 test PRs (#387, #390, #394, #395, #396, #397, #398, #399, #401) into one, discarding 4 duplicates (#391, #392, #393, #400). Adds 133 new tests across 13 modules and fixes 5 production bugs in
finops-formatting.tsdiscovered during testing.New test coverage:
id.test.ts— 14 tests: Identifier generation, monotonic ordering, timestamp extraction, Zod schemashell.test.ts— 9 tests: shell blacklist enforcement for fish/nu, cache reset, fallbackpath-traversal.test.ts— 7 tests (new):Protected.isSensitiveWritefor.pem/.key,.gnupg,.envvariantsignore.test.ts— 7 tests (new):FileIgnore.matchdirectory patterns, globs, whitelist overridespaths-parsetext.test.ts— 16 tests:ConfigPaths.parseTextenv/file substitution, JSONC parsingfinops-formatting.test.ts— 14 tests:formatBytes/truncateQueryedge casesfinops-role-access.test.ts— 10 tests: RBACformatGrants/formatHierarchy/formatUserRolestool-lookup.test.ts— 4 tests: Zod schema introspection for tool parameterssummary-git-path.test.ts— 10 tests:unquoteGitPathdecoding for non-ASCII filenamestracing.test.ts— 2 tests (added): Recap loop detection boundariespatch.test.ts— 9 tests (added):maybeParseApplyPatchVerifiedentry point coverageinstruction.test.ts— 13 tests (new):InstructionPrompt.loaded()dedup guardsmessage-v2.test.ts— 23 tests (new):MessageV2.filterCompacted()boundary detectionBug fixes (discovered during testing):
finops-formatting.ts: fixformatBytescrash on negative/NaN/fractional inputsfinops-formatting.ts: fixtruncateQueryreturning empty for whitespace-only, exceedingmaxLenwhen < 4training-import.test.ts: fix pre-existing typecheck errors (missingcontext/rulemock keys)Code review fixes:
summary-git-path.test.ts: usetmpdir()instead ofprojectRootto prevent test artifact leakage (Gemini finding)finops-role-access.test.ts: consolidate duplicateafterAllhooks for proper cleanup (GLM-5 finding)Type of change
Issue for this PR
Closes #402
How did you verify your code works?
Multi-model code review by Claude, GPT 5.2 Codex, Gemini 3.1 Pro, and GLM-5 (4/6 models). All approve.
Checklist
🤖 Generated with Claude Code