Skip to content

Commit 6af24dd

Browse files
committed
Use the python path from virtualenv in end to end tests
Signed-off-by: hemildesai <[email protected]>
1 parent 87a9c20 commit 6af24dd

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

end-to-end-test/end_to_end_test/test_checkout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import os
66
import subprocess
77
import pytest # type: ignore
8-
from .utils import get_env
8+
9+
from .utils import get_env, PYTHON_PATH
910

1011

1112
@pytest.mark.parametrize(
@@ -69,7 +70,7 @@ def main():
6970
)
7071

7172
env = get_env()
72-
cmd = ["python", "train.py"]
73+
cmd = [PYTHON_PATH, "train.py"]
7374
subprocess.run(cmd, cwd=tmpdir, env=env, check=True)
7475

7576
experiments = json.loads(

end-to-end-test/end_to_end_test/test_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
import pytest # type: ignore
66

7-
from .utils import path_exists, get_env
7+
from .utils import path_exists, get_env, PYTHON_PATH
88

99

1010
@pytest.mark.parametrize(
@@ -57,7 +57,7 @@ def main():
5757
)
5858

5959
env = get_env()
60-
cmd = ["python", "train.py", "--foo"]
60+
cmd = [PYTHON_PATH, "train.py", "--foo"]
6161
subprocess.run(cmd, cwd=tmpdir, env=env, check=True)
6262

6363
experiments = json.loads(

end-to-end-test/end_to_end_test/test_list.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # type: ignore
55
from dateutil.parser import parse as parse_date
66

7-
from .utils import get_env
7+
from .utils import get_env, PYTHON_PATH
88

99

1010
@pytest.mark.parametrize(
@@ -58,7 +58,7 @@ def main():
5858

5959
env = get_env()
6060

61-
subprocess.run(["python", "train.py", "--foo"], cwd=tmpdir, env=env, check=True)
61+
subprocess.run([PYTHON_PATH, "train.py", "--foo"], cwd=tmpdir, env=env, check=True)
6262

6363
experiments = json.loads(
6464
subprocess.run(
@@ -106,7 +106,9 @@ def main():
106106
experiment.checkpoint(path=".", step=3)
107107
"""
108108
)
109-
subprocess.run(["python", "train2.py", exp["id"]], cwd=tmpdir, env=env, check=True)
109+
subprocess.run(
110+
[PYTHON_PATH, "train2.py", exp["id"]], cwd=tmpdir, env=env, check=True
111+
)
110112
experiments = json.loads(
111113
subprocess.run(
112114
["replicate", "--verbose", "list", "--json"],

end-to-end-test/end_to_end_test/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from google.cloud import storage as google_storage
66

77
ROOT_DIRECTORY = Path(__file__).parent.parent.parent
8+
PYTHON_PATH = os.path.abspath(os.path.join(ROOT_DIRECTORY, "venv/bin/python"))
89

910

1011
def get_env():

0 commit comments

Comments
 (0)