[ci/serve] Fix Serve minimal install silent failure (#24183)

Previously `sys.exit()` wasn't called, so bazel wouldn't fail because of the faulty match pattern.

Uncovered here: https://buildkite.com/ray-project/ray-builders-pr/builds/30291#_
This commit is contained in:
Kai Fricke 2022-04-26 13:16:48 +01:00 committed by GitHub
parent f7be409462
commit 4b6e79d713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ it needs not to have dependencies on serve's conftest.py.
"""
import os
import sys
import pytest
@ -14,11 +15,11 @@ import pytest
reason="This test is only run in CI with a minimal Ray installation.",
)
def test_error_msg():
with pytest.raises(ModuleNotFoundError, match="install 'ray\[serve\]'"):
with pytest.raises(ModuleNotFoundError, match=r'.*install "ray\[serve\]".*'):
from ray import serve
serve.start()
if __name__ == "__main__":
pytest.main(["-v", "-s", __file__])
sys.exit(pytest.main(["-v", "-s", __file__]))