Skip to content

Commit

Permalink
set default pipeline to benchmark-only
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay Gadgil <[email protected]>
  • Loading branch information
cgchinmay committed Oct 10, 2023
1 parent e738bdf commit e56a2be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 6 additions & 8 deletions osbenchmark/test_execution_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,14 @@ 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 cfg.exists("builder", "distribution.version"):
name = "from-distribution"
else:
name = "from-sources"
logger.info("User specified no pipeline. Automatically derived pipeline [%s].", name)
if not name:
# use benchmark-only as default pipeline
name = "benchmark-only"
logger.info("User specified no pipeline. Using default pipeline [%s].", name)
cfg.add(config.Scope.applicationOverride, "test_execution", "pipeline", name)
else:
logger.info("User specified pipeline [%s].", name)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_execution_orchestrator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e56a2be

Please sign in to comment.