diff options
author | cmtice <cmtice@google.com> | 2014-07-08 11:17:21 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-08 21:22:40 +0000 |
commit | 4536ef6c9da0f8c0c544552798c0bcf516519f73 (patch) | |
tree | 0351ea39d0241eaeeb05d6a45ef6080b7bcbd7a4 /weekly_report.py | |
parent | 6367e17c2a01a67fe015f4a94a1cbb30d7958dfc (diff) | |
download | toolchain-utils-4536ef6c9da0f8c0c544552798c0bcf516519f73.tar.gz |
Minor fixes to weekly report generation.
Update test_toolchains.py to clean out old (stale) data before
copying current image tar files to reports directory. Update
weekly_report.py to generate report for previous 6 days, depending on
when report is run, rather than being hard-coded to start the report on
a particular day.
BUG=Non
TEST=Ran test_toolchains.py as part of nightly test; it worked properly.
Ran weekly_report.py and it did the right thing.
Change-Id: Id173ccaa3146c76e19636501984bab11a41f8568
Reviewed-on: https://chrome-internal-review.googlesource.com/168465
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'weekly_report.py')
-rw-r--r-- | weekly_report.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/weekly_report.py b/weekly_report.py index e4ceb6f8..3a0ad60a 100644 --- a/weekly_report.py +++ b/weekly_report.py @@ -2,15 +2,16 @@ # # Copyright Google Inc. 2014 -import sys -import time +import datetime import optparse import os +import sys +import time from utils import constants from utils import command_executer -WEEKDAYS = ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'] +WEEKDAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] DATA_ROOT_DIR = os.path.join(constants.CROSTC_WORKSPACE, 'weekly_test_data') @@ -134,13 +135,28 @@ def Main(argv): cmd_executer = command_executer.GetCommandExecuter(log_level="average") + # Find starting index, for cycling through days of week, generating + # reports starting 6 days ago from today. Generate list of indices for + # order in which to look at weekdays for report: + todays_index = datetime.datetime.today().isoweekday() + indices = [] + start = todays_index + 1 + end = start + 7 + for i in range(start,end): + indices.append(i % 7) + # E.g. if today is Sunday, then start report with last Monday, so + # indices = [1, 2, 3, 4, 5, 6, 0]. + + + # Find all the test image tar files, untar them and add them to # the list. Also find and untar vanilla image tar files, and keep # track of the first vanilla image. report_image_paths = [] vanilla_image_paths = [] first_vanilla_image = None - for day in WEEKDAYS: + for i in indices: + day = WEEKDAYS[i] data_path = os.path.join(DATA_ROOT_DIR, options.board, day) if os.path.exists(data_path): # First, untar the test image. |