fix(tests): green warp-app on linux/macOS/windows#164
Merged
Conversation
Eight failing tests in the warp-app suite split into three categories: Brand & rebrand drift — assertions still pinned to upstream "Warp" copy after the CastCodes rebrand. - context_chips: format_git_branch error string updated to "CastCodes". - settings_view::environments_page: section-header copy now expects "SHARED BY CASTCODES AND ...". Cross-platform path handling — Linux/Windows tests broke on Unix-style literals. - ai::blocklist::handoff::touched_repos: swap `/repo` and `/repo/subdir` literals for a `cfg(windows)`-aware constant so `Path::is_absolute()` holds on every OS. - lib launch_mode: gate `castcodes_app_bundle_executable_launches_gui` to `cfg(target_os = "macos")`; the bundle-detection branch it exercises is macOS-only (stub on Linux/Windows). Drift from production-code changes (OSS/fork-local + harness gating). - ai::blocklist::action_model::execute::start_agent: use "claude" so the local-harness child parses successfully and the test reaches the OrchestrationV2 gate it claims to exercise (the prior "codex" identifier no longer parses as a valid local-harness child). - drive::import: refresh the `expand_dirs` snapshot to include the three test-data fixtures added since the test was last touched (tweakcn_sample_dark, tweakcn_sample_light, ui_block_theme). - pane_group::test_start_shared_session_from_modal: temporarily override the channel to `Stable` for the duration of the test, since `open_share_session_modal` now early-returns on OSS channels where cloud services are unavailable. Adds a `#[cfg(feature = "test-util")]` `ChannelState::override_channel_for_test` RAII guard in warp_core for this; the production fork-local gate is preserved. - auth::auth_manager::initialize_user_from_auth_payload: run CSRF state validation before the hosted-auth-disabled bail. The `should_silently_ignore_stale_redirect` and `InvalidStateParameter` paths are channel-agnostic — surfacing an invalid-state error from a redirect that smuggled in a mismatched token is still correct in the OSS build, and never touches the hosted backend. This restores `test_stale_state_when_logged_out_emits_invalid_state_parameter` and `test_mismatched_state_with_different_user_uid_emits_invalid_state_parameter`. Verification: `cargo nextest run -p warp-app --no-fail-fast` → 4212 passed, 1 pre-existing failure (`settings::init::tests::test_migration_does_not_rerun_when_marker_present`, which reads `~/.cast-codes/settings.toml` from the real home dir and fails on any machine that has used CastCodes — reproduces on `main` unchanged). `cargo fmt --check` clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes 8 failing tests across the
warp-appsuite. Failures split into three categories:1. Brand / rebrand drift
Assertions still pinned to upstream "Warp" copy after the CastCodes rebrand.
context_chips::display_chip::tests::test_format_git_branch_command_reports_missing_linked_worktree_path— error string now expectsCastCodesinstead ofWarp.settings_view::environments_page::tests::test_render_list_page_with_personal_and_team_environments_shows_section_headers— section header expectsSHARED BY CASTCODES AND ....2. Cross-platform path / OS gates
ai::blocklist::handoff::touched_repos::tests—/repoand/repo/subdirare not absolute on Windows, soPath::is_absolute()rejected them and the touched-path collector dropped the cwd entry. Swap the literals for acfg(windows)-awareREPO_ROOT/REPO_SUBDIRconstant (C:\repoon Windows,/repoelsewhere).launch_mode_tests::castcodes_app_bundle_executable_launches_gui— the bundle-detection branch this test exercises (is_macos_app_bundle_executable) is macOS-only; on Linux/Windows it returnsfalseandshould_run_as_clifalls through, breaking the assertion. Gated with#[cfg(target_os = "macos")].3. Drift from production-code changes (OSS / fork-local guards + harness gating)
ai::blocklist::action_model::execute::start_agent::tests::execute_returns_error_when_local_harness_child_requires_orchestration_v2—"codex"no longer parses as a valid local-harness child, so parsing failed before the test could reach the OrchestrationV2 gate. Switched to"claude"so parsing succeeds.drive::import::modal_body::import_tests::test_expand_directories— three new theme fixtures (tweakcn_sample_dark.yaml,tweakcn_sample_light.yaml,ui_block_theme.yaml) were added tocrates/integration/tests/data/. Updated the snapshot to include them.pane_group::tests::test_start_shared_session_from_modal—open_share_session_modalnow early-returns whencloud_services_available()isfalse, which is the case on the default OSS channel used in unit-test builds. Added a#[cfg(feature = "test-util")]RAII guardChannelState::override_channel_for_test(Channel)inwarp_coreand used it to flip the test into a hosted channel for its duration. The production OSS fork-local gate is preserved.auth::auth_manager::auth_manager_test::test_stale_state_when_logged_out_emits_invalid_state_parameterandtest_mismatched_state_with_different_user_uid_emits_invalid_state_parameter—initialize_user_from_auth_payloadwas bailing onhosted_auth_disabledbefore running CSRF state validation, so theInvalidStateParameterevent the tests assert on never fired in OSS builds. Reordered: CSRF state validation runs first (it consumes a locally-generated pending-state token and never touches the hosted backend, so it's safe to run regardless of channel), then the hosted-auth-disabled bail happens before anyauth_clientinteraction.Test plan
cargo nextest run -p warp-app --no-fail-fast— 4212 passed, 7 skipped, 1 pre-existing failure:settings::init::tests::test_migration_does_not_rerun_when_marker_present. This test reads~/.cast-codes/settings.tomldirectly from the real home dir (not sandboxed) and fails on any machine that has actually used CastCodes. Reproduces onmainunchanged — out of scope for this PR.cargo fmt --checkclean.clippy::unnecessary_unwrapincrates/warpui_core/src/elements/hoverable.rs:661(also onmain, also out of scope).🤖 Generated with Claude Code