Skip to content

Add exception handling tests for GenAI CountTokens operator#64027

Draft
Nidhs01 wants to merge 1 commit intoapache:mainfrom
Nidhs01:genai-exception-tests
Draft

Add exception handling tests for GenAI CountTokens operator#64027
Nidhs01 wants to merge 1 commit intoapache:mainfrom
Nidhs01:genai-exception-tests

Conversation

@Nidhs01
Copy link

@Nidhs01 Nidhs01 commented Mar 21, 2026

What does this PR do?

Adds unit tests for GenAICountTokensOperator to verify correct execution behavior and proper exception propagation.

Why is this change needed?

Currently, there is no explicit test ensuring that ClientError exceptions raised from the underlying hook are properly propagated. This improves reliability and test coverage.

What changes were made?

  • Added test for successful execution
  • Added test for ClientError propagation
  • Used mocking to isolate operator behavior

Does this PR introduce user-facing changes?

No.

How was this tested?

  • Ran pytest locally
  • All tests passed successfully

@Nidhs01 Nidhs01 force-pushed the genai-exception-tests branch from 4942f23 to cf57922 Compare March 21, 2026 08:22
@gopidesupavan
Copy link
Member

@Nidhs01 this has alot of unnecessary changes please fix them before making ready for review, am converting to draft

@gopidesupavan gopidesupavan marked this pull request as draft March 21, 2026 08:44
@Nidhs01
Copy link
Author

Nidhs01 commented Mar 23, 2026

@Nidhs01 this has alot of unnecessary changes please fix them before making ready for review, am converting to draft

Thanks for the feedback! I've cleaned up the PR and ensured only relevant tests are included. Please let me know if anything else needs improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants