Commit graph

94 commits

Author SHA1 Message Date
vladislav doster 98b004ba5b
Merge pull request #787 from zdharma-continuum/fix/ziextract-install
fix(install): treat non-archive single file gracefully in ziextract.
2026-08-27 22:23:06 -05:00
Vladislav Doster aabc380881 test(ices): cover gh-r appimage bpick+mv recipe
End-to-end test for the ziextract non-archive fallback using
pkgforge-dev/ghostty-appimage: the downloaded AppImage is not an
archive, so it must be kept as a plain file, marked executable,
and renamed by the mv ice. Asserts on files only; the Linux-only
binary is never executed since CI also runs on macOS.

Closes: https://github.com/zdharma-continuum/zinit/issues/775
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 22:20:25 -05:00
Vladislav Doster 2e77713c8e test(ices): fix the completions-ignored assertion
is_not_value_in builds an associative array from its arguments, so it
died on an odd element count, which made the test depend on how many
completions earlier suites had installed. It also compared a bare name
against full paths, so it never caught a wrongly installed completion.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 04:30:41 -05:00
Vladislav Doster c08a363b07 test(ices): extract the cwd assertion helper
Eight tests repeated the same four-line block asserting PWD, OLDPWD and
where cd - lands. Move it beside _oldpwd_fixture in @setup and drop the
comment paragraphs that restate the traps documented in tests/CLAUDE.md.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 04:30:41 -05:00
Vladislav Doster 08530de87c test(hook-handler): pin $HOME to the sandbox
The second test runs `zsh -c', which sources $HOME/.zshenv, so the
developer's own rc file would otherwise leak into $output and $state.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 04:30:33 -05:00
Vladislav Doster a1cf6128c2 test: pin core.eol=lf for the test environment
With the text attribute set, core.autocrlf=false hands the decision to
core.eol, so a global core.eol=crlf still produces CRLF checkouts in the
sandbox clones.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:29:50 -05:00
Vladislav Doster 4d98cd4563 test(ice-validation): fix two assertions that could not hold
wait-invalid-suffix-x asserted on 'Expected one of: a, b, c', but
+zi-log colourises each suffix letter separately, so the raw output
carries escape sequences between them and no such contiguous substring
exists. Strip the escapes before asserting on the sentence.

for-invalid-as asserted rc 0 while the load ran on to
∞zinit-compile-plugin-hook, which returns 1 for this fixture ("No files
for compilation found") and made `zinit for' exit 1 for a reason
unrelated to the invalid ice under test. Add nocompile so the test
measures ice validation only.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 116d30bfc8 test(hook-handler): stop re-sourcing zinit.zsh in @setup
@setup bodies run under ERR_EXIT. Sourcing zinit.zsh trips it partway
through, so the setup aborted and zunit reported both tests as failures
with an empty message -- which read as a broken assertion rather than a
broken fixture. The source was redundant anyway: the bootstrap already
sources zinit from the sandbox clone.

Drop the ZINIT[BIN_DIR]="$PWD" override with it. It aimed the tests at
the real checkout instead of the sandbox, the same misdirection that
lets a failed bootstrap write into the working tree. Neither test calls
a zinit function; only the hook registries are needed.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 8f01c1d451 test(ices): add $OLDPWD regression coverage for ice loading
Covers atload, atinit and multisrc, the nocd branch, a since-deleted
$OLDPWD, an $OLDPWD that started unset, and the configure hook.

Each test asserts where `cd -' actually lands, not just the value of
$OLDPWD: `cd -' reads zsh's internal previous-directory state, so a
parameter-only assertion passes against a fix that merely assigns
$OLDPWD while leaving the bug in place. All seven fail without the
preceding two commits.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-08-27 03:28:26 -05:00
Vladislav Doster 981cb1582e fix(install): treat non-archive single file gracefully in ziextract.
Change `ziextract` when no extractor case matches and no explicit type was passed (-z $ext), file is treated as plain single file with info message
`'<file>' is not an archive — keeping it as a plain file.` plus chmod a+x. The existing exec-bit collection then picks it up, sets REPLY for --move, prints normal
success. Error message retained for explicit bogus types (ziextract file bogus-type). One iteration mid-verify: dropped -- from chmod — BSD/macOS chmod rejects it (chmod: --:
No such file or directory).

