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 9, 2023
1 parent c3826e9 commit c54fd5d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 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
41 changes: 26 additions & 15 deletions bonfire/resources/default-iqe-cji.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,32 @@ objects:
iqe:
debug: ${{DEBUG}}
imageTag: ${IMAGE_TAG}
env:
IQE_MARKER_EXPRESSION: ${MARKER}
IQE_FILTER_EXPRESSION: ${FILTER}
IQE_PLUGINS: ${PLUGINS}
ENV_FOR_DYNACONF: ${ENV_NAME}
IQE_REQUIREMENTS: ${{REQUIREMENTS}}
IQE_REQUIREMENTS_PRIORITY: ${{REQUIREMENTS_PRIORITY}}
IQE_TEST_IMPORTANCE: ${{TEST_IMPORTANCE}}
IQE_PARALLEL_ENABLED: ${{PARALLEL_ENABLED}}
IQE_PARALLEL_WORKER_COUNT: ${{PARALLEL_WORKER_COUNT}}
IQE_RP_ARGS: ${{RP_ARGS}}
IQE_IBUTSU_SOURCE: ${{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 @@ -47,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 c54fd5d

Please sign in to comment.