File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,4 @@ tsconfig.json
16
16
** /* .ts.map
17
17
xfail.yaml
18
18
vscode-test-win-workaround.py
19
+ convert-mocha-junit-report.py
Original file line number Diff line number Diff line change
1
+ #! env python
2
+ """This tool wraps around the e3.testsuite XUnit report import feature to customize test
3
+ naming based on the reports obtained in VS Code testing from the mocha-junit-reporter
4
+ module."""
5
+
6
+ from e3 .testsuite .report .xunit import XUnitImporter , XUnitImporterApp
7
+
8
+
9
+ class XUnitImporterCustomTestNaming (XUnitImporter ):
10
+ def get_test_name (
11
+ self ,
12
+ testsuite_name : str ,
13
+ testcase_name : str ,
14
+ classname : str | None = None ,
15
+ ) -> str :
16
+ """Override naming scheme to ignore the testcase name because it
17
+ duplicates the information from the testsuite name and the classname
18
+ attribute."""
19
+ return super ().get_test_name (testsuite_name , "" , classname )
20
+
21
+
22
+ class MochaJUnitImporterApp (XUnitImporterApp ):
23
+
24
+ def create_importer (self ) -> XUnitImporter :
25
+ return XUnitImporterCustomTestNaming (self .index , self .xfails )
26
+
27
+
28
+ if __name__ == "__main__" :
29
+ MochaJUnitImporterApp ().run ()
You can’t perform that action at this time.
0 commit comments