[igt-dev] [PATCH i-g-t] .gitlab-ci: Fix listing undocumented subtests

Arkadiusz Hiler arkadiusz.hiler at intel.com
Mon Sep 9 08:39:17 UTC 2019


Looking at this code:

  description = ""
  current_subtest = None

  for line in proc.stdout.decode().splitlines():
  if line.startswith("SUB "):
      output += [Subtest(current_subtest, description)]

So if there is no documentation on the top level we will get subtest ==
None and description == "".

Let's check for those properly so we won't falsely flag the whole binary.

Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
Reviewed-by: Petri Latvala <petri.latvala at intel.com>
---
 .gitlab-ci/list_undocumented_tests.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci/list_undocumented_tests.py b/.gitlab-ci/list_undocumented_tests.py
index 0ce3f330..d6bb0a5c 100755
--- a/.gitlab-ci/list_undocumented_tests.py
+++ b/.gitlab-ci/list_undocumented_tests.py
@@ -47,13 +47,11 @@ def main():
     for test in tests:
         subtests = get_subtests(testdir, test)
 
-        if subtests and subtests[0].name is None:
-            # top level description missing, list binary
-            print(test)
-
         for name, description in subtests:
-            if name is None: # top level description, skipping
-                continue
+            if name is None: # top level description
+                if not description: # is empty
+                    print(test) # mention the test binary
+                continue # and skip because it's not a subtest
 
             if "NO DOCUMENTATION!" in description:
                 print("{}@{}".format(test, name))
-- 
2.21.0



More information about the igt-dev mailing list