Skip to content

Commit

Permalink
Pass in requirements args as []string (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz authored Oct 14, 2021
1 parent f556bde commit 5f52d90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 7 additions & 3 deletions bonfire/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions bonfire/resources/default-iqe-cji.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,8 +38,8 @@ parameters:
value: "clowder_smoke"
required: true
- name: REQUIREMENTS
value: ""
value: "[]"
- name: REQUIREMENTS_PRIORITY
value: ""
value: "[]"
- name: TEST_IMPORTANCE
value: ""
value: "[]"

0 comments on commit 5f52d90

Please sign in to comment.