Ejemplo n.º 1
0
 def diagnose(self, key):
   k = boto.s3.key.Key(self.s3_bucket)
   k.key = key
   log_text_gz = k.get_contents_as_string()
   log_text = gzip.GzipFile(fileobj=StringIO(log_text_gz)).read().decode('utf-8')
   summary = parse_test_failure.extract_failure_summary(log_text)
   if not summary:
     summary = "Unable to diagnose"
   template = Template("""
     <h1>Diagnosed failure</h1>
     <code><pre>{{ summary|e }}</pre></code>
     <h1>Full log</h1>
     <code><pre>{{ log_text|e }}</pre></code>
   """)
   return self.render_container(template.render(summary=summary, log_text=log_text))
Ejemplo n.º 2
0
 def diagnose(self, key):
     k = boto.s3.key.Key(self.s3_bucket)
     k.key = key
     log_text_gz = k.get_contents_as_string()
     log_text = gzip.GzipFile(
         fileobj=StringIO(log_text_gz)).read().decode('utf-8')
     summary = parse_test_failure.extract_failure_summary(log_text)
     if not summary:
         summary = "Unable to diagnose"
     template = Template("""
   <h1>Diagnosed failure</h1>
   <code><pre>{{ summary|e }}</pre></code>
   <h1>Full log</h1>
   <code><pre>{{ log_text|e }}</pre></code>
 """)
     return self.render_container(
         template.render(summary=summary, log_text=log_text))
Ejemplo n.º 3
0
    def diagnose(self, key, name):
        log_text = self._download_string_from_s3(key)

        (msg, st, stdout,
         stderr) = parse_test_failure.extract_failure_summary(log_text, name)
        template = Template("""
      <h1>Error Message</h1>
      <code><pre>{{ msg|e }}</pre></code>
      <h1>Stack Trace</h1>
      <code><pre>{{ st|e }}</pre></code>
      <h1>Standard Output</h1>
      <code><pre>{{ stdout|e }}</pre></code>
      <h1>Standard Error</h1>
      <code><pre>{{ stderr|e }}</pre></code>
    """)
        return self.render_container(
            template.render(msg=msg, st=st, stdout=stdout, stderr=stderr))