From cc35a0cdb4c82181c6030fe27e567ba86afe9038 Mon Sep 17 00:00:00 2001 From: David Butenhof Date: Mon, 21 Aug 2023 16:52:28 -0400 Subject: [PATCH] Adapt to Quisby fio support (#3522) PBENCH-1212 (This Jira issue was originally a placeholder in case changes had to be made to the `comparison` or `visualize` APIs for `fio` support. It seemed likely that wouldn't be necessary, and I'm appropriating the Jira to unlock the `pquisby` package version and adjust tests.) First, unlock the `pquisby` package version to allow consuming the 0.0.17 version with `fio` support added. Both unit and functional tests validate the set of benchmarked workloads for which Pbench claims support, and needed to be updated for the addition of `fio`. The `endpoints` API was also reporting the workloads in order from Pquisby's ENUM, and to make the tests a bit more supportable I sorted the list we report. --- lib/pbench/server/api/resources/endpoint_configure.py | 4 +++- lib/pbench/test/functional/server/test_connect.py | 2 +- lib/pbench/test/unit/server/test_endpoint_configure.py | 2 +- server/requirements.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/pbench/server/api/resources/endpoint_configure.py b/lib/pbench/server/api/resources/endpoint_configure.py index 2f8de5c761..419fef9b3d 100644 --- a/lib/pbench/server/api/resources/endpoint_configure.py +++ b/lib/pbench/server/api/resources/endpoint_configure.py @@ -124,7 +124,9 @@ def _get(self, args: ApiParams, request: Request, context: ApiContext) -> Respon "identification": f"Pbench server {self.server_config.COMMIT_ID}", "uri": templates, "visualization": { - "benchmarks": [m.lower() for m in BenchmarkName.__members__.keys()] + "benchmarks": sorted( + m.lower() for m in BenchmarkName.__members__.keys() + ) }, } diff --git a/lib/pbench/test/functional/server/test_connect.py b/lib/pbench/test/functional/server/test_connect.py index 249f472eb4..eab361cf56 100644 --- a/lib/pbench/test/functional/server/test_connect.py +++ b/lib/pbench/test/functional/server/test_connect.py @@ -14,7 +14,7 @@ def test_connect(self, server_client: PbenchServerClient): assert endpoints assert "identification" in endpoints assert "uri" in endpoints - assert endpoints["visualization"]["benchmarks"] == ["uperf"] + assert sorted(endpoints["visualization"]["benchmarks"]) == ["fio", "uperf"] # Verify that all expected endpoints are reported for a in endpoints["uri"].keys(): diff --git a/lib/pbench/test/unit/server/test_endpoint_configure.py b/lib/pbench/test/unit/server/test_endpoint_configure.py index 1b146e89a9..041dd7dcdb 100644 --- a/lib/pbench/test/unit/server/test_endpoint_configure.py +++ b/lib/pbench/test/unit/server/test_endpoint_configure.py @@ -54,7 +54,7 @@ def check_config(self, client, server_config, host, my_headers={}): uri = urljoin(host, uri_prefix) expected_results = { "identification": f"Pbench server {server_config.COMMIT_ID}", - "visualization": {"benchmarks": ["uperf"]}, + "visualization": {"benchmarks": ["fio", "uperf"]}, "uri": { "datasets": { "template": f"{uri}/datasets/{{dataset}}", diff --git a/server/requirements.txt b/server/requirements.txt index 2ed7326f12..f828360189 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -12,7 +12,7 @@ flask-restful>=0.3.9 flask-sqlalchemy gunicorn humanize -pquisby<0.0.13 +pquisby psycopg2 pyesbulk>=2.0.1 PyJwt[crypto]