Why it broke: commit 1334994f (PR #771) made +x detection archive-exec-bit-only. Bare gh-r binaries arrive over HTTP with 644 and no extension => no extractor, no exec bit →
error branch. Pre-#771, file(1) detection covered this case.

Tests (tests/ices.zunit): two new — plain-file success path (asserts no error, message present, file executable) and bogus-explicit-type error
retention. Suite 16/16, including #771's ziextract-permissions. Regression-validated: plain-file test fails 15/16 with fix stashed.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-07-02 06:58:41 -05:00
vladdoster 8f89f88cfd feat(zsh): allow configuring settings like HOME_DIR/BIN_DIR via zstyle
Resolve ZINIT[...] settings from `zstyle ':zinit:config' <attr>` before
the BIN_DIR/HOME_DIR/derived-dir logic runs. The attribute name is the
hash field lowercased with `_` replaced by `-` (HOME_DIR -> home-dir).

An explicitly-set ZINIT[KEY] always wins over zstyle, which wins over
the built-in default; fully backward-compatible.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2026-06-18 19:05:42 -05:00
Andrea Alberti 27a0dc5527
## Fix extract ice not working during zinit update for from'gh-r' (#780) 2026-05-30 22:39:06 +02:00
Andrea Alberti 17f2c4bc74
test: replace cog gh-r test with cosign
replicate/cog stopped shipping a static binary in its GitHub releases
(switched to a Python wheel coglet-*.whl as of v0.20.0), which broke the
linux gh-r CI job — ziextract cannot unpack a .whl, and the linked symlink
returns 'exec format error' when run.

Replace with sigstore/cosign, which still ships static binaries
(cosign-linux-amd64 / cosign-darwin-{amd64,arm64}) and slots into
the alphabetical position between 'checkmake' and 'compress'.
2026-05-30 18:42:00 +02:00
Tom Hale 424b241bc7
feat: validate ice arguments (#778)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-24 10:09:43 +02:00
Andrea Alberti 1334994f20
fix: trust archive permissions instead of file(1) heuristics in ziextract (#771) 2026-03-14 23:39:35 +01:00
Andrea Alberti b4728b29f7
test: added tests for ice extract 2026-03-06 01:15:30 +01:00
Andrea Alberti 1c0e24fca4
test: added tests for zinit self-update. Throw error if unsupported arguments are provided. 2026-03-03 09:22:24 +01:00
vladislav doster c68d4973a5
maint: update self-update zunit tests
- Add tests for `self-update` with `--help` and `--quiet` flags
- Update expected output with no flags
2026-03-03 09:22:24 +01:00
Andrea Alberti 81dd21f8d7
test: align self-update output expectation with grammatically corrected log message
Grammar correction suggested by @vladdoster.
2026-03-03 09:22:23 +01:00
vladislav doster 18fc2cc5b9
fix: update git-chglog to git-cliff in gh-r tests
git-chglog was archived and git-cliff  is actively maintained fork
2026-02-17 06:10:09 -06:00
vladislav doster 01eb65f8ce
fix: Update various tools in gh-r tests (#759) 2026-02-01 09:43:27 +01:00
Douglas de Campos Held 5784ef17f4
Fix: Timeout on downloading from GH releases (#741) 2025-09-10 09:27:45 +02:00
Nick Sherron 2167408db2
fix: prevent "permission denied" errors from empty hook handlers (#729)
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
2025-08-12 20:39:35 +02:00
Philipp Schmitt 091ddfeee5
ci: disable navi gh-r test on mac os (#702) 2025-02-18 17:50:58 +01:00
Philipp Schmitt 9cd774edbb
ci: Fix typo in ice zunit test for mv (#692) 2025-01-26 00:16:24 +01:00
Philipp Schmitt 50643c6e6e
fix: gh-r zunit tests (#691) 2025-01-26 00:01:13 +01:00
vladislav doster c346949645
fix(gh-r.zunit): alist org name (#680)
Some checks failed
Container images / build-containers-with-zsh (5.2.4) (push) Has been cancelled
Container images / build-containers-with-zsh (5.3.1) (push) Has been cancelled
Container images / build-containers-with-zsh (5.4.2) (push) Has been cancelled
Container images / build-containers-with-zsh (5.5.1) (push) Has been cancelled
Container images / build-containers-with-zsh (5.6.2) (push) Has been cancelled
Container images / build-containers-with-zsh (5.7.1) (push) Has been cancelled
Container images / build-containers-with-zsh (5.8) (push) Has been cancelled
Container images / build-containers-with-zsh (5.9) (push) Has been cancelled
Container images / build-container-latest (push) Has been cancelled
Documentation / zshelldoc (push) Has been cancelled
Lint / Lint (push) Has been cancelled
Unit Tests / zunit-tests (macos-latest) (push) Has been cancelled
Unit Tests / zunit-tests (ubuntu-latest) (push) Has been cancelled
2024-11-08 17:10:16 -06:00
vladislav doster 0c18fda87f
test(fx): pin version to 32.0.0 (#644)
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2024-03-19 15:02:36 -05:00
vladislav doster b7b8347cad
fix: compile command logic when using id-as ice (#619)
- Updated README.md `compiling` section
- Compile commands now work with `id-as` ice
- Compile command options added to tab completion  

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2024-03-03 23:43:48 -06:00
vladislav doster f26d387e51
fix: plugins command correctly handles keyword argument (#626) 2024-01-18 20:28:54 -06:00
vladislav doster 22e66db478
feat: configure, make, cmake, and build ices (#613) (#616)
* Refactored 'configure' and 'make' ices
* New 'build' ice sets 'configure' and 'make ices if no flags are needed.
* New 'cmake' ice will build/install using 'cmake'
* Delete command now handles programs using 'make' and 'cmake' ices
* Setting `$ZINIT[DEBUG]` enables debug logging (i.e., `+zi-log "{dbg} message ..."`)
2024-01-09 04:11:39 -06:00
vladislav doster 9cf5b17198
ci: pin mcfly version gh-r test (#615) 2023-12-24 19:13:24 -06:00
vladislav doster 0ba778ac73
fix: pin dua gh-r test to v2.20.3 (#605) 2023-12-08 20:19:49 -06:00
vladislav doster 8cf9104ac0
fix: handle zinit --help (#597)
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-12-04 05:30:34 -06:00
vladislav doster 1f52eee1b1
fix: from'gh-r' skips compile by default (#590)
Skip compile when from'gh-r' ice is set unless compile is also set.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-11-20 05:50:12 -06:00
vladislav doster 9b33288b4a
fix: set home dir to test env in gh-r tests (#582)
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-09-29 02:12:46 -05:00
vladislav doster 2e7b9aa29e
ci: optimize zunit tests (#572)
- cache test plugin dependencies
- add gh-r zunit tests
- fix ipinfo zunit test
- pin qsv version to 0.112.0 for macOS x86_64

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-09-14 05:13:59 -05:00
vladislav doster 207ab9f281
fix: gh-r linux regex & gh-r zunit tests (#564)
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-08-29 23:33:00 -05:00
vladislav doster b456a2dba6
fix: self-update check for updates (#562)
Signed-off-by: Doster, Vladislav <mvdoster@gmail.com>
2023-08-28 04:17:59 -05:00
vladislav doster 19ca2dc361
fix: update gomi repo owner (#568) 2023-08-28 03:42:44 -05:00
vladislav doster 68a6b42caf fix: math expression in plugins command (#559)
Co-authored-by: GitHub Actions <actions@github.com>
Signed-off-by: Doster, Vladislav <mvdoster@gmail.com>
2023-08-15 00:21:14 -05:00
vladislav doster 97b087e68a
fix: gh-r zunit tests (#561)
- remove version pin for `atuin` test
- update `atuin` repo owner
- `lfs` renamed to `dysk`
- macOS architecture check for `create-go-app`
2023-08-12 06:22:21 -05:00
Philipp Schmitt 1cb1df6307
ci: fix repo for hub (github -> mislav) (#541) 2023-06-15 19:49:06 +02:00
Philipp Schmitt 113cfc47fb
fix: Ignore .yaml and .py files when installing completions (#528)
Signed-off-by: Doster, Vladislav <mvdoster@gmail.com>
Co-authored-by: vladislav doster <10052309+vladdoster@users.noreply.github.com>
2023-06-15 19:08:56 +02:00
vladislav doster 497d519d99 fix: pin fclones version to v0.31.0 2023-06-08 20:48:12 -05:00
Philipp Schmitt de85908f8d
fix: jq has moved from stedolan/jq to jqlang/jq (#530) 2023-06-05 10:02:55 +02:00
vladislav doster 08f02e00d0
fix: pin git-mkver unit test to v1.2.2 2023-05-02 07:13:54 -05:00
Vladislav Doster c323116483 feat: expand gh-r zunit tests
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-19 16:54:49 +00:00
Vladislav Doster d71525ca63
ci: fq cli gh-r zunit test
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-15 23:37:52 -05:00
Vladislav Doster 2f39986945
ci: fnm gh-r zunit test
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
2023-04-10 17:15:12 -05:00