Skip to content

test: improve pytest infrastructure and vLLM backend testing#416

Open
planetf1 wants to merge 1 commit intogenerative-computing:mainfrom
planetf1:test/vllm-clean
Open

test: improve pytest infrastructure and vLLM backend testing#416
planetf1 wants to merge 1 commit intogenerative-computing:mainfrom
planetf1:test/vllm-clean

Conversation

@planetf1
Copy link
Contributor

@planetf1 planetf1 commented Feb 5, 2026

Improve pytest infrastructure and vLLM backend testing

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Fixes #415

Enhances pytest infrastructure with capability detection and process isolation for GPU tests. Fixes process isolation to only activate on CUDA systems, preventing unnecessary overhead on macOS and systems without GPU.

Key changes:

  • Add pytest skip mechanism with CLI options (--ignore-gpu-check, --ignore-ram-check, etc.)
  • Implement CUDA-specific process isolation for heavy GPU tests (vLLM, HuggingFace)
  • Fix vLLM structured output token limits (one test was not specifying max tokens & failing)

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Tested

  • hugging face only tests on large CUDA system
  • vllm only on CUDA
  • all tests (except ollama) on CUDA
  • pytest locally on macOS (32GB, so some tests skipped)
  • NOT tested on >32GB macOS, or small gpu Linux

Note that if any large tests are run on cuda, pytest will enforce additional isolation - effectively batching up the test into groups.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Feb 5, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@planetf1 planetf1 force-pushed the test/vllm-clean branch 5 times, most recently from 5a0cdf5 to d25e4d7 Compare February 5, 2026 16:57
@planetf1 planetf1 marked this pull request as ready for review February 5, 2026 16:58
- Add pytest skip mechanism with capability detection and CLI options
- Implement process isolation for GPU-intensive vLLM tests
- Enhance test configuration with safe option registration
- Fix vLLM structured output token limits and update documentation
Copy link
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

The changes make sense to me. Can you please provide example outputs of the example and regular tests? I'd like to see what the vllm / heavy_gpu tests running in isolation looks like.

)
return backend
yield backend
# Cleanup: shutdown vLLM engine and release GPU memory
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to pull this code into a function that could be used both here and in test_vllm_tools.py rather than repeating it in both places?

@pytest.fixture(scope="module")
def backend():
"""Shared vllm backend for all tests in this module."""
# Import cleanup dependencies at top to avoid scoping issues
Copy link
Member

Choose a reason for hiding this comment

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

what are the scope issues?

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.

vllm test cleanup

3 participants