Make sure that all tests were executed successfully.
9647
private function checkIfWorkersCrashed(): void
    {
        if ($this->db->query('SELECT COUNT(id) FROM tests')->fetchColumn(0) === '0') {
            return;
        }

        throw new RuntimeException(
            'Some workers have crashed.' . PHP_EOL
            . '----------------------' . PHP_EOL
            . 'All workers have quit, but some tests are still to be executed.' . PHP_EOL
            . 'This may be the case if some tests were killed forcefully (for example, using exit()).' . PHP_EOL
            . '----------------------' . PHP_EOL
            . 'Failed test command(s):' . PHP_EOL
            . '----------------------' . PHP_EOL
            . implode(PHP_EOL, $this->db->query('SELECT command FROM tests')->fetchAll(PDO::FETCH_COLUMN))
        );
    }
1111022
def dependency_ran(self, test):
        """"""
        for d in (self.test_name(i) for i in dependencies[test]):
            if d not in self.ok_results:
                return "Required test '{}' did not run (does it exist?)".format(d)
        return None
568851
function check(result, test) {

  const CHECKERS = [ _checkExitCode, _checkOutput, _checkStdout, _checkStderr ];
  var errors = [];

  CHECKERS.forEach(function (checker) {
    var error = checker(result, test);
    if (error) {
      errors.push(error);
    }
  });
  
  return errors;
}
661244
def is_successful(self, retry=False):
        

        if not self.is_terminated(retry=retry):
            return False
        retry_num = options.retry_times
        while retry_num > 0:
            try:
                statuses = self.get_task_statuses()
                return all(task.status == Instance.Task.TaskStatus.SUCCESS
                           for task in statuses.values())
            except (errors.InternalServerError, errors.RequestTimeTooSkewed):
                retry_num -= 1
                if not retry or retry_num <= 0:
                    raise
1245565
def _validate_completeness(self):
        
        errors = list()

        # First we'll make sure there's no mismatch between the filesystem
        # and the list of files in the manifest(s)
        only_in_manifests, only_on_fs, only_in_fetch = self.compare_manifests_with_fs_and_fetch()
        for path in only_in_manifests:
            e = FileMissing(path)
            LOGGER.warning(force_unicode(e))
            errors.append(e)
        for path in only_on_fs:
            e = UnexpectedFile(path)
            LOGGER.warning(force_unicode(e))
            errors.append(e)
        for path in only_in_fetch:
            e = UnexpectedRemoteFile(path)
            # this is non-fatal according to spec but the warning is still reasonable
            LOGGER.warning(force_unicode(e))

        if errors:
            raise BagValidationError(_("Bag validation failed"), errors)
72312
def run_all
      passed, failed_examples, passed_examples = Runner.run(['spec'], options.merge({ :message => 'Run all specs'}))

      self.rerun_specs = failed_examples
      self.last_run_passed = passed

      throw :task_has_failed unless passed
    end
75624
def addUnexpectedSuccess(self, test):
        
        result = self._handle_result(
            test, TestCompletionStatus.unexpected_success)
        self.unexpectedSuccesses.append(result)
941495
def finalize(self):
        
        #Determine the percentage success on the unit tests. Also see the total time for all
        #the unit tests.
        stotal = 0
        ttotal = 0
        for test in self.repo.testing.tests:
            stotal += (1 if test["success"]==True else 0)
            ttotal += (test["end"] - test["start"]).seconds

        self.percent = stotal/float(len(self.repo.testing.tests))
        self.message = "Results: {0:.2%} in {1:d}s.".format(self.percent, ttotal)
        if not self.testmode:
            if percent < 1:
                self.commit.create_status("failure", self.url, self.message)
            elif any([test["code"] == 1 for test in self.repo.testing.tests]):
                self.commit.create_status("pending", self.url, self.message + " Slowdown reported.")
            else:
                self.commit.create_status("success", self.url, self.message)
        self.server.wiki.update(self)
1276086
function() {

            // Log results.
            if (responseStatus.failed > 0) {
                warnUnlessForced(responseStatus.failed + '/' + responseStatus.total +
                        ' pages failed (' + responseStatus.duration.toFixed(2) + 'sec)', force);
            } else if (responseStatus.total === 0) {
                warnUnlessForced('0/0 pages tested (' + responseStatus.duration.toFixed(2) + 'sec)', force);
            } else {
                grunt.verbose.writeln("--");
                grunt.log.ok(responseStatus.total + ' pages passed (' + responseStatus.duration.toFixed(2) + 'sec)', force);
            }

            // All done!
            done();
        }
777932
def on_all_ok(self):
        
        # Merge DDB files.
        out_ddb = self.merge_ddb_files()
        return self.Results(node=self, returncode=0, message="DDB merge done")
945408
def run(self, data):
        
        result_type = namedtuple('Result', 'code messages')

        if self.passes is True:
            result = result_type(Checker.Code.PASSED, '')
        elif self.passes is False:
            if self.allow_failure:
                result = result_type(Checker.Code.IGNORED, '')
            else:
                result = result_type(Checker.Code.FAILED, '')
        else:
            try:
                result = self.check(data, **self.arguments)
                messages = ''
                if isinstance(result, tuple):
                    result, messages = result

                if result not in Checker.Code:
                    result = Checker.Code.PASSED if bool(result) else Checker.Code.FAILED

                if result == Checker.Code.FAILED and self.allow_failure:
                    result = Checker.Code.IGNORED

                result = result_type(result, messages)
            except NotImplementedError:
                result = result_type(Checker.Code.NOT_IMPLEMENTED, '')
        self.result = result
908320
def addFailure(self, test, err, capt=None, tbinfo=None):
        
        self.__insert_test_result(constants.State.FAILURE, test, err)
564609
public function execute()
    {
        $curdir = getcwd();
        chdir($this->phpci->buildPath);

        $phpspec = $this->phpci->findBinary(array('phpspec', 'phpspec.php'));

        $success = $this->phpci->executeCommand($phpspec . ' --format=junit --no-code-generation run');
        $output = $this->phpci->getLastOutput();

        chdir($curdir);

        /*
         * process xml output
         *
         * <testsuites time=FLOAT tests=INT failures=INT errors=INT>
         *   <testsuite name=STRING time=FLOAT tests=INT failures=INT errors=INT skipped=INT>
         *     <testcase name=STRING time=FLOAT classname=STRING status=STRING/>
         *   </testsuite>
         * </testsuites
         */

        $xml = new \SimpleXMLElement($output);
        $attr = $xml->attributes();
        $data = array(
            'time' => (float)$attr['time'],
            'tests' => (int)$attr['tests'],
            'failures' => (int)$attr['failures'],
            'errors' => (int)$attr['errors'],

            // now all the tests
            'suites' => array()
        );

        /**
         * @var \SimpleXMLElement $group
         */
        foreach ($xml->xpath('testsuite') as $group) {
            $attr = $group->attributes();
            $suite = array(
                'name' => (String)$attr['name'],
                'time' => (float)$attr['time'],
                'tests' => (int)$attr['tests'],
                'failures' => (int)$attr['failures'],
                'errors' => (int)$attr['errors'],
                'skipped' => (int)$attr['skipped'],

                // now the cases
                'cases' => array()
            );

            /**
             * @var \SimpleXMLElement $child
             */
            foreach ($group->xpath('testcase') as $child) {
                $attr = $child->attributes();
                $case = array(
                    'name' => (String)$attr['name'],
                    'classname' => (String)$attr['classname'],
                    'time' => (float)$attr['time'],
                    'status' => (String)$attr['status'],
                );

                if ($case['status']=='failed') {
                    $error = array();
                    /*
                     * ok, sad, we had an error
                     *
                     * there should be one - foreach makes this easier
                     */
                    foreach ($child->xpath('failure') as $failure) {
                        $attr = $failure->attributes();
                        $error['type'] = (String)$attr['type'];
                        $error['message'] = (String)$attr['message'];
                    }

                    foreach ($child->xpath('system-err') as $system_err) {
                        $error['raw'] = (String)$system_err;
                    }

                    $case['error'] = $error;
                }

                $suite['cases'][] = $case;
            }

            $data['suites'][] = $suite;
        }

        $this->build->storeMeta('phpspec', $data);


        return $success;
    }
919199
def should_execute(self):
        """"""
        return self.args.apply and (self.args.no_confirm or self.confirm_execution())
201508
def addExpectedFailure(self, test, err):
        
        super().addExpectedFailure(test, err)
        self.test_info(test)
        self._call_test_results('addExpectedFailure', test, err)
515263
def do_failures(self, arg):
        
        usable, filename, append = self._redirect_split(arg)
        a = self.tests[self.active]
        args = self.curargs
        splitargs = usable.split()
        if len(splitargs) > 0:
            tfilter = splitargs[0]
        else:
            tfilter = "*"

        outfiles = None
        if len(splitargs) > 1:
            outfiles = splitargs[1:len(splitargs)]

        result = a.failures(outfiles, args["threshold"], tfilter)
        self._redirect_output(result, filename, append, msg.info)
787781
def _succeed(self, result):
        

        for fn, args, kwargs in self._callbacks:
            fn(result, *args, **kwargs)
        self._resulted_in = result