Skip to content

Commit 664ee84

Browse files
committed
Remove modifications to testcase.py
This will generate the Subproject labels off of the keywords to match the way test labels are naturally generated in CDash (and Canary).
1 parent 57a8ff4 commit 664ee84

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

src/_canary/plugins/builtin/cdash/xml_generator.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,7 @@ def write_test_xml(
224224
doc = self.create_document()
225225
root = doc.firstChild
226226

227-
if use_labels:
228-
project_labesls = set()
229-
for case in cases:
230-
if case.subproject_labels is not None:
231-
for sub_proj_labels in case.subproject_labels:
232-
project_labesls.add(sub_proj_labels)
233-
subproject_labels = list(project_labesls)
227+
subproject_labels = self.canary_generate_subproject_labels(cases, use_labels)
234228

235229
if subproject_labels is not None:
236230
for label in subproject_labels:
@@ -378,6 +372,16 @@ def write_test_xml(
378372

379373
return filename
380374

375+
def canary_generate_subproject_labels(self, cases, use_labels):
376+
if use_labels:
377+
project_labesls = set()
378+
for case in cases:
379+
if case.keywords is not None:
380+
for sub_proj_labels in case.keywords:
381+
project_labesls.add(sub_proj_labels)
382+
subproject_labels = list(project_labesls)
383+
return subproject_labels
384+
381385
def write_notes_xml(self) -> str | None:
382386
if not self.notes:
383387
return None

src/_canary/testcase.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ def __init__(
324324
self._family: str = ""
325325
self._classname: str | None = None
326326
self._keywords: list[str] = []
327-
self._subproject_labels: list[str] | None = None
328327
self._parameters: Parameters = Parameters()
329328
self._timeout: float | None = None
330329
self._baseline: list[str | tuple[str, str]] = []
@@ -572,15 +571,6 @@ def keywords(self) -> list[str]:
572571
def keywords(self, arg: list[str]) -> None:
573572
self._keywords = list(arg)
574573

575-
@property
576-
def subproject_labels(self) -> list[str] | None:
577-
"""Test subproject labels"""
578-
return self._subproject_labels
579-
580-
@subproject_labels.setter
581-
def subproject_labels(self, arg: list[str]) -> None:
582-
self._subproject_labels = list(arg)
583-
584574
@property
585575
def implicit_keywords(self) -> list[str]:
586576
"""Implicit keywords, used for some filtering operations"""

0 commit comments

Comments
 (0)