Exemplo n.º 1
0
    def test_unknown_failure_type(self):
        class UnknownFailure(TestFailure):
            def message(self):
                return ''

        failure_obj = UnknownFailure()
        with self.assertRaises(ValueError):
            determine_result_type([failure_obj])
Exemplo n.º 2
0
    def __init__(self,
                 test_name,
                 failures=None,
                 test_run_time=None,
                 has_stderr=False,
                 reftest_type=None,
                 pid=None,
                 references=None):
        self.test_name = test_name
        self.failures = failures or []
        self.test_run_time = test_run_time or 0  # The time taken to execute the test itself.
        self.has_stderr = has_stderr
        self.reftest_type = reftest_type or []
        self.pid = pid
        self.references = references or []

        # FIXME: Setting this in the constructor makes this class hard to mutate.
        self.type = test_failures.determine_result_type(failures)

        # These are set by the worker, not by the driver, so they are not passed to the constructor.
        self.worker_name = ''
        self.shard_name = ''
        self.total_run_time = 0  # The time taken to run the test plus any references, compute diffs, etc.
        self.test_number = None
        self.is_other_crash = False
Exemplo n.º 3
0
    def __init__(self, port, builder_name, build_name, build_number,
        results_file_base_path, builder_base_url,
        test_timings, expectations, result_summary, all_tests,
        test_results_server=None, test_type="", master_name=""):
        """Modifies the results.json file. Grabs it off the archive directory
        if it is not found locally.

        Args:
          result_summary: ResultsSummary object storing the summary of the test
              results.
        """
        super(JSONLayoutResultsGenerator, self).__init__(
            port, builder_name, build_name, build_number, results_file_base_path,
            builder_base_url, {}, port.repository_paths(),
            test_results_server, test_type, master_name)

        self._expectations = expectations

        self._result_summary = result_summary
        self._failures = dict((test_name, test_failures.determine_result_type(failures))
            for (test_name, failures) in result_summary.failures.iteritems())
        self._all_tests = all_tests
        self._test_timings = dict((test_tuple.test_name, test_tuple.test_run_time) for test_tuple in test_timings)

        self.generate_json_output()
Exemplo n.º 4
0
 def __init__(self, test_name, failures=None, test_run_time=None, has_stderr=False):
     self.test_name = test_name
     self.failures = failures or []
     self.test_run_time = test_run_time or 0
     self.has_stderr = has_stderr
     # FIXME: Setting this in the constructor makes this class hard to mutate.
     self.type = test_failures.determine_result_type(failures)
Exemplo n.º 5
0
 def __init__(self, test_name, failures=None, test_run_time=None, has_stderr=False, reftest_type=[]):
     self.test_name = test_name
     self.failures = failures or []
     self.test_run_time = test_run_time or 0
     self.has_stderr = has_stderr
     self.reftest_type = reftest_type
     # FIXME: Setting this in the constructor makes this class hard to mutate.
     self.type = test_failures.determine_result_type(failures)
Exemplo n.º 6
0
    def __init__(self, test_name, failures=None, test_run_time=None, has_stderr=False, reftest_type=[]):
        self.test_name = test_name
        self.failures = failures or []
        self.test_run_time = test_run_time or 0  # The time taken to execute the test itself.
        self.has_stderr = has_stderr
        self.reftest_type = reftest_type

        # FIXME: Setting this in the constructor makes this class hard to mutate.
        self.type = test_failures.determine_result_type(failures)

        # These are set by the worker, not by the driver, so they are not passed to the constructor.
        self.worker_name = ''
        self.shard_name = ''
        self.total_run_time = 0  # The time taken to run the test plus any references, compute diffs, etc.
    def __init__(self,
                 port,
                 builder_name,
                 build_name,
                 build_number,
                 results_file_base_path,
                 builder_base_url,
                 test_timings,
                 expectations,
                 result_summary,
                 all_tests,
                 test_results_server=None,
                 test_type="",
                 master_name=""):
        """Modifies the results.json file. Grabs it off the archive directory
        if it is not found locally.

        Args:
          result_summary: ResultsSummary object storing the summary of the test
              results.
        """
        super(JSONLayoutResultsGenerator,
              self).__init__(port, builder_name, build_name, build_number,
                             results_file_base_path, builder_base_url, {},
                             port.test_repository_paths(), test_results_server,
                             test_type, master_name)

        self._expectations = expectations

        self._result_summary = result_summary
        self._failures = dict(
            (test_name, test_failures.determine_result_type(failures))
            for (test_name, failures) in result_summary.failures.iteritems())
        self._all_tests = all_tests
        self._test_timings = dict(
            (test_tuple.test_name, test_tuple.test_run_time)
            for test_tuple in test_timings)

        self.generate_json_output()
Exemplo n.º 8
0
 def convert_to_failure(self, failure_result):
     if self.type is failure_result.type:
         return
     self.failures.extend(failure_result.failures)
     self.type = test_failures.determine_result_type(self.failures)