From 5f52d90fe519b333005c441aef010df50a9da40d Mon Sep 17 00:00:00 2001 From: Brandon Squizzato <35474886+bsquizz@users.noreply.github.com> Date: Wed, 13 Oct 2021 21:33:51 -0400 Subject: [PATCH] Pass in requirements args as []string (#134) --- bonfire/processor.py | 10 +++++++--- bonfire/resources/default-iqe-cji.yaml | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bonfire/processor.py b/bonfire/processor.py index d55b9ba9..8a26e5bc 100644 --- a/bonfire/processor.py +++ b/bonfire/processor.py @@ -104,6 +104,10 @@ def process_iqe_cji( with template_path.open() as fp: template_data = yaml.safe_load(fp) + requirements = requirements.split(",") if requirements else [] + requirements_priority = requirements_priority.split(",") if requirements_priority else [] + test_importance = test_importance.split(",") if test_importance else [] + params = dict() params["DEBUG"] = str(debug).lower() params["MARKER"] = marker @@ -112,9 +116,9 @@ def process_iqe_cji( params["IMAGE_TAG"] = image_tag params["NAME"] = cji_name or f"iqe-{str(uuid.uuid4()).split('-')[0]}" params["APP_NAME"] = clowd_app_name - params["REQUIREMENTS"] = requirements - params["REQUIREMENTS_PRIORITY"] = requirements_priority - params["TEST_IMPORTANCE"] = test_importance + params["REQUIREMENTS"] = json.dumps(requirements) + params["REQUIREMENTS_PRIORITY"] = json.dumps(requirements_priority) + params["TEST_IMPORTANCE"] = json.dumps(test_importance) processed_template = process_template(template_data, params=params) diff --git a/bonfire/resources/default-iqe-cji.yaml b/bonfire/resources/default-iqe-cji.yaml index 3ab2a524..8590f6bd 100644 --- a/bonfire/resources/default-iqe-cji.yaml +++ b/bonfire/resources/default-iqe-cji.yaml @@ -17,9 +17,9 @@ objects: marker: ${MARKER} filter: ${FILTER} dynaconfEnvName: ${ENV_NAME} - requirements: ${REQUIREMENTS} - requirementsPriority: ${REQUIREMENTS_PRIORITY} - testImportance: ${TEST_IMPORTANCE} + requirements: ${{REQUIREMENTS}} + requirementsPriority: ${{REQUIREMENTS_PRIORITY}} + testImportance: ${{TEST_IMPORTANCE}} parameters: - name: NAME @@ -38,8 +38,8 @@ parameters: value: "clowder_smoke" required: true - name: REQUIREMENTS - value: "" + value: "[]" - name: REQUIREMENTS_PRIORITY - value: "" + value: "[]" - name: TEST_IMPORTANCE - value: "" + value: "[]"