-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Steal config files on 'job --pass-config' (#1361)
- Loading branch information
1 parent
3915c1e
commit bbbee68
Showing
11 changed files
with
92 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Steal config files on `neuro job --pass-config`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import shutil | ||
from pathlib import Path | ||
from typing import Any, Callable, List | ||
|
||
from neuromation.cli.utils import NEURO_STEAL_CONFIG | ||
|
||
from .conftest import SysCapWithCode | ||
|
||
|
||
_RunCli = Callable[[List[str]], SysCapWithCode] | ||
|
||
|
||
def test_steal_config( | ||
nmrc_path: Path, run_cli: _RunCli, tmp_path: Path, monkeypatch: Any | ||
) -> None: | ||
folder = shutil.move(nmrc_path, tmp_path / "orig-cfg") | ||
monkeypatch.setenv(NEURO_STEAL_CONFIG, str(folder)) | ||
ret = run_cli(["--neuromation-config", str(tmp_path / ".neuro"), "config", "show"]) | ||
assert ret.code == 0, ret | ||
|
||
|
||
def test_steal_config_dont_override_existing( | ||
nmrc_path: Path, run_cli: _RunCli, tmp_path: Path, monkeypatch: Any | ||
) -> None: | ||
folder = shutil.copytree(nmrc_path, tmp_path / "orig-cfg") | ||
monkeypatch.setenv(NEURO_STEAL_CONFIG, str(folder)) | ||
ret = run_cli(["--neuromation-config", str(nmrc_path), "config", "show"]) | ||
# FileExistsError | ||
assert ret.code == 74, ret | ||
assert "FileExistsError" in ret.err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters