Generates a summary of the status of the expected scripts broken based on the log.
			This summary (a list of strings) is returned as well as a list with the dates (which
			can be used to index the log)of the most recent attempts at the failed jobs.
766552
def generateSummary(self, extraLapse = TYPICAL_LAPSE):
		''' 
		'''
		scriptsRun = self.scriptsRun
		
		body = []
		
		numberOfFailed = 0
		numberWithWarnings = 0
		failedList = []
		successList = []
		warningsList = []
		
		for name, details in sorted(scriptsRun.iteritems()):
			status = None
			daysSinceSuccess = None
			
			if details["lastSuccess"] and expectedScripts.get(name):
				daysSinceSuccess = expectedScripts.get(name).getDaysSinceLastSuccess(details["lastSuccess"])
				if not expectedScripts.check(name, details["lastSuccess"], extraLapse): 
					status = "FAILED"
			else:
				status = "FAILED"
			
			if not status:
				if details["status"] & RETROSPECT_FAIL:
					status = "FAILED"
				elif details["status"] & RETROSPECT_WARNING:
					status = "WARNINGS"
				elif status != "FAILED":
					status = "OK"
			
			if details["lastSuccess"] and daysSinceSuccess:
				lastSuccessDetails = "Last successful run on %s (%0.1f days ago)" % (details["lastSuccess"], daysSinceSuccess)
			else:
				lastSuccessDetails = "No recent successful run."
			
			if details["lastRun"]:
				lastRunDetails = "Last run on %s (%s)" % (details["lastRun"], status)
			else:
				lastRunDetails = "No recent run (%s)" % status
				 
			if status == "FAILED":
				numberOfFailed += 1
				failedList.append("%s: %s. %s" % (name, lastRunDetails, lastSuccessDetails))
			elif status == "WARNINGS":
				numberWithWarnings += 1
				warningsList.append("%s: %s. %s" % (name, lastRunDetails, lastSuccessDetails))
			else:
				successList.append("%s: %s. %s" % (name, lastRunDetails, lastSuccessDetails))
		
		body = []
		if failedList:
			body.append("FAILED JOBS (%d)" % numberOfFailed)
			body.append("****************")
			for j in failedList:
				body.append(j)
			body.append("\n")
		if warningsList:
			body.append("JOBS WITH WARNINGS (%d)" % numberWithWarnings)
			body.append("***********************")
			for j in warningsList:
				body.append(j)
			body.append("\n")
		if successList:
			body.append("SUCCESSFUL JOBS")
			body.append("***************")
			for j in successList:
				body.append(j)
		
		return body, failedList
145925
public static <T> void logFailures(List<Either<T, ExecutionException>> results, Logger useLogger, int atMost) {
    Logger actualLogger = useLogger == null ? log : useLogger;
    Iterator<Either<T, ExecutionException>> it = results.iterator();
    int printed = 0;
    while (it.hasNext()) {
      Either<T, ExecutionException> nextResult = it.next();
      if (nextResult instanceof Either.Right) {
        ExecutionException exc = ((Either.Right<T, ExecutionException>) nextResult).getRight();
        actualLogger.error("Iterator executor failure.", exc);
        printed++;
        if (printed >= atMost) {
          return;
        }
      }
    }
  }
501518
function reportStatus(status, outputFile) {
  let log = [''];

  log.push('Suites ignored due to legacy guides:');
  IGNORED_EXAMPLES.filter(example => !fixmeIvyExamples.find(ex => ex.startsWith(example)))
      .forEach(function(val) { log.push('  ' + val); });

  if (argv.ivy) {
    log.push('');
    log.push('Suites ignored due to breakage with Ivy:');
    fixmeIvyExamples.forEach(function(val) { log.push('  ' + val); });
  }

  log.push('');
  log.push('Suites passed:');
  status.passed.forEach(function(val) { log.push('  ' + val); });

  if (status.failed.length == 0) {
    log.push('All tests passed');
  } else {
    log.push('Suites failed:');
    status.failed.forEach(function(val) { log.push('  ' + val); });
  }
  log.push('\nElapsed time: ' + status.elapsedTime + ' seconds');
  log = log.join('\n');
  console.log(log);
  fs.appendFileSync(outputFile, log);
}
438835
def log_fault_info_str (exc_info, message = "", level = logging.CRITICAL,
                        traceback = False):
  
  tb = sys.exc_info ()[2]
  stack = _get_stack (tb)
  rc = StringIO ()
  rc.write ("%s: FAULT: %s%s(%s): %s\n"
            % (logging.getLevelName (level),
               ("%s -- " % message) if message else "",
               tb.tb_frame.f_code.co_filename,
               tb.tb_lineno,
               repr (exc_info[1])))
  if traceback:
    for line in _generate_stackdump (stack):
      rc.write ("%s\n" % line)
  return rc.getvalue ()
1202935
def report(self, job_ids=None, array_ids=None, output=True, error=True, status=Status, name=None):
    """"""
    def _write_contents(job):
      # Writes the contents of the output and error files to command line
      out_file, err_file = job.std_out_file(), job.std_err_file()
      logger.info("Contents of output file: '%s'" % out_file)
      if output and out_file is not None and os.path.exists(out_file) and os.stat(out_file).st_size > 0:
        print(open(out_file).read().rstrip())
        print("-"*20)
      if error and err_file is not None and os.path.exists(err_file) and os.stat(err_file).st_size > 0:
        logger.info("Contents of error file: '%s'" % err_file)
        print(open(err_file).read().rstrip())
        print("-"*40)

    def _write_array_jobs(array_jobs):
      for array_job in array_jobs:
        print("Array Job", str(array_job.id), ("(%s) :"%array_job.machine_name if array_job.machine_name is not None else ":"))
        _write_contents(array_job)

    self.lock()

    # check if an array job should be reported
    if array_ids:
      if len(job_ids) != 1: logger.error("If array ids are specified exactly one job id must be given.")
      array_jobs = list(self.session.query(ArrayJob).join(Job).filter(Job.unique.in_(job_ids)).filter(Job.unique == ArrayJob.job_id).filter(ArrayJob.id.in_(array_ids)))
      if array_jobs: print(array_jobs[0].job)
      _write_array_jobs(array_jobs)

    else:
      # iterate over all jobs
      jobs = self.get_jobs(job_ids)
      for job in jobs:
        if name is not None and job.name != name:
          continue
        if job.status not in status:
          continue
        if job.array:
          print(job)
          _write_array_jobs(job.array)
        else:
          print(job)
          _write_contents(job)
        if job.log_dir is not None:
          print("-"*60)

    self.unlock()
1057209
def summarize_failing_examples(app, exception):
    
    if exception is not None:
        return

    # Under no-plot Examples are not run so nothing to summarize
    if not app.config.sphinx_gallery_conf['plot_gallery']:
        logger.info('Sphinx-gallery gallery_conf["plot_gallery"] was '
                    'False, so no examples were executed.', color='brown')
        return

    gallery_conf = app.config.sphinx_gallery_conf
    failing_as_expected, failing_unexpectedly, passing_unexpectedly = \
        _parse_failures(gallery_conf)

    if failing_as_expected:
        logger.info("Examples failing as expected:", color='brown')
        for fail_example in failing_as_expected:
            logger.info('%s failed leaving traceback:', fail_example,
                        color='brown')
            logger.info(gallery_conf['failing_examples'][fail_example],
                        color='brown')

    fail_msgs = []
    if failing_unexpectedly:
        fail_msgs.append(red("Unexpected failing examples:"))
        for fail_example in failing_unexpectedly:
            fail_msgs.append(fail_example + ' failed leaving traceback:\n' +
                             gallery_conf['failing_examples'][fail_example] +
                             '\n')

    if passing_unexpectedly:
        fail_msgs.append(red("Examples expected to fail, but not failing:\n") +
                         "Please remove these examples from\n" +
                         "sphinx_gallery_conf['expected_failing_examples']\n" +
                         "in your conf.py file"
                         "\n".join(passing_unexpectedly))

    # standard message
    n_good = len(gallery_conf['passing_examples'])
    n_tot = len(gallery_conf['failing_examples']) + n_good
    n_stale = len(gallery_conf['stale_examples'])
    logger.info('\nSphinx-gallery successfully executed %d out of %d '
                'file%s subselected by:\n\n'
                '    gallery_conf["filename_pattern"] = %r\n'
                '    gallery_conf["ignore_pattern"]   = %r\n'
                '\nafter excluding %d file%s that had previously been run '
                '(based on MD5).\n'
                % (n_good, n_tot, 's' if n_tot != 1 else '',
                   gallery_conf['filename_pattern'],
                   gallery_conf['ignore_pattern'],
                   n_stale, 's' if n_stale != 1 else '',
                   ),
                color='brown')

    if fail_msgs:
        raise ValueError("Here is a summary of the problems encountered when "
                         "running the examples\n\n" + "\n".join(fail_msgs) +
                         "\n" + "-" * 79)
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();
        }
570881
function summariser(results) {
    var response = [],
        callback = function(output) {
            response.push(output);
        };

    var passed = 0;
    if (results.hasOwnProperty('passed')) {
        passed = countSpecs(results.passed);
    }
    var failed = 0;
    if (results.hasOwnProperty('failed')) {
        failed = countSpecs(results.failed);
    }
    var pending = 0;

    if (results.hasOwnProperty('pending')) {
        pending = countSpecs(results.pending);
    }
    var total = passed + failed + pending;

    coloriseOutput(total + ' Specs defined', 'bold', callback);
    if (total > 0) {
        coloriseOutput(passed + ' Passed' + displayPercentage(total, passed), 'green', callback);
        coloriseOutput(failed + ' Failed' + displayPercentage(total, failed), 'red', callback);
        coloriseOutput(pending + ' Pending' + displayPercentage(total, pending), 'yellow', callback);
    }
    return response;
}
636101
def failed_devices
      test_summaries = Dir["#{test_results_path}/*_TestSummaries.plist"]
      test_summaries.each_with_object({}) do |plist, hash|
        summary = FastlaneCore::TestParser.new(plist)
        name = summary.data.first[:run_destination_name]
        if summary.data.first[:number_of_tests] == 0
          hash[name] = ["No tests were executed"]
        else
          tests = Array(summary.data.first[:tests])
          hash[name] = tests.map { |test| Array(test[:failures]).map { |failure| failure[:failure_message] } }.flatten
        end
      end
    end
661577
def create_status_sentinel_file(self, fail):
        """"""
        logName = 'failed.log' if fail else 'succeeded.log'
        localLog = os.path.join(os.getcwd(), logName)
        open(localLog, 'w').close()
        self.jobStore.importFile('file://' + localLog, logName, hardlink=True)

        if os.path.exists(localLog):  # Bandaid for Jenkins tests failing stochastically and unexplainably.
            os.remove(localLog)
1036329
def _log_failed_submission(self, data):
        
        message = data.pop('message', '<no message value>')
        output = [message]
        if 'exception' in data and 'stacktrace' in data['exception']['values'][-1]:
            # try to reconstruct a reasonable version of the exception
            for frame in data['exception']['values'][-1]['stacktrace'].get('frames', []):
                output.append('  File "%(fn)s", line %(lineno)s, in %(func)s' % {
                    'fn': frame.get('filename', 'unknown_filename'),
                    'lineno': frame.get('lineno', -1),
                    'func': frame.get('function', 'unknown_function'),
                })

        self.uncaught_logger.error(output)
526796
def print_failed(self, stream=sys.stderr):
        
        for job_key, job_details in sorted(self.scatter_link.jobs.items()):
            if job_details.status == JobStatus.failed:
                stream.write("Failed job %s\n  log = %s\n" %
                             (job_key, job_details.logfile))
448865
function formatErrors (results) {
    return ''; 

    var failCount = results.fail.length;
    var past = (failCount === 1) ? 'was' : 'were';
    var plural = (failCount === 1) ? 'failure' : 'failures';

    var out = '\n' + pad(format.red.bold('Failed Tests:') + ' There ' + past + ' ' + format.red.bold(failCount) + ' ' + plural + '\n');
    out += formatFailedAssertions(results);

    return out;
  }
977732
function printErrors(summary, errors) {
  logError(`${summary}\n`);

  errors.forEach(err => {
    logError(`\t- ${err.message || err}`);
  });

  console.log();
}
760746
def print_infos(results):
    
    print('transactions: %i' % results.total_transactions)
    print('timers: %i' % results.total_timers)
    print('errors: %i' % results.total_errors)
    print('test start: %s' % results.start_datetime)
    print('test finish: %s\n' % results.finish_datetime)
902876
def summary_table(
    errors: int, fails: int, warns: int, skips: int, infos: int, passes: int, total: int
) -> str:
    """"""

    return f"""<h2>Summary</h2>
            <table>
            <tr>
                <th>{EMOTICON['ERROR']} ERROR</th>
                <th>{EMOTICON['FAIL']} FAIL</th>
                <th>{EMOTICON['WARN']} WARN</th>
                <th>{EMOTICON['SKIP']} SKIP</th>
                <th>{EMOTICON['INFO']} INFO</th>
                <th>{EMOTICON['PASS']} PASS</th>
            </tr>
            <tr>
                <td>{errors}</td>
                <td>{fails}</td>
                <td>{warns}</td>
                <td>{skips}</td>
                <td>{infos}</td>
                <td>{passes}</td>
            </tr>
            <tr>
                <td>{round(errors / total * 100)}%</td>
                <td>{round(fails / total * 100)}%</td>
                <td>{round(warns / total * 100)}%</td>
                <td>{round(skips / total * 100)}%</td>
                <td>{round(infos / total * 100)}%</td>
                <td>{round(passes / total * 100)}%</td>
            </tr>
            </table>
            """
1097574
def prt_error_summary(self, fout_err):
        """"""
        # Get summary of error types and their counts
        errcnts = []
        if self.ignored:
            errcnts.append("  {N:9,} IGNORED associations\n".format(N=len(self.ignored)))
        if self.illegal_lines:
            for err_name, errors in self.illegal_lines.items():
                errcnts.append("  {N:9,} {ERROR}\n".format(N=len(errors), ERROR=err_name))
        # Save error details into a log file
        fout_log = self._wrlog_details_illegal_gaf(fout_err, errcnts)
        sys.stdout.write("  WROTE GAF ERROR LOG: {LOG}:\n".format(LOG=fout_log))
        for err_cnt in errcnts:
            sys.stdout.write(err_cnt)