Repository navigation
Mobile: add unit tests for the client_ffi conversion layer - #140
Open
katulevskiy wants to merge 3 commits into
Open
katulevskiy wants to merge 3 commits into
katulevskiy wants to merge 3 commits into
Conversation
client_ffi is the only place UniFFI types become zeron-client types, and it had no tests, so a swapped field or a dropped enum arm surfaced only on a device. Add 51 offline unit tests covering: - ChatConfig / NewSession round trips, every sandbox level, and every harness and effort id (exhaustive matches force an update when proto grows a variant) - unknown harness or reasoning ids returning InvalidArgument instead of panicking, and unknown model ids passing through - picker catalog ids (fallback harnesses/models/levels) being accepted by the ChatConfig conversion - SendRequest, attachment bytes at and over the 24 MB limit, queue edit lease, ComposerState (per-capability flags, queue gates, pending sends) - old/new engine catalog JSON (missing or unknown fields) decoding into HarnessInfo / ModelInfo, and SessionRow/WorkspaceSnapshot/event mapping Tests only; production files gain a `#[cfg(test)] mod tests;` line each.
Source: zeronsh#625 Source revision: a25c3c8
Contribution Managerneeds triage · medium risk · untriaged Open review workspace · Revision Next actions:
This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge PRs. |
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.
Upstream mirror
Source: zeronsh#625
Original author: @katulevskiy
Original revision:
a25c3c826a2f5010a5bd97b73b8e275464ddd775This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty
[skip ci]commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.Summary
crates/mobile/src/client_fficonverts UniFFI types to and fromzeron-clienttypes and had no tests, so a swapped field or a missing enum arm would only show up on a device. This adds 51 offline unit tests.ChatConfig/NewSessionround trips and every sandbox level; every harness and effort id (exhaustive matches, so adding a proto variant breaks the build until it is handled); unknown harness or effort ids returningInvalidArgumentwhile unknown model ids pass through; fallback catalog ids being accepted by theChatConfigconversion;SendRequest, attachment bytes at and over the 24 MiB limit, the queue edit lease andComposerState; old and newer engine catalog JSON decoding;SessionRow,WorkspaceSnapshotand event mapping.#[cfg(test)] mod tests;line.model_optionsbecome strings when aChatConfiground-trips through the phone (truebecomes"true"), andfallback_modelsfor an unknown harness returns the default harness's model list rather than an empty one.