Skip to content

Commit

Permalink
Split and move testsuites.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Sep 26, 2024
1 parent 1118ba5 commit c87744e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
# disable_list: "windows:pypy-3.8 windows:pypy-3.9 windows:pypy-3.10"

UnitTesting:
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
needs:
- UnitTestingParams
with:
Expand Down
30 changes: 25 additions & 5 deletions pyEDAA/Reports/CLI/Unittesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _processPyTest(self, testsuiteSummary: TestsuiteSummary, cleanups: str) -> N
else:
self.WriteError(f"Syntax error: '{cleanup}'")

def _processPyTest_RewiteDunderInit(self, testsuiteSummary: TestsuiteSummary):
def _processPyTest_RewiteDunderInit(self, testsuiteSummary: TestsuiteSummary) -> None:
self.WriteVerbose(f" Rewriting '__init__' in classnames to actual Python package names")

def processTestsuite(suite: Testsuite) -> None:
Expand All @@ -312,7 +312,7 @@ def processTestsuite(suite: Testsuite) -> None:

processTestsuite(testsuiteSummary)

def _processPyTest_ReduceDepth(self, testsuiteSummary: TestsuiteSummary, path: str):
def _processPyTest_ReduceDepth(self, testsuiteSummary: TestsuiteSummary, path: str) -> None:
self.WriteVerbose(f" Reducing path depth of testsuite '{path}'")
cleanups = []
suite = testsuiteSummary
Expand Down Expand Up @@ -352,10 +352,30 @@ def _processPyTest_ReduceDepth(self, testsuiteSummary: TestsuiteSummary, path: s
self.WriteDebug(f" skipping '{name}'")
break

def _processPyTest_SplitTestsuite(self, testsuiteSummary: TestsuiteSummary, path: str):
def _processPyTest_SplitTestsuite(self, testsuiteSummary: TestsuiteSummary, path: str) -> None:
self.WriteVerbose(f" Splitting testsuite '{path}'")
for testsuite in testsuiteSummary.Testsuites[path].Testsuites.values():
self.WriteDebug(f" Moving {testsuite.Name} to {testsuiteSummary.Name}")
if path not in testsuiteSummary.Testsuites:
self.WriteError(f"Path '{path}' not found")
return

cleanups = []
parentTestsuite = testsuiteSummary
workingTestsuite = parentTestsuite.Testsuites[path]
for testsuite in workingTestsuite.Testsuites.values():
self.WriteDebug(f" Moving {testsuite.Name} to {parentTestsuite.Name}")

testsuiteName = testsuite._name
parentTestsuite.Testsuites[testsuiteName] = testsuite
testsuite._parent = parentTestsuite

cleanups.append(testsuiteName)

for cleanup in cleanups:
del workingTestsuite.Testsuites[cleanup]

if len(workingTestsuite.Testsuites) == 0 and len(workingTestsuite.Testcases) == 0:
self.WriteVerbose(f" Removing empty testsuite '{path}'")
del parentTestsuite.Testsuites[path]

def _output(self, testsuiteSummary: TestsuiteSummary, task: str):
parts = task.split(":")
Expand Down

0 comments on commit c87744e

Please sign in to comment.