Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Limit test results provided to email templates
Browse files Browse the repository at this point in the history
Summary:
This is mostly a self-defense measure, to keep from potentially processing
thousands and thousands of tests.
If users want more than a handful of tests, they can go to the UI.
Since we also report the test count, the risk of users assuming they're seeing
the complete failed picture is reduced.

Test Plan: Existing

Reviewers: paulruan

Reviewed By: paulruan

Subscribers: anupc

Differential Revision: https://tails.corp.dropbox.com/D232011
  • Loading branch information
kylec1 committed Sep 26, 2016
1 parent f6aa9c1 commit e376ced
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions changes/lib/build_context_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _get_build_context(build, get_parent=True):

def _get_job_context(job):
# type: (Job) -> Dict[str, Any]
def get_job_failing_tests(job):
def get_job_failing_tests(job, limit=30):
failing_tests = TestCase.query.options(
subqueryload_all('messages')
).filter(
Expand All @@ -198,7 +198,7 @@ def get_job_failing_tests(job):
'test_case': test_case,
'uri': build_web_uri(_get_test_case_uri(test_case)),
'message': xunit.get_testcase_messages(test_case),
} for test_case in failing_tests
} for test_case in failing_tests[:limit]
]
failing_tests_count = len(failing_tests)

Expand Down

0 comments on commit e376ced

Please sign in to comment.