Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
34 changes: 23 additions & 11 deletions tests/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down
Loading