[LNT] r306569 - Check output in send-run-comparison/send-daily-report tests

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 10:40:10 PDT 2017


Author: matze
Date: Wed Jun 28 10:40:10 2017
New Revision: 306569

URL: http://llvm.org/viewvc/llvm-project?rev=306569&view=rev
Log:
Check output in send-run-comparison/send-daily-report tests

Modified:
    lnt/trunk/lnt/lnttool/main.py
    lnt/trunk/tests/lnttool/email_tools.py

Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=306569&r1=306568&r2=306569&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Wed Jun 28 10:40:10 2017
@@ -298,6 +298,13 @@ def action_send_daily_report(instance_pa
             s.sendmail(from_address, [address],
                        msg.as_string())
             s.quit()
+        else:
+            out = sys.stdout
+            out.write("From: %s\n" % msg['From'])
+            out.write("To: %s\n" % msg['To'])
+            out.write("Subject: %s\n" % msg['Subject'])
+            out.write("=== html report\n")
+            out.write(html_report + "\n")
 
 
 @click.command("send-run-comparison")
@@ -381,6 +388,15 @@ def action_send_run_comparison(instance_
                 [to_address],
                 msg.as_string())
             mail_client.quit()
+        else:
+            out = sys.stdout
+            out.write("From: %s\n" % from_address)
+            out.write("To: %s\n" % to_address)
+            out.write("Subject: %s\n" % subject)
+            out.write("=== text/plain report\n")
+            out.write(text_report + "\n")
+            out.write("=== html report\n")
+            out.write(html_report + "\n")
 
 
 @click.group("profile")

Modified: lnt/trunk/tests/lnttool/email_tools.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/email_tools.py?rev=306569&r1=306568&r2=306569&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/email_tools.py (original)
+++ lnt/trunk/tests/lnttool/email_tools.py Wed Jun 28 10:40:10 2017
@@ -6,10 +6,52 @@
 # RUN: rm -rf %t.instance
 # RUN: python %{shared_inputs}/create_temp_instance.py \
 # RUN:   %s %{shared_inputs}/SmallInstance %t.instance
-#
+
+
+
 # RUN: lnt send-run-comparison --dry-run --to some at address.com \
 # RUN: --from some.other at address.com  \
-# RUN: --host localhost %t.instance 1 2
+# RUN: --host localhost %t.instance 1 2 | FileCheck %s --check-prefix CHECK0
+#
+# CHECK0: From: some.other at address.com
+# CHECK0: To: some at address.com
+# CHECK0: Subject: localhost__clang_DEV__x86_64 test results
+# CHECK0: === text/plain report
+# CHECK0: http://localhost/perf/v4/nts/2?compare_to=1&baseline=2
+# CHECK0: Nickname: localhost__clang_DEV__x86_64:1
+# CHECK0: Name: localhost
+# CHECK0: Comparing:
+# CHECK0:      Run: 2, Order: 152289, Start Time: 2012-04-11 21:13:53, End Time: 2012-04-11 21:14:49
+# CHECK0:      To: 1, Order: 154331, Start Time: 2012-04-11 16:28:23, End Time: 2012-04-11 16:28:58
+# CHECK0: Baseline: 2, Order: 152289, Start Time: 2012-04-11 21:13:53, End Time: 2012-04-11 21:14:49
+# CHECK0: Tests Summary
+# ...
+# CHECK0: Unchanged Tests: 10 (10 on baseline)
+# CHECK0: Total Tests: 10
+# ...
+# CHECK0: === html report
+# CHECK0: <html>
+# CHECK0: <head>
+# CHECK0:   <title>localhost__clang_DEV__x86_64 test results</title>
+# CHECK0: </head>
+# ...
+# CHECK0: </html>
+
+
+
 # RUN: lnt send-daily-report --dry-run --from some.other at address.com \
 # RUN: --host localhost --testsuite nts --filter-machine-regex=machine.? \
-# RUN: %t.instance some at address.com
+# RUN: %t.instance some at address.com | FileCheck %s --check-prefix CHECK1
+#
+# CHECK1: From: some.other at address.com
+# CHECK1: To: some at address.com
+# CHECK1: Subject: Daily Report: 2012-04-11
+# CHECK1: === html report
+# CHECK1: <html>
+# CHECK1: <head>
+# CHECK1:    <title>Daily Report: 2012-04-11</title>
+# CHECK1: </head>
+# Make sure we see css inlined into the tags.
+# CHECK1: <body style="color:#000000; background-color:#ffffff; font-family: Helvetica, sans-serif; font-size:9pt">
+# CHECK1: <p>An error was encountered while producing the daily report: no runs to display in selected date range.</p>
+# CHECK1: </html>




More information about the llvm-commits mailing list