Skip to content

Commit

Permalink
bug 729634 - add update_nightly_builds cron
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer committed Mar 30, 2012
1 parent 376480d commit e3eee98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions socorro/cron/dailyMatviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def update(config, targetDate):
['update_product_versions' 'update_signatures']),
('update_hang_report', [targetDate], []),
('update_rank_compare', [targetDate], []),
('update_nightly_builds', [targetDate], []),
)

failed = set()
Expand Down
15 changes: 11 additions & 4 deletions socorro/unittest/cron/testDailyMatviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def test_failing__update_product_versions(self):
self.assertEqual(cursor.called, ['update_product_versions',
'update_signatures', 'update_os_versions', 'update_adu',
'update_daily_crashes', 'update_hang_report',
'update_rank_compare'])
self.assertEqual(mock_logger.info.call_count, 7)
'update_rank_compare', 'update_nightly_builds'])
self.assertEqual(mock_logger.info.call_count, 8)
self.assertEqual(mock_logger.warn.call_count, 2)
self.assertEqual(mock_logger.error.call_count, 0)

Expand All @@ -84,7 +84,7 @@ def test_all_works(self):
dailyMatviews.psycopg2 = mock_psycopg2(cursor)
with patch('socorro.cron.dailyMatviews.logger') as mock_logger:
dailyMatviews.update(self.config, 'some date')
self.assertEqual(mock_logger.info.call_count, 8)
self.assertEqual(mock_logger.info.call_count, 9)
self.assertEqual(mock_logger.warn.call_count, 0)
self.assertEqual(mock_logger.error.call_count, 0)

Expand All @@ -95,7 +95,7 @@ def test_mock_internal_error(self):
dailyMatviews.psycopg2 = mock_psycopg2(cursor)
with patch('socorro.cron.dailyMatviews.logger') as mock_logger:
dailyMatviews.update(self.config, 'some date')
self.assertEqual(mock_logger.info.call_count, 7)
self.assertEqual(mock_logger.info.call_count, 8)
self.assertEqual(mock_logger.warn.call_count, 1)
self.assertEqual(mock_logger.error.call_count, 1)

Expand Down Expand Up @@ -182,6 +182,12 @@ def setUp(self):
BEGIN
RETURN true;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION update_nightly_builds(timestamp with time zone)
RETURNS boolean AS $$
BEGIN
RETURN true;
END;
$$ LANGUAGE plpgsql;
""")
Expand All @@ -199,6 +205,7 @@ def tearDown(self):
DROP FUNCTION update_daily_crashes (timestamp with time zone) ;
DROP FUNCTION update_hang_report(timestamp with time zone) ;
DROP FUNCTION update_rank_compare(timestamp with time zone) ;
DROP FUNCTION update_nightly_builds(timestamp with time zone) ;
""")
self.connection.commit()

Expand Down

0 comments on commit e3eee98

Please sign in to comment.