diff --git a/jobs.py b/jobs.py index 95617df..42b5ce7 100644 --- a/jobs.py +++ b/jobs.py @@ -854,7 +854,7 @@ def run_debug_jobs() -> None: refresh_airflow_fleet_health_cache_job() post_inactive_engineers() post_priority_bugs() - # post_leaderboard() + post_leaderboard() # post_weekly_changelog() post_stale() post_overdue_projects() @@ -883,7 +883,7 @@ def configure_scheduled_jobs() -> None: schedule.every().friday.at("13:00").do(post_inactive_engineers) schedule.every().day.at("12:00").do(post_priority_bugs) - # schedule.every().friday.at("20:00").do(post_leaderboard) + schedule.every().friday.at("20:00").do(post_leaderboard) # schedule.every().thursday.at("19:00").do(post_weekly_changelog) schedule.every().day.at("14:00").do(post_stale) schedule.every().day.at("14:00", "America/New_York").do(post_overdue_projects) diff --git a/tests/test_jobs.py b/tests/test_jobs.py index ae4a6a0..e2135b6 100644 --- a/tests/test_jobs.py +++ b/tests/test_jobs.py @@ -172,6 +172,16 @@ def fake_every(interval=None): }, recorded_jobs, ) + self.assertIn( + { + "interval": None, + "unit": "friday", + "at_time": "20:00", + "timezone": None, + "func": jobs_module.post_leaderboard, + }, + recorded_jobs, + ) self.assertIn( { "interval": None, @@ -215,21 +225,23 @@ def fake_every(interval=None): class RunDebugJobsTest(unittest.TestCase): - def test_runs_overdue_projects_upcoming_projects_and_friday_deadlines(self): + def test_runs_leaderboard_overdue_projects_upcoming_projects_and_friday_deadlines(self): with patch.object(jobs_module, "should_use_redis_cache", return_value=False): with patch.object(jobs_module, "post_priority_bugs"): - with patch.object(jobs_module, "post_stale") as stale: - with patch.object( - jobs_module, "post_overdue_projects" - ) as overdue: + with patch.object(jobs_module, "post_leaderboard") as leaderboard: + with patch.object(jobs_module, "post_stale") as stale: with patch.object( - jobs_module, "post_upcoming_projects" - ) as upcoming: + jobs_module, "post_overdue_projects" + ) as overdue: with patch.object( - jobs_module, "post_friday_deadlines" - ) as friday_deadlines: - jobs_module.run_debug_jobs() - + jobs_module, "post_upcoming_projects" + ) as upcoming: + with patch.object( + jobs_module, "post_friday_deadlines" + ) as friday_deadlines: + jobs_module.run_debug_jobs() + + leaderboard.assert_called_once_with() stale.assert_called_once_with() overdue.assert_called_once_with() upcoming.assert_called_once_with()