Skip to content

Commit

Permalink
Remove unnecessary test file in wheel (ray-project#41775)
Browse files Browse the repository at this point in the history
This PR remove the test file in pip wheel which lead to the ray start failed
  • Loading branch information
fishbone authored Dec 12, 2023
1 parent f7a2b33 commit 1716b79
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 5 deletions.
4 changes: 3 additions & 1 deletion dashboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ py_test_run_all_subdirectory(
include = ["**/test*.py"],
exclude = [
"client/node_modules/**",
"modules/test/**",
"modules/job/tests/test_cli_integration.py",
"modules/job/tests/test_http_job_server.py",
"modules/node/tests/test_node.py",
Expand Down Expand Up @@ -87,18 +86,21 @@ py_test(
size = "small",
srcs = ["tests/test_state_head.py"],
tags = ["team:core"],
deps = [":conftest"],
)

py_test(
name = "test_serve_dashboard",
size = "large",
srcs = ["modules/serve/tests/test_serve_dashboard.py"],
tags = ["team:serve"],
deps = [":conftest"],
)

py_test(
name = "test_data_head",
size = "small",
srcs = ["modules/data/tests/test_data_head.py"],
tags = ["team:data"],
deps = [":conftest"],
)
Empty file removed dashboard/modules/test/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import aiohttp.web

import ray.dashboard.modules.test.test_consts as test_consts
import ray.dashboard.modules.test.test_utils as test_utils
import ray.dashboard.modules.tests.test_consts as test_consts
import ray.dashboard.modules.tests.test_utils as test_utils
import ray.dashboard.optional_utils as dashboard_optional_utils
import ray.dashboard.utils as dashboard_utils
from ray._private.ray_constants import env_bool
Expand Down Expand Up @@ -43,3 +43,7 @@ async def route_patch(self, req) -> aiohttp.web.Response:

async def run(self, server):
pass


if __name__ == "__main__":
pass
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
TEST_MODULE_ENVIRONMENT_KEY = "RAY_DASHBOARD_MODULE_TEST"

if __name__ == "__main__":
pass
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import aiohttp.web

import ray.dashboard.modules.test.test_consts as test_consts
import ray.dashboard.modules.test.test_utils as test_utils
import ray.dashboard.modules.tests.test_consts as test_consts
import ray.dashboard.modules.tests.test_utils as test_utils
import ray.dashboard.optional_utils as dashboard_optional_utils
import ray.dashboard.utils as dashboard_utils
from ray._private.ray_constants import env_bool
Expand Down Expand Up @@ -111,3 +111,7 @@ async def test_file(self, req) -> aiohttp.web.FileResponse:

async def run(self, server):
pass


if __name__ == "__main__":
pass
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ async def http_get(http_session, url, timeout_seconds=60):
with async_timeout.timeout(timeout_seconds):
async with http_session.get(url) as response:
return await response.json()


if __name__ == "__main__":
pass
Empty file removed dashboard/tests/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions dashboard/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import os
import pytest
import pathlib
from ray.tests.conftest import * # noqa


@pytest.fixture
def enable_test_module():
os.environ["RAY_DASHBOARD_MODULE_TEST"] = "true"
import ray.dashboard.tests

p = pathlib.Path(ray.dashboard.modules.__path__[0]) / "tests" / "__init__.py"
p.touch(exist_ok=False)
yield
os.environ.pop("RAY_DASHBOARD_MODULE_TEST", None)
p.unlink(missing_ok=False)


@pytest.fixture
Expand Down

0 comments on commit 1716b79

Please sign in to comment.