Skip to content

Commit

Permalink
Use EnvVar objects, do not pass in arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Oct 24, 2023
1 parent 9efa5e1 commit c6a6ab4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
20 changes: 8 additions & 12 deletions bonfire/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,23 @@ 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["DEBUG"] = json.dumps(debug)
params["MARKER"] = marker
params["FILTER"] = filter
params["ENV_NAME"] = env
params["IMAGE_TAG"] = image_tag
params["PLUGINS"] = plugins
params["NAME"] = cji_name or f"iqe-{str(uuid.uuid4()).split('-')[0]}"
params["APP_NAME"] = clowd_app_name
params["REQUIREMENTS"] = json.dumps(requirements)
params["REQUIREMENTS_PRIORITY"] = json.dumps(requirements_priority)
params["TEST_IMPORTANCE"] = json.dumps(test_importance)
params["REQUIREMENTS"] = requirements
params["REQUIREMENTS_PRIORITY"] = requirements_priority
params["TEST_IMPORTANCE"] = test_importance
params["DEPLOY_SELENIUM"] = json.dumps(selenium)
params["PARALLEL_ENABLED"] = json.dumps(parallel_enabled)
params["PARALLEL_WORKER_COUNT"] = json.dumps(parallel_worker_count)
params["RP_ARGS"] = json.dumps(rp_args)
params["IBUTSU_SOURCE"] = json.dumps(ibutsu_source)
params["PARALLEL_ENABLED"] = parallel_enabled
params["PARALLEL_WORKER_COUNT"] = parallel_worker_count
params["RP_ARGS"] = rp_args
params["IBUTSU_SOURCE"] = ibutsu_source

processed_template = _process_template(template_data, params=params, local=local)

Expand Down
40 changes: 26 additions & 14 deletions bonfire/resources/default-iqe-cji.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,32 @@ objects:
iqe:
debug: ${{DEBUG}}
imageTag: ${IMAGE_TAG}
marker: ${MARKER}
filter: ${FILTER}
plugins: ${PLUGINS}
dynaconfEnvName: ${ENV_NAME}
requirements: ${{REQUIREMENTS}}
requirementsPriority: ${{REQUIREMENTS_PRIORITY}}
testImportance: ${{TEST_IMPORTANCE}}
parallelEnabled: ${{PARALLEL_ENABLED}}
parallelWorkerCount: ${{PARALLEL_WORKER_COUNT}}
rpArgs: ${{RP_ARGS}}
ibutsuSource: ${{IBUTSU_SOURCE}}
ui:
selenium:
deploy: ${{DEPLOY_SELENIUM}}
env:
- name: IQE_MARKER_EXPRESSION
value: ${MARKER}
- name: IQE_FILTER_EXPRESSION
value: ${FILTER}
- name: IQE_PLUGINS
value: ${PLUGINS}
- name: ENV_FOR_DYNACONF
value: ${ENV_NAME}
- name: IQE_REQUIREMENTS
value: ${REQUIREMENTS}
- name: IQE_REQUIREMENTS_PRIORITY
value: ${REQUIREMENTS_PRIORITY}
- name: IQE_TEST_IMPORTANCE
value: ${TEST_IMPORTANCE}
- name: IQE_PARALLEL_ENABLED
value: ${PARALLEL_ENABLED}
- name: IQE_PARALLEL_WORKER_COUNT
value: ${PARALLEL_WORKER_COUNT}
- name: IQE_RP_ARGS
value: ${RP_ARGS}
- name: IQE_IBUTSU_SOURCE
value: ${IBUTSU_SOURCE}

parameters:
- name: NAME
Expand All @@ -46,11 +58,11 @@ parameters:
value: "clowder_smoke"
required: true
- name: REQUIREMENTS
value: "[]"
value: ""
- name: REQUIREMENTS_PRIORITY
value: "[]"
value: ""
- name: TEST_IMPORTANCE
value: "[]"
value: ""
- name: PLUGINS
value: ""
- name: DEPLOY_SELENIUM
Expand Down

0 comments on commit c6a6ab4

Please sign in to comment.