Skip to content

feat(ci): Add tests for ud.sh CLI #17

Description

@cursor

Summary

Add automated test coverage for the ud CLI (zsh/ud/ud.sh) so changes to subcommands, help text, and command-printing behavior are caught in CI.

Problem

ud is a daily-driver CLI for Go, Rust, Nibiru, quick editor jumps, Docker helpers, and more. It is installed via symlinks.sh~/.local/bin/ud.

There is already a Go test file at zsh/ud/ud_test.go, but it is not wired into root CI (.github/workflows/test.yml runs just testbun test only). The zsh/ud/justfile has its own just test, but that path is easy to forget.

So ud can regress silently unless someone remembers to run Go tests locally in that subdirectory.

Purpose / Rationale

  • Protect a heavily used CLI that wraps many workflows
  • Catch breakage in help output, --cmd dry-run behavior, and subcommand routing
  • Low cost to run on ubuntu-latest — existing tests already use bash -c "source ud.sh && ..." pattern
  • Align ud with how other dotfiles automation is already tested (bun tests, config generation tests)

What exists today

  • zsh/ud/ud_test.go — tests help, ud rs test --cmd, ud go test-short --cmd, ud nibi cfg prod, etc.
  • zsh/ud/justfilejust test runs go test ./...
  • Root justfile / CI — does not include ud tests

What "good enough" might mean (examples, not a spec)

  • ud tests run in CI on PRs
  • Failures block merge when help text or --cmd output drifts
  • Optional: expand coverage for other subcommands over time

Exact runner choice (fold into just test, separate job, matrix) left open.

Out of scope (for now)

  • Testing commands that require external binaries (nibid, docker, live network)
  • Full integration tests against real Nibiru nodes or Docker Desktop
  • Rewriting ud in another language

Acceptance Criteria

  • ud.sh test suite runs in CI on ubuntu-latest
  • At least the existing Go tests are included (or equivalent coverage)
  • Local reproduction is documented or available via just (exact recipe TBD)
  • Scope stays on CLI contract / output — not live external service calls

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions