Adam,
the run_all code does not really make much sense to me, to be honest.
After some minor cleanup, the code looks like this:
171 def run_all(args, wiki=None):
172 """Do everything we can: test both Rawhide and Branched nightlies
173 if they exist, and test current compose if it's different from
174 either and it's new.
175 """
176 skip = None
177 (jobs, currev) = jobs_from_current(wiki)
178 print("Jobs from current validation event: {0}".format(jobs))
179
180 yesterday = datetime.datetime.utcnow() - datetime.timedelta(days=1)
181 if currev and currev.compose == yesterday.strftime('%Y%m%d'):
182 skip = currev.milestone
183
184 if not skip.lower() == 'rawhide':
185 rawhide_ffrel = fedfind.release.get_release(
186 release='Rawhide', compose=yesterday)
187 rawjobs = jobs_from_fedfind(rawhide_ffrel)
188 print("Jobs from {0}: {1}".format(rawhide_ffrel.version, rawjobs))
189 jobs.extend(rawjobs)
190
191 if not skip.lower() == 'branched':
192 branched_ffrel = fedfind.release.get_release(
193 release=currev.release, compose=yesterday)
194 branchjobs = jobs_from_fedfind(branched_ffrel)
195 print("Jobs from {0}: {1}".format(branched_ffrel.version,
branchjobs))
196 jobs.extend(branchjobs)
197
198 if jobs:
199 report_results(jobs)
200 sys.exit()
Which on lines:
177-178: Runs the OpenQA jobs for "current" event
180: Creates a yesterday's date (formerly done on three lines in a weird way)
181-182: IIUIC checks whether the "current" compose is from yesterday, and if
so, then sets skip to either Rawhide or Branched
184&191: Fails terribly, when the if-clause on 181 was False (because skip equals
None in that case) => no job results will be reported to wiki matrices
Also, it is kind of non-clear at the first read, that what it does is basically
"when you should not skip rawhide, run jobs for rawhide and do the same for
branched".
I'd much rather see something like `if skip.lower() !=
'rawhide':` and with a proper comment
I'm not really sure how the whole 181 if clause works, and why is it evidently always
True, since you have not encountered the error.
Also, you mention a --yesterday parameter, which I have not really found in the code.
I pushed the slightly polished code to the repos, so make sure to pull :)
I'd really love to see some more comments in you code, which is using the
wikitcms/relval internal attributes and so on (it gets somewhat wild in places).
Please have a look at the run_all() method and:
* make sure that it handles the possible exceptions (please really do _not_ use empty
except clause, it is the root of all evil)
* document the if-clause on #181 and what it means
Thanks,
Josef
----- Original Message -----
From: "Adam Williamson" <adamwill(a)fedoraproject.org>
To: qa-devel(a)lists.fedoraproject.org
Sent: Wednesday, February 18, 2015 9:24:17 AM
Subject: openqa_fedora_tools patch: add 'all' mode
This adds an 'all' mode which runs for the current validation event
compose if it hasn't already been done, then runs for the current
date's Rawhide and Branched nightlies, if they exist and aren't the
same as the current validation event. Has a --yesterday parameter to
run on the nightlies from a day earlier instead, if your timezone /
cron config don't hook up great with releng's. (In future we ought to
have a daemon that listens for compose events from fedmsg or
something). 'Today' and 'yesterday' are calculated in UTC.
Right now the non-'validation event' results are just going to sit in
OpenQA, but I have Grand Plans to get 'em out via fedmsg and/or
special wiki pages. For now only folks with VPN access or their own
Coconut instance will be able to see the results, sorry!
We *may* wind up running the tests for a nominated nightly compose
twice - once before it gets nominated, once after - but that doesn't
seem like a huge problem. Obviously we ought to build one Glorious
Unified Sausage Machine for nightlies which pre-flights 'em via OpenQA
then does the nomination if that passes, but for now this is fine, I
think.
--
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net
_______________________________________________
qa-devel mailing list
qa-devel(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/qa-devel