Skip to content

Commit c906fb2

Browse files
committed
Add subtest_id to _short_name_map_file for unfiltered test names
Stores the unfiltered short name as subtest_id in the existing _short_name_map_file dictionary during cartesian config parsing, preserving all subtest labels including type_specific and io-* provider prefixes. Only applies to subtests.cfg variants. Access via: params.get("_short_name_map_file")["subtest_id"] Example: - subtest_id: "type_specific.io-github-autotest-qemu. guest_iommu_test.eim_off.default" Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Houqi (Nick) Zuo <hzuo@redhat.com>
1 parent d3f276d commit c906fb2

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

virttest/cartesian_config.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@
139139
import re
140140
import sys
141141

142-
_reserved_keys = set(
143-
("name", "shortname", "dep", "_short_name_map_file", "_name_map_file")
144-
)
142+
_reserved_keys = set(("name", "shortname", "dep", "_short_name_map_file", "_name_map_file"))
145143
options = None
146144
num_failed_cases = 5
147145

@@ -1803,6 +1801,27 @@ def _parse(self, lexer, node=None, prev_indent=-1):
18031801
)
18041802
node3.content += [(lexer.filename, lexer.linenum, op)]
18051803

1804+
# Store subtest_id in _short_name_map_file (only for subtests.cfg)
1805+
if os.path.basename(lexer.filename) == "subtests.cfg":
1806+
subtest_id_parts = []
1807+
1808+
for label in node3.name:
1809+
label_name = str(label.name)
1810+
# Keep all parts without filtering
1811+
subtest_id_parts.append(label_name)
1812+
1813+
# Create the subtest_id map entry
1814+
if subtest_id_parts:
1815+
subtest_id_op = LUpdateFileMap()
1816+
subtest_id_op.set_operands(
1817+
"subtest_id",
1818+
".".join(subtest_id_parts),
1819+
"_short_name_map_file",
1820+
)
1821+
node3.content += [
1822+
(lexer.filename, lexer.linenum, subtest_id_op)
1823+
]
1824+
18061825
if node3.default and self.defaults:
18071826
# Move default variant in front of rest
18081827
# of all variants.

0 commit comments

Comments
 (0)