Skip to content

test: add utility command ginkgo e2e#30

Merged
guoqqqi merged 2 commits intoapi7:mainfrom
guoqqqi:test/e2e-utility-ginkgo
Apr 28, 2026
Merged

test: add utility command ginkgo e2e#30
guoqqqi merged 2 commits intoapi7:mainfrom
guoqqqi:test/e2e-utility-ginkgo

Conversation

@guoqqqi
Copy link
Copy Markdown
Contributor

@guoqqqi guoqqqi commented Apr 28, 2026

Summary

  • add Ginkgo E2E coverage for completion and version output modes
  • add Ginkgo E2E coverage for extension empty-state, alias, help, and validation flows
  • add Ginkgo E2E coverage for context create/list/use/current/delete and error handling
  • keep existing mock Admin API unit tests untouched

Verification

Copilot AI review requested due to automatic review settings April 28, 2026 04:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@guoqqqi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 10 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09d68759-64fc-4e1b-8cec-93608cb0330e

📥 Commits

Reviewing files that changed from the base of the PR and between 98ec7b2 and 181bd75.

📒 Files selected for processing (1)
  • test/e2e/utility_ginkgo_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Ginkgo-based E2E coverage for “utility” CLI commands (completion/version/extension/context) to align more of the E2E suite with the Ginkgo runner.

Changes:

  • Introduces Ginkgo specs for completion across supported shells.
  • Adds Ginkgo specs for version (text + JSON output).
  • Adds Ginkgo specs for extension and context command flows using an isolated A6_CONFIG_DIR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +16
var _ = Describe("completion command", func() {
It("generates shell completions for supported shells", func() {
g := NewWithT(GinkgoT())

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Ginkgo E2E specs largely duplicate existing non-Ginkgo E2E tests (e.g., test/e2e/completion_version_test.go, test/e2e/extension_test.go, test/e2e/context_test.go). Since all of these run under go test -tags e2e ./test/e2e, this will execute the same assertions twice, increasing suite time and maintenance burden. Consider migrating/removing the older testing.T variants (or gating one set behind a separate build tag) so coverage isn't duplicated.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged. This duplication is intentional for this phase: per the current test migration boundary, we are keeping the existing tests for now and adding Ginkgo E2E coverage first. We will decide separately whether to remove or gate the older variants after the Ginkgo coverage is in place.

Comment thread test/e2e/utility_ginkgo_test.go Outdated
Comment on lines +68 to +71
stdout, stderr, err = runA6WithEnv(env, "extension", "upgrade", "--all")
combined := stdout + stderr
g.Expect(err == nil || strings.Contains(combined, "No extensions") || strings.Contains(combined, "no extensions")).To(BeTrue(),
"stdout=%s stderr=%s err=%v", stdout, stderr, err)
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extension upgrade --all assertion is effectively a no-op right now: it passes whenever err == nil and doesn't check for the expected empty-state message. Since upgrade --all with no installed extensions currently prints "All extensions are already up to date" and returns nil, this test should assert err is nil and validate the expected output (or explicitly assert one of the known acceptable messages).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 181bd75 by asserting the command succeeds and checking the known empty-state output instead of accepting any nil error.

@guoqqqi guoqqqi merged commit 6b57a5d into api7:main Apr 28, 2026
6 checks passed
@guoqqqi guoqqqi deleted the test/e2e-utility-ginkgo branch April 28, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants