Repository navigation
chore(deps): update bashunit to 0.45.0, pin CI actions, add --jobs - #64
Merged
Merged
Conversation
bashunit 0.17.0 -> 0.45.0 cuts the suite from ~27s to ~2.5s. The upgrade is not drop-in: bashunit moved its doubles under `bashunit::mock` and changed the multi-argument form to append "$@" to the mock body, so a body that reads positional arguments (`touch "$3"`) can no longer be expressed. This suite uses that shape in 62 of its 93 mocks. When `mock` silently resolved to "command not found", the mocked tests fell through to real downloads, hit the network and overwrote lib/bashunit itself. tests/bootstrap.sh now owns `mock`/`unmock` with the semantics the suite was written against. Each bashunit test runs in its own subshell, so the helpers need no mock registry and depend on no bashunit internals. Also pins the two floating action refs (action-shellcheck@master, action-editorconfig-checker@main) so CI runs are reproducible, bumps the remaining actions, and ignores bashunit's new .bashunit/ state dir.
BASHDEP_JOBS was reachable only as an environment variable and was absent from --help, so the one performance knob bashdep has was effectively undiscoverable. Adds `--jobs=N` and `bashdep::setup jobs=N`, lists the flag in --help, and offers it in the bash/zsh completion scripts. Validation is deliberately left where it already lived: like the environment variable, a non-integer warns and falls back to 4 when install runs, so all three entry points behave identically. Also caches the shasum/sha256sum probe in BASHDEP_SHA_TOOL, mirroring how BASHDEP_DOWNLOADER already pins curl/wget for a whole run so every checksum is computed by the same tool. Measured performance-neutral (150 digests: 1.51s before and after) — a consistency change, not a speedup.
This was referenced Aug 9, 2026
Chemaclass
added a commit
that referenced
this pull request
Aug 9, 2026
CONTRIBUTING listed bashunit 0.17.0 in the toolchain table; the repo has been on 0.45.0 since #64, so anyone matching that table locally would install a version whose doubles API the suite no longer targets. The landing page advertised concurrency as BASHDEP_JOBS only, predating the --jobs=N flag added in #64. Prose across README and docs/ is no longer hard-wrapped at 80 columns. .editorconfig sets max_line_length for **.sh (120) and never for **.md, so long lines lint clean and reworded sentences stop reflowing whole paragraphs in diffs. Code blocks, tables and lists are untouched.
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.
🔗 Ticket
🤔 Background
bashunit had drifted 28 minor versions behind (
0.17.0), and CI pulled twoactions from floating refs (
action-shellcheck@master,action-editorconfig-checker@main), so runs were not reproducible.Separately,
BASHDEP_JOBS— the only performance knob bashdep exposes —was reachable only as an environment variable and was missing from
--help, making it effectively undiscoverable.💡 Goal
Get dependencies current, make CI reproducible, and close the discoverability
gap on concurrency — without regressing runtime behavior.
🔖 Changes
Dependencies
0.17.0→0.45.0. Suite runtime 26.8s → 2.5s (~11x).checkout@v7,cache@v6,paths-filter@v4,configure-pages@v6,upload-pages-artifact@v5,deploy-pages@v5.action-shellcheck@2.0.0,action-editorconfig-checker@v2.2.0..bashunit/(new run-state dir) git-ignored;example/demo.shURL refreshed.Bug the upgrade exposed
bashunit ≥0.40 moved its doubles under
bashunit::mockand changed themulti-argument form to append
"$@"to the mock body — so a body that readspositional arguments (
touch "$3") can no longer be expressed. This suiteuses that shape in 62 of its 93 mocks.
The failure was silent and dangerous:
mockresolved to command not found,the mocked tests fell through to real network downloads, and the run
overwrote
lib/bashunititself mid-suite.tests/bootstrap.shnow ownsmock/unmockwith the semantics the suite waswritten against. Each bashunit test runs in its own subshell, so the helpers
need no mock registry and depend on no bashunit internals.
DX
--jobs=Nandbashdep::setup jobs=N, listed in--helpand offered by thebash/zsh completion scripts.
warns and falls back to
4wheninstallruns, so all three entry pointsbehave identically.
bashdep::_sha256caches theshasum/sha256sumprobe inBASHDEP_SHA_TOOL, mirroring howBASHDEP_DOWNLOADERalready pinscurl/wgetfor a whole run.🖼️ Screenshots
N/A — CLI change.
--helpgains one line:1. Lockfile readers rewritten to pure bash, then reverted.
Replacing the
awkfork in_lock_get/_lock_nameswith builtin stringmatching removes a fork per dependency — but bash re-scans the whole lockfile
on every lookup, so it goes quadratic:
Crossover ~50 entries. Winning ~50ms on small projects in exchange for a silent
cliff on large ones is a bad trade. Reverted, with a comment in
_lock_getso nobody retries it. Final state is at parity (200 deps: 0.83s vs0.86s).
2.
_sha256"drops an awk fork" — it doesn't.The inner
$(...)just trades one fork for another. Measured identical (150digests: 1.51s before and after). Kept for the tool-caching consistency, and
labeled in the CHANGELOG as a consistency change rather than a speedup.
Also dropped a
BASHDEP_JOBS_OUTglobal I had added — it saved one fork perinstalland was not worth the API surface.Net: the real perf win here is the 11x faster test suite.
bashdepitselfis unchanged in speed; no runtime optimization survived measurement, and
installis network-bound regardless.✅ Verification
make pre_commit/run)lib/stays clean across runs