Skip to content

Conversation

ajeetraina
Copy link
Owner

This PR adds comprehensive integration tests for GenAI applications using Testcontainers.

New Test Scenarios Added

  1. Prompt Handling & Response Validation

    • Tests different types of prompts
    • Validates response structure and content
    • Ensures responses match expected formats
  2. Performance Testing

    • Measures response latencies for different complexity prompts
    • Tests concurrent request handling
    • Reports detailed timing metrics
  3. Error Handling

    • Tests malformed JSON requests
    • Tests invalid endpoints
    • Tests missing required fields
  4. Context Window Testing

    • Tests model behavior with varying context sizes
    • Monitors token usage

Implementation Details

  • Added helpers and utility functions in helpers.go
  • Created separate test files for each testing category
  • Included comprehensive documentation in README.md
  • Tests are configurable to run against local or containerized environments
  • Added short mode support to skip resource-intensive tests

How to Use

Run all tests:

cd tests/
go test -v ./integration

Run specific test:

go test -v ./integration -run TestPromptHandling

These tests demonstrate how to comprehensively test GenAI applications in isolated, reproducible environments using Testcontainers.

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.

1 participant