aboutsummaryrefslogtreecommitdiff
path: root/test_toolchains.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2014-05-29 16:29:04 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-05 20:30:47 +0000
commit94bc470daff948021e754e6a63061da221faaf77 (patch)
tree426bb207eeed0541ecafd28ccc4d375bb704b0a0 /test_toolchains.py
parent1505b6ac10710044361cd65c7890014cb43e9930 (diff)
downloadtoolchain-utils-94bc470daff948021e754e6a63061da221faaf77.tar.gz
Update test_toolchains.py to save tar files of the images used.
This is for generating a weekly report that compares the nightly test results. All of the nightly test results are cached, but in order to find the correct cache results, you need the image from which the results were created. Due to disk space, some of the chroots will be deleted before the weekly report gets generated. Therefore, this modification tars up the test & vanilla image directories and stores them separately, where they can be accessed for generating the weekly report. BUG=None TEST=Used this successfully last night for nightly test runs. Change-Id: I01b457a402c3649d7904a478b37bad60b3395300 Reviewed-on: https://chrome-internal-review.googlesource.com/164879 Reviewed-by: Yunlian Jiang <yunlian@google.com> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'test_toolchains.py')
-rw-r--r--test_toolchains.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test_toolchains.py b/test_toolchains.py
index d8b750ae..0135c0db 100644
--- a/test_toolchains.py
+++ b/test_toolchains.py
@@ -6,11 +6,14 @@ import os
import sys
import build_chromeos
import setup_chromeos
+import time
from utils import command_executer
from utils import misc
from utils import logger
+WEEKLY_REPORTS_ROOT="/usr/local/google/crostc/weekly_test_data"
+
class GCCConfig(object):
def __init__(self, githash):
self.githash = githash
@@ -163,6 +166,28 @@ class ToolchainComparator(ChromeOSCheckout):
"chromiumos_test_image.bin"),
image_args)
print >>f, experiment_image
+ images_path = os.path.join(os.path.realpath(self._chromeos_root),
+ "src/build/images", self._board)
+ weekday = time.strftime("%a")
+ for l in labels:
+ test_path = os.path.join(images_path, l)
+ if os.path.exists(test_path):
+ data_dir = os.path.join(WEEKLY_REPORTS_ROOT, self._board)
+ if l == "vanilla":
+ label_name = l
+ else:
+ label_name = "test"
+ tar_file_name = "%s_%s_image.tar" % (weekday, label_name)
+ dest_dir = os.path.join (data_dir, weekday)
+ if not os.path.exists(dest_dir):
+ os.makedirs(dest_dir)
+ cmd="cd %s; tar -cvf %s %s/*; cp %s %s/." % (images_path,tar_file_name,
+ l, tar_file_name,
+ dest_dir)
+ tar_ret = self._ce.RunCommand(cmd)
+ if tar_ret:
+ self._l.LogOutput("Error while creating/copying test tar file (%s)."
+ % tar_file_name)
crosperf = os.path.join(os.path.dirname(__file__),
"crosperf",
"crosperf")