Skip to content

test(workspace-default): isolate fallback-path tests from local config override#1863

Open
bassilkhilo-ag2 wants to merge 2 commits into
sonichi:mainfrom
bassilkhilo-ag2:fix/workspace-default-test-isolation
Open

test(workspace-default): isolate fallback-path tests from local config override#1863
bassilkhilo-ag2 wants to merge 2 commits into
sonichi:mainfrom
bassilkhilo-ag2:fix/workspace-default-test-isolation

Conversation

@bassilkhilo-ag2

Copy link
Copy Markdown
Contributor

Problem

4 tests in tests/workspace-default.test.py were failing when the dev checkout has a sutando.config.local.json with workspace.path set:

FAIL: test_resolve_falls_back_to_default_when_env_unset
AssertionError: PosixPath('/Users/…/.sutando/workspace') != PosixPath('/Users/…/Projects/sutando/workspace')

The tests assert "no-config fallback = <repo>/workspace" but a local config file legitimately overrides the workspace path — both are correct behaviors, the tests just weren't isolated from each other.

Fix

Added _patch_no_workspace_config() helper that:

  1. Calls the real load_config() once to populate _CACHE_REPO_ROOT (so resolve_workspace still knows the repo root)
  2. Patches sutando_config.load_config to return {} (stripping the workspace.path override)

The 4 affected tests now run inside with self._patch_no_workspace_config():. All 44 tests pass; 4 pre-existing skips unchanged.

Why this matters

Running python3 tests/workspace-default.test.py in a checkout with a non-default workspace path was showing 4 failures, making CI output noisy and hiding real regressions.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT

bassilkhilo-ag2 and others added 2 commits June 30, 2026 15:28
…fig.local.json override

4 tests in tests/workspace-default.test.py were failing when a dev checkout
carries sutando.config.local.json with workspace.path set — a valid user
override that legitimately changes the resolved path but broke the "no-config
fallback = <repo>/workspace" contract tests.

Fix: add _patch_no_workspace_config() helper that (1) warms _CACHE_REPO_ROOT
by calling the real load_config() first, then (2) patches load_config to
return {} so resolve_workspace falls through to the in-repo default. The 4
affected tests now use this helper instead of calling resolve_workspace()
bare, making them config-file-agnostic.

All 44 tests pass (4 pre-existing skips unchanged).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@cla-assistant check

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