aboutsummaryrefslogtreecommitdiff
path: root/buildbot_test_toolchains.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2015-05-22 14:14:51 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-27 01:27:34 +0000
commit7f3190b3fb89522ea85b87200241962634369e9a (patch)
treee6aa0e30702afd06fcefb3aedb534b40ea90e818 /buildbot_test_toolchains.py
parent7658aecb942b63472453be82a24bc2036121383d (diff)
downloadtoolchain-utils-7f3190b3fb89522ea85b87200241962634369e9a.tar.gz
Update nightly tests to use mail-sheriff program for reports.
This updates the nightly buildbot and local tester programs to tell crosperf to put its results in a special directory, and to not send email. After crosperf finishes, it looks for the email information in the special directory and sends out then email using the mail-sheriff program. BUG=None TEST=Currently running buildbot test. Will not commit the change until the test passes. Since the test takes several hours to run I wanted to put this out for review now. Change-Id: Idd3d137e4a6e144b677690fc6775580dfac56af1 Reviewed-on: https://chrome-internal-review.googlesource.com/217286 Reviewed-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'buildbot_test_toolchains.py')
-rwxr-xr-xbuildbot_test_toolchains.py40
1 files changed, 28 insertions, 12 deletions
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index c78155ca..7072c634 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -28,7 +28,7 @@ USE_NEXT_GCC_PATCH ="230260"
WEEKLY_REPORTS_ROOT = "/usr/local/google/crostc/weekly_test_data"
ROLE_ACCOUNT = "mobiletc-prebuild"
TOOLCHAIN_DIR = os.path.dirname(os.path.realpath(__file__))
-
+MAIL_PROGRAM = "~/var/bin/mail-sheriff"
class ToolchainComparator():
"""
@@ -47,6 +47,12 @@ class ToolchainComparator():
self._weekday = time.strftime("%a")
else:
self._weekday = weekday
+ timestamp = datetime.datetime.strftime(datetime.datetime.now(),
+ "%Y-%m-%d_%H:%M:%S")
+ self._reports_dir = os.path.join(
+ os.path.expanduser("~/nightly_test_reports"),
+ "%s.%s" % (timestamp, board),
+ )
def _ParseVanillaImage(self, trybot_image):
"""
@@ -61,7 +67,6 @@ class ToolchainComparator():
vanilla_image = trybot_image[start_pos:end_pos]
return vanilla_image
-
def _FinishSetup(self):
"""
Make sure testing_rsa file is properly set up.
@@ -71,8 +76,8 @@ class ToolchainComparator():
"/chrome-src-internal/src/third_party/chromite/ssh_keys"
"/testing_rsa")
ret_val = self._ce.ChrootRunCommand(self._chromeos_root, command)
- if ret_val:
- raise Exception("chmod for testing_rsa failed")
+ if ret_val != 0:
+ raise RuntimeError("chmod for testing_rsa failed")
def _TestImages(self, trybot_image, vanilla_image):
"""
@@ -120,12 +125,13 @@ class ToolchainComparator():
crosperf = os.path.join(TOOLCHAIN_DIR,
"crosperf",
"crosperf")
- command = "%s --email=c-compiler-chrome %s" % (crosperf, experiment_file)
+ command = ("%s --no_email=True --results_dir=%s %s" % (crosperf,
+ self._reports_dir,
+ experiment_file))
ret = self._ce.RunCommand(command)
- if ret:
- raise Exception("Couldn't run crosperf!")
- return ret
-
+ if ret != 0:
+ raise RuntimeError("Couldn't run crosperf!")
+ return
def _CopyWeeklyReportFiles(self, trybot_image, vanilla_image):
"""
@@ -181,6 +187,15 @@ class ToolchainComparator():
self._l.LogOutput("Error while creating/copying test tar file(%s)."
% tar_file_name)
+ def _SendEmail(self):
+ """Find email message generated by crosperf and send it."""
+ filename = os.path.join(self._reports_dir,
+ "msg_body.html")
+ if (os.path.exists(filename) and
+ os.path.exists(os.path.expanduser(MAIL_PROGRAM))):
+ command = ('cat %s | %s -s "buildbot test results, %s" -team -html'
+ % (filename, MAIL_PROGRAM, self._board))
+ self._ce.RunCommand(command)
def DoAll(self):
"""
@@ -212,9 +227,10 @@ class ToolchainComparator():
if os.getlogin() == ROLE_ACCOUNT:
self._FinishSetup()
- if not self._TestImages(trybot_image, vanilla_image):
- # Only try to copy the image files if the test runs ran successfully.
- self._CopyWeeklyReportFiles(trybot_image, vanilla_image)
+ self._TestImages(trybot_image, vanilla_image)
+ self._SendEmail()
+ # Only try to copy the image files if the test runs ran successfully.
+ self._CopyWeeklyReportFiles(trybot_image, vanilla_image)
return 0