test(workspace-default): isolate fallback-path tests from local config override#1863
Open
bassilkhilo-ag2 wants to merge 2 commits into
Open
test(workspace-default): isolate fallback-path tests from local config override#1863bassilkhilo-ag2 wants to merge 2 commits into
bassilkhilo-ag2 wants to merge 2 commits into
Conversation
…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
Contributor
|
@cla-assistant check |
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.
Problem
4 tests in
tests/workspace-default.test.pywere failing when the dev checkout has asutando.config.local.jsonwithworkspace.pathset: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:load_config()once to populate_CACHE_REPO_ROOT(soresolve_workspacestill knows the repo root)sutando_config.load_configto 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.pyin 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