[Project] Implementing Project CLI (#5397)

This commit is contained in:
Simon Mo
2019-08-08 21:28:25 -07:00
committed by Philipp Moritz
parent 592f313210
commit d9b45cceec
9 changed files with 186 additions and 21 deletions
+8 -2
View File
@@ -16,7 +16,7 @@ TEST_DIR = os.path.dirname(os.path.abspath(__file__))
def load_project_description(project_file):
path = os.path.join(TEST_DIR, "project_files", project_file)
with open(path) as f:
return yaml.load(f)
return yaml.safe_load(f)
def test_validation_success():
@@ -58,4 +58,10 @@ def test_project_root():
def test_project_validation():
path = os.path.join(TEST_DIR, "project_files", "project1")
subprocess.check_call(["ray", "session", "create", "--dry"], cwd=path)
subprocess.check_call(["ray", "project", "validate"], cwd=path)
def test_project_no_validation():
path = os.path.join(TEST_DIR, "project_files")
with pytest.raises(subprocess.CalledProcessError):
subprocess.check_call(["ray", "project", "validate"], cwd=path)