Skip to content

Commit 9f7ccfa

Browse files
fix(e2e): use --active to skip per-project venv sync in provisioner (#329)
* fix(e2e): use --active to skip per-project venv sync in provisioner uv run without --active creates a project-specific venv from the temp dir's pyproject.toml, which contains runpod-flash @ git+https://... The private repo fetch fails on CI runners that have no git credentials. The outer CI venv (uv sync --all-groups) already has the correct flash version installed, so --active uses it directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): use --no-project to skip pyproject.toml sync in provisioner --active was not sufficient: uv still reads the pyproject.toml and tries to sync the git dep into the active env, hitting the same auth wall. --no-project skips project discovery entirely so uv uses the outer CI venv (which already has the correct flash installed) without touching the private git dep. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): apply --no-project to all uv run flash calls in test files Same fix as provisioner.py: all deploy/undeploy calls in test files run in temp dirs with a pyproject.toml that references the private git dep, causing uv to attempt an authenticated fetch before executing the command. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * style: ruff format test_cpu_smoke and test_gpu_smoke Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(e2e): inject extra_deps via --with and fix LOG_LEVEL for rolling release provisioner.py: --no-project skips the temp project venv, so extra_deps (numpy, pandas) aren't installed when flash validates the worker import. Pass each extra dep as --with <dep> so uv injects them into the run env. test_rolling_release.py: the "updating endpoint" check reads from log.debug() in serverless.py. LOG_LEVEL=INFO silences it; switch to DEBUG. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 81f66df commit 9f7ccfa

5 files changed

Lines changed: 33 additions & 11 deletions

File tree

e2e/provisioner.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ def provision(
9898
env = os.environ.copy()
9999
env["RUNPOD_API_KEY"] = api_key # explicit — does not depend on autouse fixture
100100

101+
uv_cmd = ["uv", "run", "--no-project"]
102+
if extra_deps:
103+
for dep in extra_deps:
104+
uv_cmd.extend(["--with", dep])
105+
uv_cmd.extend(["flash", "deploy"])
106+
101107
try:
102108
result = subprocess.run(
103-
["uv", "run", "flash", "deploy"],
109+
uv_cmd,
104110
cwd=tmp_dir,
105111
env=env,
106112
capture_output=True,

e2e/test_cpu_smoke.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_deploy_invoke_undeploy(self, tmp_path: Path) -> None:
4444

4545
try:
4646
result = subprocess.run(
47-
["uv", "run", "flash", "deploy"],
47+
["uv", "run", "--no-project", "flash", "deploy"],
4848
cwd=tmp_path,
4949
env=env,
5050
capture_output=True,
@@ -71,7 +71,15 @@ def test_deploy_invoke_undeploy(self, tmp_path: Path) -> None:
7171
# Exercise the undeploy CLI path; sweep catches any quota leak if this fails.
7272
try:
7373
undeploy = subprocess.run(
74-
["uv", "run", "flash", "undeploy", WORKER_NAME, "--force"],
74+
[
75+
"uv",
76+
"run",
77+
"--no-project",
78+
"flash",
79+
"undeploy",
80+
WORKER_NAME,
81+
"--force",
82+
],
7583
cwd=tmp_path,
7684
env=env,
7785
capture_output=True,

e2e/test_gpu_smoke.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_deploy_invoke_undeploy(self, tmp_path: Path, api_key: str) -> None:
4343

4444
try:
4545
result = subprocess.run(
46-
["uv", "run", "flash", "deploy"],
46+
["uv", "run", "--no-project", "flash", "deploy"],
4747
cwd=tmp_path,
4848
env=env,
4949
capture_output=True,
@@ -68,7 +68,15 @@ def test_deploy_invoke_undeploy(self, tmp_path: Path, api_key: str) -> None:
6868
finally:
6969
try:
7070
subprocess.run(
71-
["uv", "run", "flash", "undeploy", _WORKER_NAME, "--force"],
71+
[
72+
"uv",
73+
"run",
74+
"--no-project",
75+
"flash",
76+
"undeploy",
77+
_WORKER_NAME,
78+
"--force",
79+
],
7280
cwd=tmp_path,
7381
env=env,
7482
capture_output=True,

e2e/test_redeploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def echo(msg: str = "") -> dict:
6767
def _deploy(code: str, name: str, tmp_path: Path, env: dict, label: str = "") -> None:
6868
(tmp_path / "worker.py").write_text(code)
6969
r = subprocess.run(
70-
["uv", "run", "flash", "deploy"],
70+
["uv", "run", "--no-project", "flash", "deploy"],
7171
cwd=tmp_path,
7272
env=env,
7373
capture_output=True,
@@ -81,7 +81,7 @@ def _deploy(code: str, name: str, tmp_path: Path, env: dict, label: str = "") ->
8181
def _undeploy(name: str, cwd: Path, env: dict) -> None:
8282
try:
8383
subprocess.run(
84-
["uv", "run", "flash", "undeploy", name, "--force"],
84+
["uv", "run", "--no-project", "flash", "undeploy", name, "--force"],
8585
cwd=cwd,
8686
env=env,
8787
capture_output=True,

e2e/test_rolling_release.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def echo(msg: str = "") -> dict:
5656
def _deploy(code: str, name: str, cwd: Path, env: dict) -> subprocess.CompletedProcess:
5757
(cwd / "worker.py").write_text(code)
5858
return subprocess.run(
59-
["uv", "run", "flash", "deploy"],
59+
["uv", "run", "--no-project", "flash", "deploy"],
6060
cwd=cwd,
6161
env=env,
6262
capture_output=True,
@@ -68,7 +68,7 @@ def _deploy(code: str, name: str, cwd: Path, env: dict) -> subprocess.CompletedP
6868
def _undeploy(name: str, cwd: Path, env: dict) -> None:
6969
try:
7070
subprocess.run(
71-
["uv", "run", "flash", "undeploy", name, "--force"],
71+
["uv", "run", "--no-project", "flash", "undeploy", name, "--force"],
7272
cwd=cwd,
7373
env=env,
7474
capture_output=True,
@@ -84,8 +84,8 @@ def _deploy_env(api_key: str) -> dict:
8484
env["RUNPOD_API_KEY"] = api_key
8585
env["NO_COLOR"] = "1" # strip ANSI from rich output so stdout is plain text
8686
env.setdefault(
87-
"LOG_LEVEL", "INFO"
88-
) # ensure log.info("Updating endpoint") appears in captured output
87+
"LOG_LEVEL", "DEBUG"
88+
) # log.debug("updating endpoint...") in serverless.py — needs DEBUG level
8989
return env
9090

9191

0 commit comments

Comments
 (0)