test: expand test coverage across core functions, enforce strict fish_indent linting, and add network isolation harnesses #143
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
rootiest (Rootiest)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#143
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overview
This PR significantly expands test coverage across the repository, enforces strict code formatting via
fish_indent --checkin the CI test runner, and implements hermetic test harnesses for network-dependent scripts and functions.Total test assertions in
tests/run-tests.fishincrease from 511 to 659 (+148 assertions), with an additional 29 Python unit tests intests/test_sync_labels.pyand 76 documentation verification tests.Key Changes
1. Network Isolation & Failure Edge Case Testing
tests/test_sync_labels.py(29 tests):scripts/sync-labels.pycovering simulated network drops (URLError,ConnectionRefusedError,socket.timeout), HTTP status codes (401,403rate limit,404,500,502), pagination boundaries, malformed JSON, and dry-run mutation guards.tests/test-network-fish.fish(63 assertions):curl,git, andbdin a temporary mock$PATHto simulate network failures without external dependencies.gi,gip,gip4,gip6,qr,bd-pull,_auto_pull_sync,gitup,git-clean,config-update,repo-open, andfzf-update.tests/test-network-python.fish(31 assertions):2. Stricter Linting (
fish_indent --check) & Codebase Formatting.fishfiles infunctions/,conf.d/,completions/,integrations/,tests/, andconfig.fishwithfish_indent -w.python3 docs/verify-manual.py(76/76 passed) andpython3 docs/build-manual.py --site(produces zero diff).tests/run-tests.fishto enforce bothfish -n(syntax) andfish_indent --checkacross 239 files.3. String & Commandline Expansion Test Suite (
tests/test-string-and-expansion.fish)rand_string: curated categories (animal,color,noun,verb,adjective,name), casing (--case=upper/lower/title,-c), separators (dash,underscore,dot,none, custom delimiters), digits generation, error handling on missing categories, and help documentation._replace_command_token: commandline token replacement with and withoutsudo, cursor positioning.__substitute_typo: history caret substitution (^old^new) vs literal caret pass-through._puffer_fish_expand_dot&_puffer_fish_expand_bang: puffer token expansion logic and search field handling.4. Core Utilities & Security Test Suite (
tests/test-core-utilities.fish)sponge_filter_secrets: credential detection heuristics (TOKEN,API_KEY,PASSWORD,KOPIA_PASSWORD), filtering rules (returns 0 on secret in command, 1 on clean command), minimum length threshold (>8 chars), and path exception handling (/,~)._fish_mkdir_p: parent directory creation,--path,--tree, and--silentmodes, handling existing directories and empty inputs._scrollback_prune_junk: pruning empty files, single-line noise files, and Kitty tab-rename prompts while preserving genuine multi-line log sessions.sudo-toggle: toggling/etc/sudoers.d/nofail-togglebetween ENABLED and DISABLED via mockedsudo stat,truncate, andtee.spark: sparkline rendering with number arrays, min/max bounds clamping, version, and help flags.pkg: package manager detection and query fallback handling.5. Pre-existing Bug Fixes (Cleanly Partitioned)
functions/sponge_filter_secrets.fish: added--entireflag tostring match --regexto avoid partial variable name slicing under fish 4.x (perfish-string-set-gotchasrule).docs/generate_component_registry.py: aligned registry generator output withfish_indentformatting rules to prevent generator drift.Manual Verification Checklist
fish tests/run-tests.fish(659/659 assertions passed, 239/239 files passed syntax & indent check)python3 -m unittest tests/test_sync_labels.py -v(29/29 passed)python3 docs/verify-manual.py(76/76 passed)python3 docs/build-manual.py --siteCo-Authored-By: Claude, etc.) in commits or PR description