Skip to content

test: cover Zi promotion-critical compatibility contracts #94

Description

@ss-o

Problem

Zi's reusable ZUnit matrix runs successfully against next, but the five current suites focus on annex, ice, package, plugin, and snippet installation. They do not lock down several user-visible compatibility contracts that regressed during the current promotion review:

  • z-shell/zi#368 restored zini, zinit, and zplugin, ZI[INTERNAL_ALIASES]=0, version detection, and the established zi update -L behavior.
  • z-shell/zi#370 restored documented compatibility helpers including zpcdreplay, zpcdclear, zpcompinit, zpcompdef, zpextract, and ❮▼❯.
  • z-shell/zi#372 restored the documented zi times -s behavior without breaking zi update -s.

All three fixes were merged to next on 2026-08-15 after manual promotion review. The existing zi_test helper already starts an isolated Zsh process, so most of these contracts can be tested without adding another framework.

This is not a request for an arbitrary coverage percentage. Zi is Git-consumed source, and these tests should target stable, externally observable behavior with demonstrated regression risk.

Proposed scope

Add a focused compatibility suite, for example tests/compat.zunit, covering:

  • compatibility helpers are available after sourcing Zi and delegate to the intended implementation;
  • zini, zinit, and zplugin are present by default and absent only when ZI[INTERNAL_ALIASES]=0 is explicitly set;
  • zi -V, zi --version, and zi version report the checkout version consistently;
  • zi update -L remains accepted for plugins-only updates;
  • zi times -s, zi times -S, and zi times --seconds retain seconds behavior while zi update -s remains snippets-only.

Tests that would perform updates should use help/parse seams or deterministic fixtures rather than mutating live user state. Network-dependent annex behavior remains in the existing integration suites.

Acceptance criteria

  • A focused ZUnit suite covers each compatibility contract listed above.
  • Each regression category has at least one assertion that would fail if the corresponding pre-fix behavior returned.
  • The suite runs in both the native reusable workflow and the Zsh-version matrix without a hard-coded matrix update.
  • Test documentation explains when a Zi behavioral change requires a focused ZUnit regression test.
  • z-shell/zi's integration workflow runs the suite against the exact revision under review after z-shell/zd#93 adds immutable SHA support.

Dependency

Immutable revision selection is already tracked by z-shell/zd#93. Test authoring can proceed in parallel, but the promotion gate should not treat the result as immutable until #93 is complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ciContinuous integration or GitHub Actions work.area:ziZi core behavior, APIs, or documentation.priority:highNeeds prompt attention.type:featureA request for new behavior or capability.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions