mirror of
https://github.com/larksuite/cli.git
synced 2026-08-03 08:32:46 +08:00
Review follow-ups on the member-types and chat-search changes. normalizeMemberTypes accepted any occurrence of "all" before validating the remaining values, so an invalid value alongside it (--member-types admin,all) was silently swallowed into "no filter". Validate every value first; "all" only widens the filter after the whole list is known to be well-formed, and the rejection message now names all three accepted spellings. The skill index and command descriptions for +chat-messages-list and +threads-messages-list advertised "sort" while the actual flag is --order; name the flag exactly so callers do not learn a spelling the command rejects. Test tightening from the same review: the canonical-precedence e2e now passes an alias value that would fail validation (--types p2p) alongside --chat-modes, proving an explicit canonical flag bypasses alias validation entirely; rejection-path e2e tests assert the structured validation metadata (error.type, error.subtype, param names) instead of message text alone.
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 testsdemo/: 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