Skip to content

Commit 36d2489

Browse files
Remap egressip test names for Polarion upload
Tests from openshift-tests-private use [sig-networking] classname and SDN_OVN_EgressIP_* naming. After format_test_case_name() these become sig-networking.SDN_OVN_EgressIP_* which JUMP cannot match against Polarion entries, causing "Cannot proceed without xml with tempest results" and dropping all egressip results from reporting. Add a remap step for known private-test suites (egressip_tests) that rewrites names to sig-installer.Suite_openshift_openstack.egressip.* matching the convention used by the main openstack test suites. Related-Issue: OSPRH-32723 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 84287d0 commit 36d2489

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

collection/tools/roles/tools_openshift_tests/scripts/modifyE2ETags.py

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,38 @@
44
import sys
55
import time
66

7+
# Mapping of testsuite names whose tests originate from openshift-tests-private
8+
# and need classname remapped to match the Polarion naming convention used by
9+
# the main openstack test suites (sig-installer.Suite_openshift_openstack.*).
10+
PRIVATE_TEST_SUITES = {
11+
'egressip_tests': 'sig-installer.Suite_openshift_openstack.egressip',
12+
}
13+
14+
715
def format_test_case_name(s):
816
return s.replace(':', '_').replace('/', '_').replace(' ', '_').replace('.', '_').replace('[', '.').replace(']', '.').rstrip('.').replace('..','.').replace('_.','.').replace('._','.')[1::]
917

18+
19+
def remap_private_test_name(tc_name, testsuite_name):
20+
"""Remap openshift-tests-private names to Polarion-compatible format.
21+
22+
Tests from openshift-tests-private use [sig-networking] SDN_OVN_EgressIP_*
23+
naming which JUMP cannot match. Remap to the sig-installer.Suite_openshift_openstack
24+
pattern that has registered Polarion test case entries.
25+
"""
26+
prefix = PRIVATE_TEST_SUITES.get(testsuite_name)
27+
if not prefix:
28+
return None
29+
short_name = format_test_case_name(tc_name)
30+
if short_name.startswith('OTP.'):
31+
short_name = short_name[4:]
32+
# Strip the sig-networking prefix that comes from the Ginkgo classname
33+
if '.' in short_name:
34+
_, short_name = short_name.split('.', 1)
35+
return f"{prefix}.{short_name}"
36+
37+
1038
# This script modify a given xml report so it can be uploaded to ReportPortal and Polarion.
11-
# third argument. Currently it's used for NetworkPolicy and Conformance tests
1239
# @arg1: input xml file.
1340
# @arg2: output xml file.
1441
# @arg3: Tests to include
@@ -48,9 +75,14 @@ def format_test_case_name(s):
4875
print('TestCase removed from input XML:', tc_name)
4976
ts.remove(tc)
5077
else:
51-
new_tc_name = format_test_case_name(tc_name)
52-
if new_tc_name.startswith('OTP.'):
53-
new_tc_name = new_tc_name[4:]
78+
remapped = remap_private_test_name(tc_name, testsuite_name)
79+
if remapped:
80+
new_tc_name = remapped
81+
else:
82+
new_tc_name = format_test_case_name(tc_name)
83+
if new_tc_name.startswith('OTP.'):
84+
new_tc_name = new_tc_name[4:]
85+
5486
if '.' in new_tc_name:
5587
tc_classname, tc_name_rest = new_tc_name.split('.', 1)
5688
tc.set('classname', tc_classname)

0 commit comments

Comments
 (0)