How do I run unit tests for Ray Serve Pull Request?

Yes, that’s a valid and recommended workflow for building and testing Ray from source. The steps are:

  1. Install Bazel:
    ray/ci/env/install-bazel.sh
    
  2. Build Ray’s core package (including ray._raylet):
    bazel build --jobs=2 //:ray_pkg
    
  3. Run your desired test(s) with pytest:
    pytest -vs test_application_state.py
    

This approach ensures that native extensions are built and Python dependencies are handled by pytest. For more, see Ray development docs and community troubleshooting.

Would you like a detailed explanation of each step or troubleshooting tips?

Sources:

Hint: Mention @RunLLM in the post for followups.