Skip to content

Commit e63bc1b

Browse files
author
Bihan Jiang
committed
fix tests add progress fields
1 parent 2f7a913 commit e63bc1b

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

tests/test_dataset.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def test_dataset_append_async(dataset: Dataset):
227227
"image_upload_step": {"errored": 0, "pending": 0, "completed": 5},
228228
"started_image_processing": f"Dataset: {dataset.id}, Job: {job.job_id}",
229229
},
230+
"job_progress": "1.00",
231+
"completed_steps": 5,
232+
"total_steps": 5,
230233
}
231234

232235

@@ -256,6 +259,9 @@ def test_dataset_append_async_with_1_bad_url(dataset: Dataset):
256259
"image_upload_step": {"errored": 1, "pending": 0, "completed": 4},
257260
"started_image_processing": f"Dataset: {dataset.id}, Job: {job.job_id}",
258261
},
262+
"job_progress": "1.00",
263+
"completed_steps": 4,
264+
"total_steps": 4,
259265
}
260266
# The error is fairly detailed and subject to change. What's important is we surface which URLs failed.
261267
assert (
@@ -337,6 +343,9 @@ def test_annotate_async(dataset: Dataset):
337343
"processed": 1,
338344
},
339345
},
346+
"job_progress": "1.00",
347+
"completed_steps": 3,
348+
"total_steps": 3,
340349
}
341350

342351

@@ -372,6 +381,9 @@ def test_annotate_async_with_error(dataset: Dataset):
372381
"processed": 1,
373382
},
374383
},
384+
"job_progress": "0.67",
385+
"completed_steps": 2,
386+
"total_steps": 3,
375387
}
376388

377389
assert "Item with id fake_garbage doesn" in str(job.errors())

tests/test_prediction.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ def test_mixed_pred_upload_async(model_run: ModelRun):
307307
"processed": 1,
308308
},
309309
},
310+
"job_progress": "1.00",
311+
"completed_steps": 3,
312+
"total_steps": 3,
310313
}
311314

312315

@@ -345,6 +348,9 @@ def test_mixed_pred_upload_async_with_error(model_run: ModelRun):
345348
"processed": 1,
346349
},
347350
},
351+
"job_progress": "0.67",
352+
"completed_steps": 2,
353+
"total_steps": 3,
348354
}
349355

350356
assert "Item with id fake_garbage doesn" in str(job.errors())

tests/test_scene.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def test_scene_upload_async(dataset):
6868
"scenes_errored": 0,
6969
}
7070
},
71+
"job_progress": "1.00",
72+
"completed_steps": 1,
73+
"total_steps": 1,
7174
}
7275

7376

0 commit comments

Comments
 (0)