mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Add unit test for ray cluster-dump (#14389)
This commit is contained in:
parent
f9364b1d5c
commit
b1d0aa9798
2 changed files with 40 additions and 0 deletions
|
@ -443,5 +443,29 @@ def test_ray_status():
|
|||
_check_output_via_pattern("test_ray_status.txt", result_env_arg)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "darwin" and "travis" in os.environ.get("USER", ""),
|
||||
reason=("Mac builds don't provide proper locale support"))
|
||||
@mock_ec2
|
||||
@mock_iam
|
||||
def test_ray_cluster_dump(configure_lang, configure_aws, _unlink_test_ssh_key):
|
||||
def commands_mock(command, stdin):
|
||||
print("This is a test!")
|
||||
return PopenBehaviour(stdout=b"This is a test!")
|
||||
|
||||
with _setup_popen_mock(commands_mock):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(scripts.up, [
|
||||
DEFAULT_TEST_CONFIG_PATH, "--no-config-cache", "-y",
|
||||
"--log-style=pretty", "--log-color", "False"
|
||||
])
|
||||
_die_on_error(result)
|
||||
|
||||
result = runner.invoke(scripts.cluster_dump,
|
||||
[DEFAULT_TEST_CONFIG_PATH, "--no-processes"])
|
||||
|
||||
_check_output_via_pattern("test_ray_cluster_dump.txt", result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(pytest.main(["-v", __file__]))
|
||||
|
|
16
python/ray/tests/test_cli_patterns/test_ray_cluster_dump.txt
Normal file
16
python/ray/tests/test_cli_patterns/test_ray_cluster_dump.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
You are about to create a cluster dump\. This will collect data from cluster nodes\.
|
||||
|
||||
The dump will contain this information:
|
||||
|
||||
- The logfiles of your Ray session
|
||||
This usually includes Python outputs \(stdout/stderr\)
|
||||
- Debug state information on your Ray cluster
|
||||
e\.g\. number of workers, drivers, objects, etc\.
|
||||
- Your installed Python packages \(`pip freeze`\)
|
||||
|
||||
If you are concerned about leaking private information, extract the archive and inspect its contents before sharing it with anyone\.
|
||||
Retrieving cluster information from ray cluster file: .+
|
||||
Checking AWS environment settings
|
||||
Collecting data from remote node: .+
|
||||
This is a test!
|
||||
Created archive: .+
|
Loading…
Add table
Reference in a new issue