Repository navigation
test(devicetree): cover summary counts, node paging, and property selection in devicetree views - #7305
test(devicetree): cover summary counts, node paging, and property selection in devicetree views#7305saiyam-jain-dev wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[Low impact] The PR's effects stay within Devicetree view test coverage. The tests match the projection behavior, but the required error-preservation change should be made before merging. Findings
Fix with agent prompt### Issue 1
src/domain/analysisView/devicetreeView.test.ts:165-166
The successful-view tests replace returned errors with generic messages, making failures harder to diagnose. `AGENTS.md` requires test changes to follow `docs/testing.md`, which says to throw the typed error before asserting a successful `Result`.
Use `if (!result.ok) throw result.error`, then check `kind` separately. Apply this to the other successful-view tests too. This repository requirement must be satisfied before merging.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds dedicated tests for Devicetree views.
Source review found no new security issue. Tests were not rerun. PR supersession could not be checked because GitHub access required authentication. Reviews (3) · Last reviewed commit: "test(devicetree): cover subsequent page ..." · Reviewed by Greptile |
f900571 to
0b7f6f5
Compare
| if (!result.ok || result.value.kind !== "devicetree") | ||
| throw new Error("Devicetree nodes page failed"); |
There was a problem hiding this comment.
Tests hide returned error details
The successful-view tests replace returned errors with generic messages, making failures harder to diagnose. AGENTS.md requires test changes to follow docs/testing.md, which says to throw the typed error before asserting a successful Result.
Use if (!result.ok) throw result.error, then check kind separately. Apply this to the other successful-view tests too. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/analysisView/devicetreeView.test.ts
Line: 165-166
Comment:
**Tests hide returned error details**
The successful-view tests replace returned errors with generic messages, making failures harder to diagnose. `AGENTS.md` requires test changes to follow `docs/testing.md`, which says to throw the typed error before asserting a successful `Result`.
Use `if (!result.ok) throw result.error`, then check `kind` separately. Apply this to the other successful-view tests too. This repository requirement must be satisfied before merging.
**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
TL;DR: I ran the new
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/analysisView/devicetreeView.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
Summary
Adds comprehensive unit tests in
src/domain/analysisView/devicetreeView.test.tscovering Devicetree analysis view projections, including summary count/reference calculations, node paging, property selection by node path, collection validation rules, and error handling for unsupported view kinds and missing node paths.Problem and expected behavior
While
projectDevicetreeViewimplements summary and paging views for Flattened Devicetree (.dtb) inspection evidence, it previously lacked a dedicated unit test suite covering its projection logic, collection validation rules (e.g. requiringpathfor properties, rejectingpathfor reservations/references, and handling nonexistent nodes), and calculated summary counters.Change and scope
src/domain/analysisView/devicetreeView.test.tsverifying:reservation_count,reference_count, andunresolved_reference_count.property_count, and assignment ofsource_index.pathpreserving original node index.pathor with an absent nodepath.source_index.pathon collections that do not support path selection.AnalysisInputError.Contribution scope fit: test-only coverage improvement within existing boundaries (not applicable).
Contract and boundary impact
src/domain/analysisView/devicetreeView.test.ts.docs/public/product-catalog.json), package, or installation impact: none.Expected effects:
Evidence and regression coverage
src/domain/analysisView/devicetreeView.test.tsFor evidence-bearing changes:
Validation performed
npx vitest run src/domain/analysisView/devicetreeView.test.ts— passed (9 passed in 35ms)npm run check:fast(turbo run typecheck lint) — passed cleanly (2/2 tasks successful in 50s)Compatibility, safety, and release
Author readiness
Human owner: @saiyam-jain-dev
Before merge
type(scope): outcome.