Skip to content

chore(sessions): add integration tests for client create session loadout flow - #548

Merged
evanspearman merged 1 commit into
mainfrom
evan/split04
Jun 23, 2026
Merged

chore(sessions): add integration tests for client create session loadout flow#548
evanspearman merged 1 commit into
mainfrom
evan/split04

Conversation

@evanspearman

@evanspearman evanspearman commented Jun 23, 2026

Copy link
Copy Markdown
Member

Integration tests for the client loadout flow from the point of deserializing loadout toml to the wire forms used to request session creation with the daemon. These tests only test the client side and do not test the daemon.

Summary by CodeRabbit

  • Tests
    • Added comprehensive integration tests for the session creation workflow, validating data integrity through configuration composition, variable inheritance, policy enforcement, and serialization scenarios.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds crates/sessions/tests/client_flow1.rs, a new integration test file with 517 lines. It tests the UserComposer → WireContribution → SessionCreateRequest pipeline, covering provenance tagging, variable inheritance, patch ~/ expansion, glob fan-out, VarsPolicy/PatchPolicy filtering and denial, and JSON round-trip serialization.

Changes

Client flow 1 integration tests

Layer / File(s) Summary
Test helpers and module setup
crates/sessions/tests/client_flow1.rs
Adds module-level doc comment, imports, and three shared helpers: pinned_env (fixed env table), fixture_tree (on-disk directory scaffolding), and assert_paths_equivalent (canonical path comparison).
Happy-path composition and per-item provenance
crates/sessions/tests/client_flow1.rs
happy_path_one_of_each asserts a single-loadout composition produces correct counts and UserLoadout provenance; multiple_loadouts_preserve_per_item_provenance verifies two loadouts each tag their vars with the correct originating loadout name.
Variable inheritance and default fallback
crates/sessions/tests/client_flow1.rs
inherit_uses_env_value asserts inherit = true resolves from pinned env; inherit_with_default_falls_back_when_env_missing asserts the default value is used when the variable is absent from env.
Patch path expansion and glob fan-out
crates/sessions/tests/client_flow1.rs
tilde_patch_source_expands_against_env_home verifies ~/... expands to the correct absolute path; multi_file_patch_fans_out verifies a glob source produces deterministically ordered destination-relative wire patches.
Policy filtering and denial
crates/sessions/tests/client_flow1.rs
ignore_filters_user_var, ignore_filters_user_patch, deny_rejects_user_patch, and deny_rejects_user_var cover VarsPolicy/PatchPolicy ignore-dropping and deny-producing ComposeError::Denied with the correct path/name and Source::UserLoadout origin.
SessionCreateRequest JSON round-trip
crates/sessions/tests/client_flow1.rs
session_create_request_round_trips_through_json serializes a composed SessionCreateRequest to JSON, deserializes it back, and asserts key field counts are preserved.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • gominimal/minimal#443: Introduced the SessionCreateRequest, wire request types, and primitives (WireContribution, WireSource, Source) that the new client_flow1 integration tests directly exercise and serialize through JSON.

Poem

🐇 A loadout walks in, TOML in paw,
Through composer and wire without a flaw.
HOME expands, globs fan out with glee,
Denied paths error — just as should be!
JSON round-trips back without a care,
The rabbit hops on, tests pass everywhere. 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding integration tests for the client-side session creation loadout flow in the sessions module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@gominimal-aw-bot

Copy link
Copy Markdown
Contributor

This pull request has no accompanying spec. Comment /derive-spec to have one derived retrospectively from the code — it opens a separate spec/<slug> documentation PR with demoable units, acceptance criteria, and a gap analysis (implementation gaps, missing failure paths, weak acceptance criteria). Ignore this to defer; the weekly unspecced-PR scan will re-surface it. See ADR 0027.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/sessions/tests/client_flow1.rs`:
- Line 503: The hardcoded path "/repo" used in the project_path field is
Unix-only and will fail on Windows systems. Replace this hardcoded Unix absolute
path with the tempdir root that is already available in the test context, which
is platform-agnostic and will work correctly across all operating systems.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23976aa8-9809-48fb-b9d5-a9a8e90690ee

📥 Commits

Reviewing files that changed from the base of the PR and between 141ba07 and eef619b.

📒 Files selected for processing (1)
  • crates/sessions/tests/client_flow1.rs

Comment thread crates/sessions/tests/client_flow1.rs
@evanspearman
evanspearman merged commit 4f71a88 into main Jun 23, 2026
161 checks passed
@evanspearman
evanspearman deleted the evan/split04 branch June 23, 2026 21:25
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.

2 participants