Skip to content

Conversation

@alxkm
Copy link
Contributor

@alxkm alxkm commented Sep 10, 2025

This PR enhances test coverage for PromptMetadata and VertexAiTextEmbeddingRetryTests by adding comprehensive edge case and boundary condition tests.

Changes

PromptMetadata Tests:

  • Empty filters array handling - Validates behavior when no filters are provided
  • Multiple filters support - Tests with 4+ filters to ensure scalability
  • Duplicate indices handling - Verifies behavior when multiple filters share the same prompt index
  • Size validation - Tests collection size methods for empty, single, and multiple filter scenarios
  • Immutability verification - Ensures PromptMetadata instances cannot be modified after creation
  • Empty content filter - Tests PromptFilterMetadata with empty string content

VertexAI Embedding Retry Tests:

  • Empty text list handling - Tests behavior when embedding request contains no input texts

Test Coverage Improvements

  • Edge Cases: Empty collections, duplicate values, boundary conditions
  • Collection Behavior: Size validation, immutability, iteration patterns
  • Input Validation: Empty inputs, null handling, invalid scenarios
  • Retry Logic: Empty request handling in embedding scenarios

Benefits

  • Increased Reliability: Better handling of edge cases in production
  • Improved Maintainability: Clear test coverage for all scenarios
  • Enhanced Confidence: Comprehensive validation of collection behavior
  • Future-Proofing: Tests act as regression protection for future changes

This PR focuses purely on testing improvements with no changes to production code, ensuring existing functionality remains unchanged while providing better test coverage.

… embedding retry tests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>
@alxkm alxkm force-pushed the test/enhance-prompt-metadata-and-embedding-retry-coverage branch from 67bc806 to 50db42f Compare September 10, 2025 09:11
@ilayaperumalg ilayaperumalg self-assigned this Sep 10, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M2 milestone Sep 10, 2025
@ilayaperumalg
Copy link
Member

@alxkm Thanks for adding tests. Rebased and merged as ae0c418

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants