From ebd1c0075b5183ab40eecc34d6c5ca1c5219ae61 Mon Sep 17 00:00:00 2001 From: Jan Musial Date: Fri, 3 Jul 2020 11:30:29 +0200 Subject: [PATCH] Add switch for specifying buildtype in performance tests Signed-off-by: Jan Musial --- test/functional/tests/performance/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/functional/tests/performance/conftest.py b/test/functional/tests/performance/conftest.py index db0a12f..3c9e441 100644 --- a/test/functional/tests/performance/conftest.py +++ b/test/functional/tests/performance/conftest.py @@ -28,6 +28,9 @@ def perf_collector(request): container.insert_config_param(TestRun.disks["cache"].disk_type, ConfigParameter.CACHE_TYPE) container.insert_config_param(TestRun.disks["core"].disk_type, ConfigParameter.CORE_TYPE) container.insert_config_param(dt.now(), ConfigParameter.TIMESTAMP) + container.insert_config_param( + request.config.getoption("--build-type"), ConfigParameter.BUILD_TYPE + ) if TestRun.dut.ip: container.insert_config_param(TestRun.dut.ip, ConfigParameter.DUT) @@ -37,5 +40,9 @@ def perf_collector(request): json.dump(container.to_serializable_dict(), dump_file, indent=4) +def pytest_addoption(parser): + parser.addoption("--build-type", choices=BuildTypes, default="other") + + def pytest_configure(config): config.addinivalue_line("markers", "performance: performance test")