def get_push_health_test_failures(push, repository_ids): # query for jobs for the last two weeks excluding today # find tests that have failed in the last 14 days # this is very cache-able for reuse on other pushes. option_map = OptionCollection.objects.get_option_collection_map() push_date = push.time.date() intermittent_history, cache_key = get_history( 4, push_date, intermittent_history_days, option_map, repository_ids) fixed_by_commit_history, cache_key = get_history( 2, push_date, fixed_by_commit_history_days, option_map, repository_ids) push_failures = get_push_failures(push, option_map) filtered_push_failures = [ failure for failure in push_failures if filter_failure(failure) ] set_classifications( filtered_push_failures, intermittent_history, fixed_by_commit_history, ) set_matching_passed_jobs(filtered_push_failures, push) return get_grouped(filtered_push_failures)
def get_test_failures(push, repository_ids): # query for jobs for the last two weeks excluding today # find tests that have failed in the last 14 days # this is very cache-able for reuse on other pushes. option_map = OptionCollection.objects.get_option_collection_map() push_date = push.time.date() intermittent_history, cache_key = get_history( 4, push_date, intermittent_history_days, option_map, repository_ids) fixed_by_commit_history, cache_key = get_history( 2, push_date, fixed_by_commit_history_days, option_map, repository_ids) push_failures, unsupported_jobs = get_current_test_failures(push, option_map) filtered_push_failures = [ failure for failure in push_failures if filter_failure(failure) ] set_classifications( filtered_push_failures, intermittent_history, fixed_by_commit_history, ) set_matching_passed_jobs(filtered_push_failures, push) failures = get_grouped(filtered_push_failures) failures['unsupported'] = unsupported_jobs return failures
def get_test_failures(push, repository_ids): logger.info('Getting test failures for push: {}'.format(push.id)) # query for jobs for the last two weeks excluding today # find tests that have failed in the last 14 days # this is very cache-able for reuse on other pushes. # option_map is used to map platforms for the job.option_collection_hash option_map = OptionCollection.objects.get_option_collection_map() push_date = push.time.date() intermittent_history, cache_key = get_history( 4, push_date, intermittent_history_days, option_map, repository_ids) fixed_by_commit_history, cache_key = get_history( 2, push_date, fixed_by_commit_history_days, option_map, repository_ids) # ``push_failures`` are tests that have FailureLine records created by out Log Parser. # These are tests we are able to show to examine to see if we can determine they are # intermittent. If they are not, we tell the user they need investigation. # ``unsupported_jobs`` are jobs that either don't have an ``*_errorsummary.log`` file, # or have one that does not have enough information for us to interpret. So we place # these jobs into the "Unsupported" category. The jobs either need to change either at # the test-level or harness level so we can interpret them. In some cases, the Treeherder # code here can be updated to interpret information we don't currently handle. # These are failures ONLY for the current push, not relative to history. push_failures, unsupported_jobs = get_current_test_failures(push, option_map) filtered_push_failures = [ failure for failure in push_failures if filter_failure(failure) ] # Based on the intermittent and FixedByCommit history, set the appropriate classification # where we think each test falls. set_classifications( filtered_push_failures, intermittent_history, fixed_by_commit_history, ) # If we have failed tests that have also passed, we gather them both. This helps us determine # if a job is intermittent based on the current push results. set_matching_passed_jobs(filtered_push_failures, push) failures = get_grouped(filtered_push_failures) failures['unsupported'] = unsupported_jobs return failures