-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
475 additions
and
58 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 |
---|---|---|
@@ -1,2 +1,9 @@ | ||
__pycache__ | ||
.pytest | ||
|
||
# pycharm | ||
.idea/ | ||
|
||
# text editors | ||
*.sw? | ||
*~ |
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,7 @@ | ||
#!/usr/bin/bash | ||
|
||
cat <"EOF" | ||
1044785|RUNNING|0:0 | ||
1044785.extern|RUNNING|0:0 | ||
1044785.0|RUNNING|0:0 | ||
EOF |
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,7 @@ | ||
#!/usr/bin/bash | ||
|
||
cat <<"EOF" | ||
JOBID,STATE | ||
1044785,RUNNING | ||
1044875,RUNNING | ||
EOF |
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,31 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
import os | ||
import signal | ||
import subprocess | ||
import tempfile | ||
import time | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.slow | ||
@pytest.mark.timeout(60) | ||
def test_cluster_sidecar_smoke(): | ||
env = dict(os.environ) | ||
env["PATH"] = ( | ||
os.path.realpath(os.path.dirname(__file__) + "/mock-slurm/bin") + ":" + env.get("PATH") | ||
) | ||
path_sidecar_py = os.path.realpath( | ||
os.path.dirname(__file__) + "/../{{cookiecutter.profile_name}}/slurm-sidecar.py" | ||
) | ||
with tempfile.TemporaryFile("w+t") as tmpf: | ||
with subprocess.Popen(["python", path_sidecar_py], env=env, text=True, stdout=tmpf) as proc: | ||
time.sleep(2) | ||
os.kill(proc.pid, signal.SIGTERM) | ||
tmpf.seek(0) | ||
stdout = tmpf.read() | ||
the_vars = json.loads(stdout.splitlines()[0]) | ||
assert "server_port" in the_vars | ||
assert "server_secret" in the_vars | ||
assert proc.returncode == 0 |
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
Oops, something went wrong.