Skip to content

Conversation

@nv-oviya
Copy link
Contributor

@nv-oviya nv-oviya commented Nov 2, 2025

Overview:

Test utility functions for fault injection scripts: colored terminal output, HTTP request helpers, response validation, and environment-based configuration. Works both locally and in-cluster.

Details:

  • Add client/test_helpers.py (322 lines): Test utility functions

    • Colors class: ANSI color codes with TTY auto-detection
    • get_config_from_env(): Load API_URL, FRONTEND_URL, APP_NAMESPACE from environment
    • check_frontend_reachable(): HTTP health check with retry
    • send_completion_request(): Send OpenAI-compatible requests with retry logic
    • validate_completion_response(): Validate response structure and content
  • Add client/setup.py (35 lines): Python package configuration

    • Dependencies: httpx, kubernetes, pyyaml, requests
    • Enables pip install -e client/
  • Add client/conftest.py: Pytest configuration

Where should the reviewer start?

test_helpers.py

  • Lines 28-114: Colors class with TTY auto-detection
  • Lines 116-180: get_config_from_env() loads configuration from environment
  • Lines 182-220: check_frontend_reachable() health check
  • Lines 222-280: send_completion_request() inference helper
  • Lines 282-322: validate_completion_response() validation

setup.py

  • Standard package setup with dependencies

Key features:

  • Colors automatically disable for piped output (logs, CI)
  • Auto-detects in-cluster vs local execution
  • Retry logic for transient failures

Related Issues:

  • Relates to: Foundation for fault injection test scripts

- test_helpers.py: Colors, HTTP helpers, config from environment
- setup.py: Python package setup for pip installation
- conftest.py: Pytest configuration

Foundation utilities for fault injection test scripts.
@copy-pr-bot
Copy link

copy-pr-bot bot commented Nov 2, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Contributor

@nnshah1 nnshah1 left a comment

Choose a reason for hiding this comment

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

I think this one also overlaps with exsiting functionality - we can converge later - but I think if we get the functionality in but leave out the end to end tests -would be a good start

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.

3 participants