From 8c37b4116cc6307b9f0a2a1594aa3d4696326fb2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Apr 15 2016 01:20:00 +0000 Subject: fix green untested links, non-arch weights, openqa dupes three bug fixes that showed up during testing of the failed test link stuff. A cut/paste error in the new get_cell() meant untested links were green instead of blue. The image groups are sorted by a weight calculation done by fedfind. This took arch into account. This was a problem, because for nightlies the image groups include images of many arches, so the weight was somewhat unpredictable: nightlies just picks some random image (the first in the list for the group) to do the weight score with, and if it happened to pick an ARM image for a group that includes ARM images, that group would be heavily penalized. This is why the 'Server DVD' group would sometimes show up way down the list. So in fedfind 2.4.5 I made it possible to tell fedfind to ignore the arch, and now we do that (and the weight is calculated solely from the sub variant). update_openqa() didn't check for dupes, so if you call it more than once on the same compose it would add duplicates of already-stored job dicts. This wasn't obviously visible before but with the links, it was pretty clear. So this is fixed from two ends: update_openqa() now won't add a job if it's already in the list (I hope python's 'dict in list' is up to this...), and prune_jobs checks through the list of openqa jobs for ones with the same job ID and removes dupes. --- diff --git a/fedora_nightlies.py b/fedora_nightlies.py index 2335bd9..0b34d22 100755 --- a/fedora_nightlies.py +++ b/fedora_nightlies.py @@ -48,7 +48,7 @@ th {background-color: lightgrey;}

Fedora nightly compose finder

This page helps you locate recent Fedora nightly composes. For each Fedora image, you can find the latest Branched and Rawhide nightly composes that completed. For images tested by openQA, you can also find the latest image for which all image-specific tests passed. This is not as strong an indication of quality as official Alpha or Beta status, but at least indicates that the image successfully boots, completes a system installation, and boots to the installed system, in a straightforward virtual machine configuration. These images are NOT official Fedora pre-releases. For assistance, contact #fedora-qa on Freenode IRC or the test@ mailing list.

-

Red linked images are known to have failed tests; green linked images are known to have passed all tests; blue linked images are untested or testing status is unknown.

+

Red linked images are known to have failed tests; green linked images are known to have passed all tests; blue linked images are untested or testing status is unknown. Mouse over red links to display links to the failed tests.

Generated by Fedora nightlies at: {{DATE}} (UTC)

{{TABLES}} @@ -113,7 +113,7 @@ def get_cell(image): if image.testspass is True: content = lnpart(cssclass='passedlink') elif image.testspass is None: - content = lnpart(cssclass='passedlink') + content = lnpart() else: # fail. this case is more complex. we need the contents of the # cell to include the failed test links popups. @@ -409,6 +409,16 @@ class Nightlies(object): for image in list(self.data): if image.release not in rels or image not in latests: self.data.remove(image) + # remove any duped openQA job dicts. this should not + # happen any more, but may as well keep it just in case. + elif image['openqa']: + for job in list(image['openqa']): + while True: + matches = [gotjob for gotjob in image['openqa'] if job == gotjob] + if len(matches) > 1: + image['openqa'].remove(job) + else: + break def seed_data(self, days=28): """Initialize the base data set by reading in the last 'days' @@ -509,8 +519,9 @@ class Nightlies(object): if len(matches) == 0: logger.warning("update_openqa: No Image found for flavor %s, " "arch %s, compose %s", flavor, arch, compose) - # exactly one match! yay. add job to image's list. - elif len(matches) == 1: + # exactly one match! yay. add job to image's list...if + # we don't already have it + elif len(matches) == 1 and job not in matches[0]['openqa']: matches[0]['openqa'].append(job) elif len(matches) > 1: logger.warning("update_openqa: More than one Image found for " @@ -569,7 +580,7 @@ class Nightlies(object): # weight of any old image in the group, arches not yet sorted rels = sorted(set(image.release for image in self.data)) arches = set(image['arch'] for image in self.data) - groups = dict((image.group, fedfind.helpers.get_weight(image)) for image in self.data) + groups = dict((image.group, fedfind.helpers.get_weight(image, arch=False)) for image in self.data) groups = sorted(groups.keys(), key=lambda x: groups[x], reverse=True) if flat: # this is pretty easy.... diff --git a/setup.py b/setup.py index c7ad53c..a2cad88 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ setup( keywords = "fedora release image media iso nightly", url = "https://pagure.io/fedora_nightlies", py_modules = ["fedora_nightlies"], - install_requires = ['setuptools', 'fedmsg', 'fedfind>=2.4.4', 'openqa_client', 'six'], + install_requires = ['setuptools', 'fedmsg', 'fedfind>=2.4.5', 'openqa_client', 'six'], tests_require=['pytest', 'mock'], cmdclass = {'test': PyTest}, long_description=read('README.md'),