From 9bb8ad42efbd5440cc5b4b2de67201235b531fbb Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Sun, 15 Oct 2023 14:34:37 -0700 Subject: [PATCH 1/2] set benchmark-only as default pipeline instead of from-sources Signed-off-by: Chinmay Gadgil --- it/sources_test.py | 2 +- osbenchmark/test_execution_orchestrator.py | 12 +++++++----- tests/test_execution_orchestrator_test.py | 9 +++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/it/sources_test.py b/it/sources_test.py index f9aa6ea7a..2ee07b164 100644 --- a/it/sources_test.py +++ b/it/sources_test.py @@ -28,7 +28,7 @@ def test_sources(cfg): port = 19200 it.wait_until_port_is_free(port_number=port) - assert it.execute_test(cfg, f"--revision=latest --workload=geonames --test-mode --target-hosts=127.0.0.1:{port} " + assert it.execute_test(cfg, f"--pipeline=from-sources --revision=latest --workload=geonames --test-mode --target-hosts=127.0.0.1:{port} " f"--test-procedure=append-no-conflicts --provision-config-instance=4gheap " f"--opensearch-plugins=analysis-icu") == 0 diff --git a/osbenchmark/test_execution_orchestrator.py b/osbenchmark/test_execution_orchestrator.py index 4acb89662..966de9a27 100644 --- a/osbenchmark/test_execution_orchestrator.py +++ b/osbenchmark/test_execution_orchestrator.py @@ -344,16 +344,18 @@ def list_pipelines(): def run(cfg): logger = logging.getLogger(__name__) - name = cfg.opts("test_execution", "pipeline") + # pipeline is no more mandatory, will default to benchmark-only + name = cfg.opts("test_execution", "pipeline", mandatory=False) test_execution_id = cfg.opts("system", "test_execution.id") logger.info("Test Execution id [%s]", test_execution_id) - if len(name) == 0: - # assume from-distribution pipeline if distribution.version has been specified and --pipeline cli arg not set + if not name: + # assume from-distribution pipeline if distribution.version has been specified if cfg.exists("builder", "distribution.version"): name = "from-distribution" else: - name = "from-sources" - logger.info("User specified no pipeline. Automatically derived pipeline [%s].", name) + name = "benchmark-only" + logger.info("User did not specify distribution.version or pipeline. Using default pipeline [%s].", name) + cfg.add(config.Scope.applicationOverride, "test_execution", "pipeline", name) else: logger.info("User specified pipeline [%s].", name) diff --git a/tests/test_execution_orchestrator_test.py b/tests/test_execution_orchestrator_test.py index 02ee18803..2c802337b 100644 --- a/tests/test_execution_orchestrator_test.py +++ b/tests/test_execution_orchestrator_test.py @@ -114,3 +114,12 @@ def test_runs_a_known_pipeline(unittest_pipeline): test_execution_orchestrator.run(cfg) unittest_pipeline.target.assert_called_once_with(cfg) + +def test_runs_a_default_pipeline(benchmark_only_pipeline): + # with no pipeline specified, should default to benchmark-only + cfg = config.Config() + cfg.add(config.Scope.benchmark, "system", "test_execution.id", "28a032d1-0b03-4579-ad2a-c65316f126e9") + + test_execution_orchestrator.run(cfg) + + benchmark_only_pipeline.target.assert_called_once_with(cfg) From 21340d954becf84a430169888c3010c2f7b8e169 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Mon, 16 Oct 2023 11:18:50 -0700 Subject: [PATCH 2/2] fixed formatting error Signed-off-by: Chinmay Gadgil --- it/sources_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/it/sources_test.py b/it/sources_test.py index 2ee07b164..478fe5b4c 100644 --- a/it/sources_test.py +++ b/it/sources_test.py @@ -28,7 +28,8 @@ def test_sources(cfg): port = 19200 it.wait_until_port_is_free(port_number=port) - assert it.execute_test(cfg, f"--pipeline=from-sources --revision=latest --workload=geonames --test-mode --target-hosts=127.0.0.1:{port} " + assert it.execute_test(cfg, f"--pipeline=from-sources --revision=latest \ + --workload=geonames --test-mode --target-hosts=127.0.0.1:{port} " f"--test-procedure=append-no-conflicts --provision-config-instance=4gheap " f"--opensearch-plugins=analysis-icu") == 0