Files
xiongyuanwen-byted 3558e5b548 fix(sheets): let every command that resolves a sheet also defer asking for one
Review found the selector deferral half-wired. The requirement is easy to
satisfy in Execute and easy to miss in Validate, because the two read the
selector from different places: Execute passes the RESOLVED pair into the
input builder, Validate passes the raw flags. A builder calling
requireSheetSelector therefore passes for one caller and fails for the other,
with nothing tying them together.

Sweeping every command whose Execute calls resolveSheetSelectorExec found nine
still rejecting in pre-flight -- more than the review named: +cells-merge,
+cells-unmerge, +rows-resize, +cols-resize, +range-copy, +range-move,
+dim-delete (both --range and --ranges), +dim-hide / +dim-unhide,
+dim-group / +dim-ungroup, and the float-image writes. For those the resolver
their Execute calls was unreachable.

TestSheetSelector_DeferralReachesEveryResolver is that missing tie, and its
counterpart pins that --dry-run keeps the rejection: a preview sends nothing,
so it cannot ask the workbook either, and printing a request whose sheet the
CLI would have filled in would show a call that never existed.

Also asserts the typed envelope in the sheet-prefix conflict E2E case rather
than the message text alone. type / subtype / param are what a caller branches
on; the prose is free to be reworded, and pinning only the prose is what made
that test fail on a reworded message once already.
2026-09-14 15:27:39 +08:00
..
2026-08-11 15:43:58 +08:00
2026-09-01 16:31:47 +08:00
2026-07-24 14:28:54 +08:00

CLI E2E Tests

This directory contains end-to-end tests for lark-cli.

The purpose of this module is to verify real CLI workflows from a user-facing perspective: run the compiled binary, execute commands end to end, and catch regressions that are not obvious from unit tests alone.

What Is Here

  • core.go, core_test.go: the shared E2E test harness and its own tests
  • demo/: reference testcase(s)
  • cli-e2e-testcase-writer/: the local skill for adding or updating testcase files in this module

For Contributors

When writing or updating testcases under tests/cli_e2e, install and use this skill first:

npx skills add ./tests/cli_e2e/cli-e2e-testcase-writer

Then follow tests/cli_e2e/cli-e2e-testcase-writer/SKILL.md.

Example prompt:

Use $cli-e2e-testcase-writer to write lark-cli xxx domain related testcases.
Put them under tests/cli_e2e/xxx.

Run

make build
go test ./tests/cli_e2e/... -count=1