Skip to content
3 changes: 3 additions & 0 deletions cabot/cabotapp/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def default_calculate_debounced_passing(recent_results, debounce=0):
"""
if not recent_results:
return True
# fix when the first run, if the first 0 - debounce checks all error and mark result faild
if len(recent_results) < debounce:
return True
debounce_window = recent_results[:debounce + 1]
for r in debounce_window:
if r.succeeded:
Expand Down
1 change: 1 addition & 0 deletions cabot/cabotapp/models/jenkins_check_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def calculate_debounced_passing(self, recent_results, debounce=0):
return last_result.consecutive_failures <= debounce



class JenkinsConfig(models.Model):
name = models.CharField(max_length=30, blank=False)
jenkins_api = models.CharField(max_length=2000, blank=False)
Expand Down
1 change: 1 addition & 0 deletions cabot/cabotapp/tests/tests_jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_job_failing(self, mock_jenkins):
self.assertEqual(result.consecutive_failures, 1)
self.assertFalse(result.succeeded)


@freeze_time('2017-03-02 10:30')
@patch("cabot.cabotapp.jenkins._get_jenkins_client")
def test_job_queued_last_succeeded(self, mock_jenkins):
Expand Down
2 changes: 1 addition & 1 deletion cabot/cabotapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ def get(self, request):

return Response(users_json)


# Misc JSON api and other stuff


Expand Down