Skip to content

Fix test failures that depend on the local machine - #21

Open
MrJoy wants to merge 2 commits into
wandercom:mainfrom
MrJoy:fix/preexisting-test-failures
Open

MrJoy wants to merge 2 commits into
wandercom:mainfrom
MrJoy:fix/preexisting-test-failures

Conversation

@MrJoy

@MrJoy MrJoy commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Nine tests failed on a clean main checkout when run the way make test runs them (.venv/bin/python -m pytest, venv not activated) with .[dev,all-backends] installed.

  • test_tool_index.py tree-sitter tests (TestDetectTools::test_detects_tree_sitter, four in TestTreeSitter, TestIntegration::test_build_tool_index_real): tree-sitter comes from the optional analysis extra. They now skip without it and all pass with it installed.
  • TestDetectTools::test_detects_cscope: needs the cscope binary. Skips when it is not on PATH.
  • ctags tests (test_detects_ctags, TestCtags, the two TestIntegration tests): pass here, but fail on a Mac that only has BSD /usr/bin/ctags. They skip unless universal-ctags is present. CI installs universal-ctags and cscope and the analysis extra, so nothing is skipped there.
  • test_adopt.py::TestAdoptDryRun::test_smoke_tests_are_runnable: test bug. It ran python3 from PATH, which was a different interpreter without pytest. Now uses sys.executable.
  • test_environment.py::TestEnvironmentSpec::test_validate_finds_pytest: test assumed the venv's scripts directory was on PATH. It now prepends sysconfig.get_path("scripts") via monkeypatch.

test_cache_threading.py and test_research_sharing.py are unchanged. They failed only in the original checkout, and they failed every time there, because stale __pycache__ bytecode still carried the old ~/wander/pact paths from before the repo moved. After deleting __pycache__, both pass. Not a code or test bug.

.[dev,all-backends]:

2368 passed, 9 skipped in 57.06s

.[dev,all-backends,analysis]:

2374 passed, 3 skipped in 54.42s

The remaining skips are cscope (not installed on this machine) and two tree_sitter_rust tests, which the analysis extra does not provide.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FeZUmAZbyQWDJNAPkUA3S


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

MrJoy and others added 2 commits September 28, 2026 12:14
tree-sitter comes from the optional `analysis` extra and the binaries are system installs, so these tests failed on any machine without them.  CI installs all three, so coverage there is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FeZUmAZbyQWDJNAPkUA3S
`make test` runs `.venv/bin/python -m pytest`, which leaves the venv's bin directory off `PATH`.  The adopt smoke test then ran a different `python3`, and the environment test could not find the `pytest` script.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FeZUmAZbyQWDJNAPkUA3S
@MrJoy
MrJoy marked this pull request as ready for review September 28, 2026 19:17

@adaptcom adaptcom 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.

Confidence Score: 5/5

Summary

Removes local-tool and virtualenv assumptions from tests without changing production behavior. Low risk; the full-dependency suite passed 2,375 tests with two optional Rust-parser skips.

Important Files Changed

File Overview
tests/test_adopt.py Runs generated smoke tests using the current interpreter
tests/test_environment.py Adds the interpreter’s scripts directory to PATH with fixture-scoped cleanup
tests/test_tool_index.py Skips tool-dependent tests when their required binaries or Python packages are unavailable

↻ Re-run review · View in Adapt

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant