mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[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:
parent
f7be409462
commit
4b6e79d713
1 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ it needs not to have dependencies on serve's conftest.py.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -14,11 +15,11 @@ import pytest
|
||||||
reason="This test is only run in CI with a minimal Ray installation.",
|
reason="This test is only run in CI with a minimal Ray installation.",
|
||||||
)
|
)
|
||||||
def test_error_msg():
|
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
|
from ray import serve
|
||||||
|
|
||||||
serve.start()
|
serve.start()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
pytest.main(["-v", "-s", __file__])
|
sys.exit(pytest.main(["-v", "-s", __file__]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue