aboutsummaryrefslogtreecommitdiff
path: root/buildbot_test_toolchains.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildbot_test_toolchains.py')
-rwxr-xr-xbuildbot_test_toolchains.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index 175dae5e..5f7c21d3 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
@@ -34,11 +34,12 @@ from cros_utils import buildbot_utils
USE_LLVM_NEXT_PATCH = '513590'
CROSTC_ROOT = '/usr/local/google/crostc'
+NIGHTLY_TESTS_DIR = os.path.join(CROSTC_ROOT, 'nightly-tests')
ROLE_ACCOUNT = 'mobiletc-prebuild'
TOOLCHAIN_DIR = os.path.dirname(os.path.realpath(__file__))
MAIL_PROGRAM = '~/var/bin/mail-sheriff'
PENDING_ARCHIVES_DIR = os.path.join(CROSTC_ROOT, 'pending_archives')
-NIGHTLY_TESTS_DIR = os.path.join(CROSTC_ROOT, 'nightly_test_reports')
+NIGHTLY_TESTS_RESULTS = os.path.join(CROSTC_ROOT, 'nightly_test_reports')
IMAGE_DIR = '{board}-{image_type}'
IMAGE_VERSION_STR = r'{chrome_version}-{tip}\.{branch}\.{branch_branch}'
@@ -87,7 +88,7 @@ class ToolchainComparator(object):
timestamp = datetime.datetime.strftime(datetime.datetime.now(),
'%Y-%m-%d_%H:%M:%S')
self._reports_dir = os.path.join(
- NIGHTLY_TESTS_DIR,
+ NIGHTLY_TESTS_RESULTS,
'%s.%s' % (timestamp, board),
)
@@ -145,7 +146,7 @@ class ToolchainComparator(object):
Given the names of the trybot, vanilla and non-AFDO images, create the
appropriate crosperf experiment file and launch crosperf on it.
"""
- experiment_file_dir = os.path.join(CROSTC_ROOT, self._weekday)
+ experiment_file_dir = os.path.join(NIGHTLY_TESTS_DIR, self._weekday)
experiment_file_name = '%s_toolchain_experiment.txt' % self._board
compiler_string = 'llvm'
@@ -194,7 +195,7 @@ class ToolchainComparator(object):
}
"""
- with open(experiment_file, 'w') as f:
+ with open(experiment_file, 'w', encoding='utf-8') as f:
f.write(experiment_header)
f.write(experiment_tests)
@@ -250,11 +251,10 @@ class ToolchainComparator(object):
ret = self._ce.RunCommand(command)
if ret != 0:
raise RuntimeError('Crosperf execution error!')
- else:
- # Copy json report to pending archives directory.
- command = 'cp %s/*.json %s/.' % (self._reports_dir, PENDING_ARCHIVES_DIR)
- ret = self._ce.RunCommand(command)
- return
+
+ # Copy json report to pending archives directory.
+ command = 'cp %s/*.json %s/.' % (self._reports_dir, PENDING_ARCHIVES_DIR)
+ ret = self._ce.RunCommand(command)
def _SendEmail(self):
"""Find email message generated by crosperf and send it."""