Skip to content

Fix integration tests - #14

Merged
khisakuni merged 4 commits into
developfrom
khisakuni/fix-integration-tests
Feb 18, 2026
Merged

Fix integration tests#14
khisakuni merged 4 commits into
developfrom
khisakuni/fix-integration-tests

Conversation

@khisakuni

@khisakuni khisakuni commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

What was changed

  • Updates namespace cleanup logic to only attempt to delete e2e namespaces that are in the active state
  • Refactors async operation polling in tests to use the same poller that the commands use.
  • Updates polling function to return an error if the async operation results in an error state

Why?

The poller update addresses a cursor comment: #9 (comment)

Checklist

  1. Closes

  2. How was this tested:

  • Ran integration tests locally
  1. Any docs updates needed?

Note

Medium Risk
Touches shared async-operation polling and its error/printing behavior, which can affect CLI output and exit codes for multiple commands; test changes are low impact but the Makefile env handling change may alter local dev expectations.

Overview
Integration tests are stabilized by reusing the production async-operation polling logic: pollAsyncOperation is promoted to exported PollAsyncOperation, all namespace commands call it, and it now returns an error on FAILED/CANCELLED/REJECTED after emitting the structured MutationResult so the CLI exits non-zero while preserving JSON output.

Test cleanup is hardened by skipping deletion of non-ACTIVE namespaces, and the test suite’s polling helper is simplified to a thin wrapper around PollAsyncOperation with output discarded. The Makefile also stops parsing .env and instead exports all variables, relying on the environment for values.

Written by Cursor Bugbot for commit c884b5b. This will update automatically on new commits. Configure here.

@khisakuni khisakuni changed the title Khisakuni/fix integration tests Fix integration tests Feb 13, 2026
@khisakuni
khisakuni marked this pull request as ready for review February 13, 2026 02:18
@khisakuni
khisakuni requested a review from a team as a code owner February 13, 2026 02:18
for _, ns := range namespacesToClean {
// AIDEV-NOTE: Only delete namespaces that are in ACTIVE state (value 3).
// Namespaces in other states (DELETING, DELETED, etc.) cannot be deleted.
if ns.State != resource.ResourceState_RESOURCE_STATE_ACTIVE {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if its better for the test to fail when a namespace is left in non-active state. I would hate to leak namespaces in the test account.
Ideally the test should clean up all the namespaces it creates, else its a bug that needs fixing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good callout, I'll address this in a follow up PR

@anekkanti anekkanti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One comment, but otherwise lgtm.

@khisakuni
khisakuni merged commit 66f333c into develop Feb 18, 2026
3 checks passed
@khisakuni
khisakuni deleted the khisakuni/fix-integration-tests branch February 18, 2026 19:45
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