Skip to content
Snippets Groups Projects
Commit ced9928a authored by Emanuele Aina's avatar Emanuele Aina
Browse files

atc: Rename the precondition variables to match the testcase entry


Use names for the precondition variables that reflect the properties in
the testcase definitions so it's easier to spot what's going on.

This will alos make it easier to later expand them to use multiple
values.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 9e0de5fa
No related branches found
No related tags found
No related merge requests found
......@@ -170,7 +170,7 @@ def get_template_values(testcase_data):
if deps:
# A install.deps directive will always add a preconditions section
# to install the required packages using the macro to install packages.
template_values.update({ 'packages_list' : ' '.join(deps) })
template_values.update({ 'install_packages_preconditions' : ' '.join(deps) })
# No mandatory fields
for nm in ['notes', 'format', 'maintainer', 'resources',
......@@ -185,15 +185,15 @@ def get_template_values(testcase_data):
# Macros variables
ostree_preconditions = metadata.get('macro_ostree_preconditions')
if ostree_preconditions:
template_values.update({ 'pkgname' : ostree_preconditions })
template_values.update({ 'ostree_preconditions' : ostree_preconditions })
packages_list = metadata.get('macro_install_packages_preconditions')
if packages_list:
template_values.update({ 'packages_list' : packages_list })
template_values.update({ 'install_packages_preconditions' : packages_list })
modules_preconditions = metadata.get('macro_modules_preconditions')
if modules_preconditions:
template_values.update({ 'libname' : modules_preconditions })
template_values.update({ 'modules_preconditions' : modules_preconditions })
return template_values
......
......@@ -36,14 +36,14 @@
</ul>
{% endif %}
{% if pre_conditions or pkgname or packages_list or libname or git_repo_url %}
{% if pre_conditions or ostree_preconditions or install_packages_preconditions or modules_preconditions or git_repo_url %}
<hr />
<h4>Pre Conditions</h4>
<ol>
{% if pkgname %}{{ macros.ostree_preconditions(pkgname) }}{% endif %}
{% if packages_list %}{{ macros.install_packages(packages_list) }}{% endif %}
{% if libname %}{{ macros.modules_preconditions(libname) }}{% endif %}
{% if git_repo_url and not pkgname %}{{ macros.git_repo(git_repo_url, git_repo_dir, git_repo_branch) }}{% endif %}
{% if ostree_preconditions %}{{ macros.ostree_preconditions(ostree_preconditions) }}{% endif %}
{% if install_packages_preconditions %}{{ macros.install_packages(install_packages_preconditions) }}{% endif %}
{% if modules_preconditions %}{{ macros.modules_preconditions(modules_preconditions) }}{% endif %}
{% if git_repo_url and not ostree_preconditions %}{{ macros.git_repo(git_repo_url, git_repo_dir, git_repo_branch) }}{% endif %}
{% for comment, command, output, _, link in pre_conditions %}
{% if comment %}<li class="mb-sm-2">{{ comment|e }}</li>{% endif %}
{% if command %}<p><kbd>{{ command|e }}</kbd></p>{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment