File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,18 @@ def test_upload_task_call_new_ta_tasks(
507507 dbsession .flush ()
508508 dbsession .refresh (commit )
509509
510+ mock_repo_provider_service .get_commit .return_value = {
511+ "author" : {
512+ "id" : "123" ,
513+ "username" : "456" ,
514+ "email" : "789" ,
515+ "name" : "101" ,
516+ },
517+ "message" : "hello world" ,
518+ "parents" : [],
519+ "timestamp" : str (NEW_TA_TASKS_CUTOFF_DATE - timedelta (days = 10 )),
520+ }
521+
510522 mock_redis .lists [f"uploads/{ commit .repoid } /{ commit .commitid } /test_results" ] = (
511523 jsonified_redis_queue
512524 )
Original file line number Diff line number Diff line change @@ -756,18 +756,17 @@ def _schedule_ta_processing_task(
756756 new_ta_tasks = "old"
757757 else :
758758 db_session : Session = commit .get_db_session () # type: ignore
759- earliest_commit = (
759+ commit_before_cutoff = (
760760 db_session .query (Commit )
761761 .filter (
762762 Commit .repoid == commit .repoid ,
763- Commit .timestamp > NEW_TA_TASKS_CUTOFF_DATE ,
763+ Commit .timestamp < NEW_TA_TASKS_CUTOFF_DATE ,
764764 )
765- .order_by (Commit .timestamp )
766765 .limit (1 )
767766 .first ()
768767 )
769768
770- if earliest_commit :
769+ if commit_before_cutoff is None :
771770 new_ta_tasks = "new"
772771 new_ta_tasks_repo_summary .inc ()
773772
You can’t perform that action at this time.
0 commit comments