tests: Fix: Exclude test include YAML files from tests
authorErica Bugden <ebugden@efficios.com>
Fri, 5 May 2023 15:55:54 +0000 (11:55 -0400)
committerErica Bugden <ebugden@efficios.com>
Tue, 16 May 2023 18:24:42 +0000 (14:24 -0400)
These partial YAML files are included as part of other test cases and
are not intended to be run as separate tests.

The tests run based on these partial files were still listed as passing
because currently the test system only checks that a test fails
configuration, but does not compare the reason for that failure with an
expected reason. Since all the included files are invalid partial
configurations, configuration generation would necessarily fail, and so
the test would "pass".

Change-Id: Iaea53b6ff1fa184d284079befe695f22ad53ef09
Signed-off-by: Erica Bugden <ebugden@efficios.com>
tests/config/yaml/conftest.py

index 4b79bd0b1b6c6e6ff1b63ed8621a105b5cd34ca7..3ce2845f7a03893f5882d88415bb1cf8309e9b10 100644 (file)
@@ -33,6 +33,10 @@ def pytest_collect_file(parent, path):
         # not a YAML file: cancel
         return
 
+    if path.fnmatch('*.inc.yaml'):
+        # not a top-level test file (partial inclusion YAML file)
+        return
+
     # At the end of this loop, if `path` is
     # `/home/jo/barectf/tests/config/yaml/2/configs/fail/stream/pct-no.yaml`,
     # for example, then `elems` is:
This page took 0.024585 seconds and 4 git commands to generate.