test: add live e2e for apps +list#1444
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded end-to-end test ChangesApps List Live Coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/cli_e2e/apps/apps_list_workflow_test.go (1)
119-122: ⚡ Quick winStrengthen
--app-type htmlassertion to the positive contract.Line 121 only rejects
full_stack; this still passes for any other unexpectedapp_typevalue. Ifapp_typeis present, assert it equals"html"to make the filter contract explicit.Suggested diff
for _, item := range items.Array() { if at := item.Get("app_type"); at.Exists() { - assert.NotEqual(t, "full_stack", at.String(), "html filter must not return full_stack apps") + assert.Equal(t, "html", at.String(), "html filter should only return html apps when app_type is present") } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/cli_e2e/apps/apps_list_workflow_test.go` around lines 119 - 122, The test currently only rejects "full_stack" for items where item.Get("app_type") exists; change the assertion to positively assert that the app_type equals "html" instead: where the loop uses items.Array() and checks at := item.Get("app_type"); at.Exists(), replace the assert.NotEqual call with assert.Equal(t, "html", at.String(), ...) (or equivalent) so the test explicitly enforces the --app-type html contract and update the failure message accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/cli_e2e/apps/apps_list_workflow_test.go`:
- Around line 23-25: The test TestAppsListWorkflowAsUser does not isolate CLI
config state; update the test to set the LARKSUITE_CLI_CONFIG_DIR to a temp dir
using t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) early in the function
(after creating ctx/cancel or at the top of TestAppsListWorkflowAsUser) so the
CLI uses an isolated config directory for this E2E test and avoids leaking
user/environment config.
---
Nitpick comments:
In `@tests/cli_e2e/apps/apps_list_workflow_test.go`:
- Around line 119-122: The test currently only rejects "full_stack" for items
where item.Get("app_type") exists; change the assertion to positively assert
that the app_type equals "html" instead: where the loop uses items.Array() and
checks at := item.Get("app_type"); at.Exists(), replace the assert.NotEqual call
with assert.Equal(t, "html", at.String(), ...) (or equivalent) so the test
explicitly enforces the --app-type html contract and update the failure message
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d2b1de7-f5e5-430b-b209-0a07bf6bc54e
📒 Files selected for processing (2)
tests/cli_e2e/apps/apps_list_workflow_test.gotests/cli_e2e/apps/coverage.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
==========================================
+ Coverage 72.89% 73.35% +0.46%
==========================================
Files 733 750 +17
Lines 69205 69250 +45
==========================================
+ Hits 50445 50799 +354
+ Misses 14977 14711 -266
+ Partials 3783 3740 -43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@a4c313c8f115d02c42e60e3a548516295378d5de🧩 Skill updatenpx skills add larksuite/cli#feat/apps-live-e2e -y -g |
Summary
The lark-apps CLI E2E suite (
tests/cli_e2e/apps/) had only dry-run coverage and no live (real-service) tests. This adds the first live E2E test, forapps +list— the only apps shortcut that is read-only AND requires no pre-existingapp_idfixture, so it can be live-tested without leaking tenant state (apps has no+deleteendpoint, so any create-based fixture would leave orphaned Miaoda apps).Changes
tests/cli_e2e/apps/apps_list_workflow_test.go(TestAppsListWorkflowAsUser): fivet.Runsub-scenarios — default list, page-size cap, keyword no-match, ownership filter, app-type filter. Usesclie2e.SkipWithoutUserTokenso it skips without credentials; assertions are tenant-data-independent (empty list is valid) and verify theicon_url/created_atprojection contract.tests/cli_e2e/apps/coverage.md: record+listlive coverage, refresh the Live-coverage metric, and reinforce the Blocked rationale for the remaining commands (no+deleteendpoint → fixture creation would accumulate orphaned tenant apps).Test Plan
make unit-testpassedTestAppsListWorkflowAsUser5/5 sub-scenarios against real service; skillave N/A — no shortcut/skill change)go test ./tests/cli_e2e/apps -run TestAppsListWorkflowAsUser -count=1 -v— 5/5 PASS against the live service (skips cleanly without a user login)Related Issues
N/A
Summary by CodeRabbit
apps +listcommand using user token authentication, validating the standard output shape plus scenarios for default listing, page size limits, keyword no-match handling, ownership filtering, and filtering forhtml.apps +listworkflow coverage and clarified why other related commands remain blocked.