From patchwork Thu May 23 14:53:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ninette Adhikari X-Patchwork-Id: 44094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6119BC41513 for ; Thu, 23 May 2024 14:53:47 +0000 (UTC) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mx.groups.io with SMTP id smtpd.web10.595.1716476026490132048 for ; Thu, 23 May 2024 07:53:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@thehoodiefirm-com.20230601.gappssmtp.com header.s=20230601 header.b=QradZLBY; spf=neutral (domain: thehoodiefirm.com, ip: 209.85.208.47, mailfrom: ninette@thehoodiefirm.com) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-56e69888a36so12969941a12.3 for ; Thu, 23 May 2024 07:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thehoodiefirm-com.20230601.gappssmtp.com; s=20230601; t=1716476025; x=1717080825; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=S4lpPe0UFClaodcxvB70T8RmSHyDYRqy/PirT9zFX7g=; b=QradZLBYjb9MxSqzT7aGYbitwuHcnNkfOVWOleejff9Ni0mJHPVjI2TUh2pFB/eZUN t6FMRfRTfSRkNUtG1fpXcFnt9S4OMGCKed7tfXw65sKy0mRIYz+oSTpSzGFtlQsD34mg VvYLrm0cF5VZrdyqxSOTHmhBsqVgqH2GubxHp1GQGKVcw470R14kODHN0ii3WNlLn6su PTrz0y+0t+1zf4nMMzM3pscXZXlZXLce0XsO3p8ZG5HT6q0SBkq4jUanls+rmnVDVf3j fQ4+CejJ/fA25L5RbGSA2S2NKhhnZ7F+J6/xygNUFeIAAxffZZzmD8ycOAJl+JQhv/0z iWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716476025; x=1717080825; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=S4lpPe0UFClaodcxvB70T8RmSHyDYRqy/PirT9zFX7g=; b=Vm5It4sSOLH0XafXS0lxRrRrK/fjtIJlqNb+Y8POtcSrBXb3HIrNWFvn/3lOO+RPZx gPvrGaR2u17+vxtxQW0LhFjeUcfkr70Stae7cL+4N7y0oDGYTcdLGM2PkghCF1dnGPhM Hx1/qOMshc7pbHa8zk+ljW7B1h7i37AK9uRuJli3rfOvAOuUMLNDW2hc0+sTYASAZy76 QveQpNPOIfaDroKnbYmAjGZBj557t9ZwlODvIrGuwuULSYXud6BBxg3BAbYvKnLs6OyV uOkdKZmxIOiY1z6KRYohzg0no6DH5vNZIktiydFoaiTdznIZ6f3kQ6b0ht1Pnwtqabb1 fK7w== X-Gm-Message-State: AOJu0YybSr1pi5wg5ZkRn0wv2d/kMEUZY8syFoNK9QXKVmLISEgdOvlY 0tsUoP6qPa6AxAlZrCZBCHXCjnUBS8Di9NtfBe7NIhVaCXBTR2lyLJOZstaIUPHletJbGe6Rfhh j5y0= X-Google-Smtp-Source: AGHT+IF6Bxef2jRt5iXYNXBCFU8xu/9mbNxMDgiUUIPjP+/44uLCtnmTVD4eQ6/Oth27zCzwwbY1OA== X-Received: by 2002:a50:9e2d:0:b0:572:9962:7f0 with SMTP id 4fb4d7f45d1cf-57832c51110mr3053398a12.34.1716476024760; Thu, 23 May 2024 07:53:44 -0700 (PDT) Received: from localhost.localdomain ([62.72.77.226]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c322c06sm20394959a12.85.2024.05.23.07.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 07:53:44 -0700 (PDT) From: Ninette Adhikari To: yocto-patches@lists.yoctoproject.org Cc: engineering@neighbourhood.ie, =?utf-8?q?Alba_Herrer=C3=ADas?= , Ninette Adhikari <13760198+ninetteadhikari@users.noreply.github.com> Subject: [PATCH 1/1] scripts/generate-testresult-index.py: index of autobuilder test results improvements Date: Thu, 23 May 2024 16:53:31 +0200 Message-ID: <20240523145331.49565-2-ninette@thehoodiefirm.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240523145331.49565-1-ninette@thehoodiefirm.com> References: <20240523145331.49565-1-ninette@thehoodiefirm.com> Reply-To: engineering@neighbourhood.ie MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 May 2024 14:53:47 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/181 From: Alba HerrerĂ­as - Added pico.css to make CSS improvements - Added filters to the table for better readability of the test results. Filters were added for build type, branch and date - Added pagination, which improved the performance of the website - The html index template has been added as a separate file for better maintainability Co-Authored-By: Ninette Adhikari <13760198+ninetteadhikari@users.noreply.github.com> --- scripts/generate-testresult-index.py | 103 +++---- scripts/index-table.html | 401 +++++++++++++++++++++++++++ 2 files changed, 439 insertions(+), 65 deletions(-) create mode 100644 scripts/index-table.html diff --git a/scripts/generate-testresult-index.py b/scripts/generate-testresult-index.py index 61b684a..568154d 100755 --- a/scripts/generate-testresult-index.py +++ b/scripts/generate-testresult-index.py @@ -13,68 +13,6 @@ import re import subprocess from jinja2 import Template -index_template = """ - - - - - - Index of autobuilder test results - - - - - - - - - - - - - - - - - - -{% for entry in entries %} - - - - - - - - - - -{% endfor %} - -
BuildTypeBranchTest Results ReportPerformance Reportsptest LogsBuildhistoryHost Data
{{entry[0]}}{% if entry[2] %} {{entry[2]}}{% endif %}{% if entry[4] %} {{entry[4]}}{% endif %} - {% if entry[3] %}Report{% endif -%} - {% if entry[9] %}
Regressions{% endif %} -
- {% for perfrep in entry[6] %} - {{perfrep[1]}} - {% endfor %} - - {% for ptest in entry[7] %} - {{ptest[1]}} - {% endfor %} - - {% for bh in entry[5] %} - {{bh[1]}} - {% endfor %} - - {% for hd in entry[8] %} - {{hd[1]}} - {% endfor %} -
- - -""" - def parse_args(argv=None): """Parse command line arguments""" parser = argparse.ArgumentParser( @@ -88,6 +26,9 @@ def parse_args(argv=None): args = parse_args() path = os.path.abspath(args.path) entries = [] +filter_items = dict() +build_types = set() +branch_list= set() def get_build_branch(p): for root, dirs, files in os.walk(p): @@ -175,7 +116,34 @@ for build in sorted(os.listdir(path), key=keygen, reverse=True): branch = get_build_branch(buildpath) - entries.append((build, reldir, btype, testreport, branch, buildhistory, perfreports, ptestlogs, hd, regressionreport)) + build_types.add(btype) + if branch: branch_list.add(branch) + # Creates a dictionary of items to be filtered for build types and branch + filter_items["build_types"] = build_types + filter_items["branch_list"] = branch_list + + entry = { + 'build': build, + 'btype': btype, + 'reldir': reldir + } + + if testreport: + entry['testreport'] = testreport + if branch: + entry['branch'] = branch + if buildhistory: + entry['buildhistory'] = buildhistory + if perfreports: + entry['perfreports'] = perfreports + if ptestlogs: + entry['ptestlogs'] = ptestlogs + if hd: + entry['hd'] = hd + if regressionreport: + entry['regressionreport'] = regressionreport + + entries.append(entry) # Also ensure we have saved out log data for ptest runs to aid debugging if "ptest" in btype or btype in ["full", "quick"]: @@ -191,6 +159,11 @@ for build in sorted(os.listdir(path), key=keygen, reverse=True): with open(f + "/resulttool-done.log", "a+") as tf: tf.write("\n") -t = Template(index_template) +with open("./index-table.html") as file_: + t = Template(file_.read()) + +with open(os.path.join(path, "data.json"), 'w') as f: + json.dump(entries, f) + with open(os.path.join(path, "index.html"), 'w') as f: - f.write(t.render(entries = entries)) + f.write(t.render(entries = entries, filter_items = filter_items)) diff --git a/scripts/index-table.html b/scripts/index-table.html new file mode 100644 index 0000000..e0d819d --- /dev/null +++ b/scripts/index-table.html @@ -0,0 +1,401 @@ + + + + + + Index of autobuilder test results + + + + + +
+

Index of autobuilder test results

+

The table below lists the test results of all the builds and branch from the yocto autobuilder repository.

+

The filters for showing build types and branch helps to navigate the table.

+
+
+ + + + + + + + + + + + + + + + +
BuildTypeBranchTest Results ReportPerformance Reportsptest LogsBuildhistoryHost Data
+ +

+
+ + + +