Skip to content
Snippets Groups Projects
Commit 97b947fe authored by Luis Araujo's avatar Luis Araujo
Browse files

Add the specific branch in the git repo macro


This will allow to show the specific branch that needs to be used
during cloning the tests scripts repository in the test cases
pages.

Signed-off-by: default avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent 2d568f10
No related branches found
No related tags found
No related merge requests found
......@@ -135,16 +135,17 @@ def get_template_values(testcase_data):
install = testcase_data.get('install')
if is_automated and install:
git_repos = install.get('git-repos', [])
git_repo_url = None
git_repo_url, git_repo_branch = None, None
for gr in git_repos:
git_repo_url = gr.get('url')
if not git_repo_url:
print("Error: missing mandatory field install:git-repos:url for " \
git_repo_url, git_repo_branch = gr.get('url'), gr.get('branch')
if not git_repo_url or not git_repo_branch:
print("Error: missing mandatory field git-repos:url/branch for " \
"automated tests")
exit(1)
template_values.update({ 'git_repo_url' : git_repo_url })
template_values.update({ 'git_repo_dir' : get_git_repo_dir(git_repo_url) })
template_values.update({ 'git_repo_branch' : git_repo_branch })
deps = install.get('deps')
if deps:
......
{% macro git_repo(git_repo_url, git_repo_dir) %}
{% macro git_repo(url, dir, branch) %}
<li class="mb-sm-2">Clone the tests repository from another computer <i>(Note that the branch being tested may change depending on the release, please make sure to clone the correct branch for the release in question)</i>:</li>
<p><kbd>$ git clone {{ git_repo_url }}</kbd></p>
<li class="mb-sm-2">Copy the test directory {{ git_repo_dir }} to the target device:</li>
<p><kbd>$ git clone --branch {{ branch }} {{ url }}</kbd></p>
<li class="mb-sm-2">Copy the test directory {{ dir }} to the target device:</li>
<p><kbd>$ DUT_IP=&ltdevice-ip&gt</kbd></p>
<p><kbd>$ scp -r {{ git_repo_dir }} user@$DUT_IP:</kbd></p>
<p><kbd>$ scp -r {{ dir }} user@$DUT_IP:</kbd></p>
<li class="mb-sm-2">Log into the target device:</li>
<p><kbd>$ ssh user@$DUT_IP</kbd></p>
{% endmacro %}
......
......@@ -43,7 +43,7 @@
{% 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) }}{% endif %}
{% if git_repo_url and not pkgname %}{{ 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