fix: debug and resolve all test failures#64
Merged
Conversation
…/fit_path path_git and fit_path no longer accept an elapsed argument; elapsed is now rendered separately via Renderer.elapsed_section(). Update layout.py to use the new four-argument fit_path, and rewrite test_path_git.py to reflect the narrower contracts: path_git is tested for path/branch/dirty output only, elapsed_section gets its own tests, and the obsolete show_elapsed flag tests are removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two dry-run assertions broke after ops/install.sh was updated:
- ensure_marketplace now runs 'update' (not skips) when the marketplace
is already present; update the test assertion to match.
- ensure_plugin now checks .plugins | has("yas@...") (nested) instead of
the top-level key; seed installed_plugins.json with a differently-named
key (yas-cached@...) so ensure_plugin sees absent while do_wire can
still resolve the installPath via its contains("yas") scan.
Also update _seed_installed_plugins docstring and the comment block to
reflect the current jq paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vars YAS_MAX_WIDTH and YAS_FULL_WIDTH set in the developer's shell leaked into Config.load() (which calls dict(os.environ)) and capped width at 40 instead of DEFAULT_MAX_WIDTH=140. Add monkeypatch.delenv for both vars before the test's calls so the test sees the true defaults regardless of the host environment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The elapsed_section method was defined twice: once with GLYPH_HOURGLASS (wider, misaligns layout width budget) and once without (correct, what the layout and snapshot tests expect). Remove the glyph variant. Co-Authored-By: Claude Sonnet 4.6 <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.
Context
Three test failures were present on
mainafter recent changes toops/install.sh(ensure_marketplace/ensure_plugin updated) and an in-progress refactor ofRenderer.path_git/fit_path(elapsed moved to a separateelapsed_section()method). A fourth failure (test_yas_full_width_fills_terminal) was caused by host environment variables (YAS_MAX_WIDTH=40) leaking intoConfig.load()during the test run.Changes
1. Complete the
elapsed_sectionsplit (renderer.py+layout.py+ tests)path_gitandfit_pathno longer accept anelapsedargument — elapsed time is now rendered as a separate section viaRenderer.elapsed_section(). Thelayout.pycalls tofit_pathwere still using the old five-argument form (passing''for elapsed); those are updated to the new four-argument form.test_path_git.pyis rewritten to match:path_gitis tested for path/branch/dirty output only,elapsed_sectiongets its own tests, and the obsoleteshow_elapsedflag andtest_no_elapsed_when_no_commit_still_overflowstests are removed.test_model_section.pysimilarly drops the elapsed arg from itsfit_pathcalls.2. Fix install script test assertions (
test_install_script.py)test_dry_run_marketplace_already_present:ensure_marketplacenow runs an update (not a skip) when the marketplace is present — assertion updated from'already present' or 'skipping'to'would update marketplace'.test_dry_run_would_install_when_plugin_absent:ensure_pluginchanged its jq from top-levelhas("yas@...")to.plugins | has("yas@..."). The test's seed data had the key under.plugins, so the script saw it as installed and printed "Would update" instead of "Would install". Fixed by seeding with keyyas-cached@yet-another-statusline—ensure_plugindoesn't find it (wrong name), butdo_wire'scontains("yas")scan still resolves theinstallPath._seed_installed_pluginsdocstring and surrounding comment block to reflect the current jq paths.3. Isolate width test from host env vars (
test_render_callable.py)Config.load()callsdict(os.environ), soYAS_MAX_WIDTH=40set in the developer's shell capped the rendered width at 40 instead ofDEFAULT_MAX_WIDTH=140. Addedmonkeypatch.delenv('YAS_MAX_WIDTH', raising=False)(andYAS_FULL_WIDTH) before the test's calls.Checklist
Screenshots / recording
Benchmark
mainPR(Outliers detected; within noise — no performance-relevant code changed.)
System info