From e0515fb142f21a87bb51a44c317c1bc5ce7f0ace Mon Sep 17 00:00:00 2001 From: Webb Scales <7795764+webbnh@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:51:30 -0500 Subject: [PATCH] Sort all items in the tarball stats report (#2637) * Sort _all_ items in the tarball stats report to ensure that the testing is deterministic * Add rev-lock on humanize for jinja2-humanize-extension * Update the gold file --- server/bin/gold/test-5.2.txt | 4 ++-- server/bin/pbench-tarball-stats.py | 4 ++-- server/requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/bin/gold/test-5.2.txt b/server/bin/gold/test-5.2.txt index 1416ab26fa..56904ebf91 100644 --- a/server/bin/gold/test-5.2.txt +++ b/server/bin/gold/test-5.2.txt @@ -356,13 +356,13 @@ Summary Statistics for Tar Balls on 1970-01-01 (external data only): 1.8 kB size By Server Origin: - 5 main pbench server 3 "ONE" pbench satellite server + 5 main pbench server Controller Counts: 6 controllers - 3 main pbench server 3 "ONE" pbench satellite server + 3 main pbench server Tar Ball Counts broken down by weeks for most recent 2 months (with satellite percentages): diff --git a/server/bin/pbench-tarball-stats.py b/server/bin/pbench-tarball-stats.py index 3e1e173933..e9b6be4c78 100755 --- a/server/bin/pbench-tarball-stats.py +++ b/server/bin/pbench-tarball-stats.py @@ -173,13 +173,13 @@ def transform_buckets(buckets: dict, sat_names: list, now: datetime, kind: str): {{ "{:>18s}".format(good.size|humanize_naturalsize) }} size By Server Origin: - {% for name, value in server_origin.items() %} + {% for name, value in server_origin.items()|sort %} {{ "{:18n}".format(value) }} {% if name == "main" %}{{ name }} pbench server{% else %}"{{ name }}" pbench satellite server{% endif +%} {% endfor %} Controller Counts: {{ "{:18n}".format(good.ctrls.keys()|length) }} controllers - {% for name, value in satellites.items() %} + {% for name, value in satellites.items()|sort %} {{ "{:18n}".format(value) }} {% if name == "main" %}{{ name }} pbench server{% else %}"{{ name }}" pbench satellite server{% endif +%} {% endfor %} {% endif %} diff --git a/server/requirements.txt b/server/requirements.txt index 3b5750b444..4da4f1ab3d 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,5 +1,5 @@ boto3 elasticsearch1 -humanize>=3.11 +humanize>=3.11, <4.0.0 jinja2>=3.0 jinja2-humanize-extension