Skip to content

Commit fec833f

Browse files
fix test run file and outputDir presence
1 parent d07dc89 commit fec833f

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

nfgda_service/main.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ async def process_job(job_id: str) -> None:
5858
job_key = f"job:{job_id}"
5959
job_fields = redis_client.hgetall(job_key)
6060
out_dir = format_output_directory(job_id)
61-
upate_redis_with_output_dir(job_id, out_dir)
6261

6362
logger.info("processing job %s", job_id)
6463
service = NfgdaService(redis_client, job_id, job_fields, out_dir)
@@ -90,10 +89,6 @@ async def run_and_release_job(job_id: str) -> None:
9089
# they took my jerb!
9190
job_semaphore.release()
9291

93-
def upate_redis_with_output_dir(job_id: str, out_dir: str) -> None:
94-
"""Update Redis with the output directory for a job."""
95-
redis_client.hset(f"job:{job_id}", "outputDir", out_dir)
96-
9792
def format_output_directory(job_id: str) -> str:
9893
"""Format the output directory for a job."""
9994
out_dir = f"/nfgda_output/{job_id}/"

test_run_requests.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"""
33
End-to-end integration test:
44
5-
1. GET /APIs/stations → fetch the station list
5+
1. GET /apis/stations → fetch the station list
66
2. Randomly select one station
7-
3. POST /APIs/run → submit a job for that station
8-
4. Poll GET /APIs/status until the job reaches COMPLETED (or FAILED)
7+
3. POST /apis/run → submit a job for that station
8+
4. Poll GET /apis/status until the job reaches COMPLETED (or FAILED)
99
5. GET /api/jobs/<job_id>/frames/<index> → fetch every produced frame
1010
"""
1111

@@ -29,8 +29,8 @@ def main():
2929

3030
# ── 1. Fetch station list ────────────────────────────────────────
3131
print(f"\n{'='*60}")
32-
print("Step 1: GET /APIs/stations")
33-
resp = requests.get(f"{BASE_URL}/APIs/stations")
32+
print("Step 1: GET /apis/stations")
33+
resp = requests.get(f"{BASE_URL}/apis/stations")
3434
print(f" status: {resp.status_code}")
3535
if resp.status_code != 200:
3636
print(f" FAILED — {resp.text[:200]}")
@@ -55,10 +55,10 @@ def main():
5555
}
5656

5757
print(f"\n{'='*60}")
58-
print("Step 3: POST /APIs/run")
58+
print("Step 3: POST /apis/run")
5959
print(f" payload: {json.dumps(payload, indent=2)}")
6060

61-
resp = requests.post(f"{BASE_URL}/APIs/run", json=payload)
61+
resp = requests.post(f"{BASE_URL}/apis/run", json=payload)
6262
body = resp.json()
6363
print(f" status: {resp.status_code}")
6464
print(f" response: {json.dumps(body, indent=2)}")
@@ -81,7 +81,7 @@ def main():
8181
time.sleep(5)
8282
print(f"\n --- Poll #{poll} ---")
8383

84-
resp = requests.get(f"{BASE_URL}/APIs/status", params={"job_id": job_id})
84+
resp = requests.get(f"{BASE_URL}/apis/status", params={"job_id": job_id})
8585
try:
8686
status_body = resp.json()
8787
except requests.exceptions.JSONDecodeError:
@@ -108,7 +108,7 @@ def main():
108108
print(f"Step 5: Fetching {num_frames} frame(s) for job {job_id}")
109109

110110
for index in range(num_frames):
111-
url = f"{BASE_URL}/APIs/jobs/{job_id}/frames/{index}"
111+
url = f"{BASE_URL}/apis/jobs/{job_id}/frames/{index}"
112112
print(f"\n GET {url}")
113113
resp = requests.get(url)
114114
if resp.status_code == 200:

0 commit comments

Comments
 (0)