Skip to content

refactor: Remove all platform-specific conditional skips from tests - #6

Merged
max-sixty merged 4 commits into
mainfrom
no-skip-tests
Nov 4, 2025
Merged

refactor: Remove all platform-specific conditional skips from tests#6
max-sixty merged 4 commits into
mainfrom
no-skip-tests

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

Removes 17 conditional skips from tests that were defensive programming patterns. Tests now fail fast with clear errors instead of silently adapting to platform differences or missing dependencies.

Changes:

  • ❌ Removed 8 bash/fish availability checks (e2e_shell*.rs)
  • ❌ Removed 7 Windows/Unix shell command syntax conditionals (switch.rs, configure_shell.rs)
  • ❌ Removed 2 macOS/Linux bash config path conditionals (configure_shell.rs)
  • ✅ Kept Unix-only PermissionsExt (required for cross-platform compilation)

Alignment with development principles:

  • Fail Fast: Tests fail clearly on unsupported platforms vs graceful skipping
  • No Defensive Programming: Removed platform adaptation logic
  • Low Cardinality: One code path per test scenario instead of branches
  • Trust Boundaries: Single canonical implementation

All 233 tests pass on Unix (macOS/Linux). Tests will fail with clear errors on unsupported configurations.

Test plan

  • All 233 integration tests pass locally
  • Pre-commit checks pass
  • CI tests pass (all platforms)

🤖 Generated with Claude Code

max-sixty and others added 4 commits November 4, 2025 09:58
Adds support for creating a new worktree/branch without specifying a
base branch. If no base is specified, the command now attempts to
resolve the repository's default branch. This makes the `--create`
behavior more convenient for typical new branch workflows.
The merge command now provides a more explicit confirmation message when a worktree is preserved with the `--no-remove` flag, replacing the previous hint about using `wt remove`.

For the push command, a new note is added to the progress output to acknowledge when the `--allow-merge-commits` flag is used and merge commits are present. This enhances clarity about why a typically disallowed operation was permitted.
Adds specific ordering to the `list` command:
1. Main worktree first.
2. Current worktree second (if not main).
3. Remaining worktrees by most recent commit timestamp.

A new integration test `test_list_ordering_rules` is included to verify these rules.
Removes defensive programming patterns that gracefully adapted to missing
dependencies or platform differences. Tests now fail fast with clear errors
instead of silently skipping, aligning with "trust boundaries" and "low
cardinality" principles (one code path per test, not multiple branches).

Changes:
- Remove 8 bash/fish availability checks (e2e_shell*.rs)
- Remove 7 Windows/Unix command syntax conditionals (switch.rs, configure_shell.rs)
- Remove 2 macOS/Linux bash config path conditionals (configure_shell.rs)
- Keep Unix-only PermissionsExt (required for cross-platform compilation)

All 233 tests pass on Unix. Tests will fail clearly on unsupported platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty
max-sixty merged commit 178cb6e into main Nov 4, 2025
9 checks passed
@max-sixty
max-sixty deleted the no-skip-tests branch November 4, 2025 20:24
max-sixty added a commit that referenced this pull request May 23, 2026
Consolidates the spec for what runs before the `wt switch` / `wt list`
skeleton appears, since the previous "Fixed Command Count" table mixed
logical fetches with actual forks (most of the listed commands are now
cache hits served from the prewarmed in-memory config map) and didn't
break down the `git log --no-walk` batch.

Two doc-only edits, no behavior change:

- `commands/list/collect/mod.rs` — replaced `### Fixed Command Count`
with `### Forks on the Critical Path`: five git forks on the path to the
skeleton for a normal repo (six in repos with
`extensions.worktreeConfig=true`, where `Repository::all_config`
re-forks from `git_common_dir` because `--list` from a linked worktree
misses main-worktree `config.worktree` overrides). Each row carries its
source method and role; #3 is explicitly tagged Conditional with the
regime spelled out. A "looks like a fork but isn't" list enumerates the
`config_last` lookups served from the in-memory map. A callout flags
`default_branch()`'s one-per-repo `git ls-remote` fallback (worktrunk's
one accepted wire-path exception per CLAUDE.md → "Network Access"). A
new `### #6 — the batched commit-details fork` subsection breaks down
`git log --no-walk --no-show-signature --format=%H%x00%h%x00%ct%x00%s`
field by field: which downstream cell each format field feeds, why each
flag is there, the ARG_MAX bound on argv length.
- `commands/picker/mod.rs` — a one-sentence pointer onto the existing
"Time-to-skeleton" line directing readers to the new collect section.

Verified locally with `RUSTDOCFLAGS='-Dwarnings' cargo doc --no-deps
--document-private-items` (intra-doc links to `Repository::prewarm`,
`at`, `all_config`, `list_worktrees`, `local_branches`, `url_template`,
`is_bare`, `default_branch` all resolve).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant