From 6ec78ba8c13cdf5e4de8051438f9224f0e1f37b8 Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Tue, 12 Mar 2019 23:33:26 +0100
Subject: [PATCH] renderer: Show install steps on manual testcases as well

The pre-condition steps generated by the `install`/`git-repos` directives
where only rendered for automated testcases. Arguably, manual testers are
more interested in those being rendered than LAVA, which usually considers
the YAML enough as-is.

This currently affected the WebKit manual testcases such as
webkit2gtk-ac-3d-rendering.yaml where no installation pre-condition was
rendered, omitting fundamental steps needed by manual testers.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 atc_renderer/renderer.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/atc_renderer/renderer.py b/atc_renderer/renderer.py
index 9fc8457..385a3c5 100644
--- a/atc_renderer/renderer.py
+++ b/atc_renderer/renderer.py
@@ -149,13 +149,16 @@ def get_template_values(testcase_data):
 
     # If the test is automated, it should always have 'install:git-repos'
     install = testcase_data.get('install')
-    if is_automated and install:
+    if install:
         git_repos = install.get('git-repos', [])
         git_repo_url, git_repo_branch = None, None
         for gr in git_repos:
             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 " \
+            if not git_repo_url:
+                print("Error: missing mandatory field git-repos:url")
+                exit(1)
+            if is_automated and not git_repo_branch:
+                print("Error: missing mandatory field git-repos:branch for " \
                       "automated tests")
                 exit(1)
 
-- 
GitLab