ScriptCollection 3.5.159__py3-none-any.whl → 3.5.160__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,7 +36,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
36
36
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
37
37
  from .SCLog import SCLog, LogLevel
38
38
 
39
- version = "3.5.159"
39
+ version = "3.5.160"
40
40
  __version__ = version
41
41
 
42
42
 
@@ -1827,15 +1827,60 @@ class TasksForCommonProjectStructure:
1827
1827
  coverage_file_relative = f"{test_coverage_folder_relative}/TestCoverage.xml"
1828
1828
  coverage_file = GeneralUtilities.resolve_relative_path(coverage_file_relative, codeunit_folder)
1829
1829
  self.run_with_epew("lcov_cobertura", f"coverage/lcov.info --base-dir . --excludes test --output ../{coverage_file_relative} --demangle", src_folder, verbosity)
1830
+
1831
+ # format correctly
1830
1832
  content = GeneralUtilities.read_text_from_file(coverage_file)
1831
1833
  content = re.sub('<![^<]+>', '', content)
1832
1834
  content = re.sub('\\\\', '/', content)
1833
1835
  content = re.sub('\\ name=\\"lib\\"', '', content)
1834
- content = re.sub('<package ', f'<package name="{codeunit_name}" ', content)
1835
1836
  content = re.sub('\\ filename=\\"lib/', f' filename="{package_name}/lib/', content)
1836
1837
  GeneralUtilities.write_text_to_file(coverage_file, content)
1838
+ self.__testcoverage_for_flutter_project_merge_packages(coverage_file)
1839
+ self.__testcoverage_for_flutter_project_calculate_line_rate(coverage_file)
1840
+
1837
1841
  self.run_testcases_common_post_task(repository_folder, codeunit_name, verbosity, generate_badges, build_environment_target_type, args)
1838
1842
 
1843
+ def __testcoverage_for_flutter_project_merge_packages(self, coverage_file: str):
1844
+ tree = etree.parse(coverage_file)
1845
+ root = tree.getroot()
1846
+
1847
+ packages = root.findall("./packages/package")
1848
+
1849
+ all_classes = []
1850
+ for pkg in packages:
1851
+ classes = pkg.find("classes")
1852
+ if classes is not None:
1853
+ all_classes.extend(classes.findall("class"))
1854
+ new_package = etree.Element("package", name="Malno")
1855
+ new_classes = etree.SubElement(new_package, "classes")
1856
+ for cls in all_classes:
1857
+ new_classes.append(cls)
1858
+ packages_node = root.find("./packages")
1859
+ packages_node.clear()
1860
+ packages_node.append(new_package)
1861
+ tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
1862
+
1863
+ def __testcoverage_for_flutter_project_calculate_line_rate(self, coverage_file: str):
1864
+ tree = etree.parse(coverage_file)
1865
+ root = tree.getroot()
1866
+ package = root.find("./packages/package")
1867
+ if package is None:
1868
+ raise RuntimeError("No <package>-Element found")
1869
+
1870
+ line_elements = package.findall(".//line")
1871
+
1872
+ amount_of_lines = 0
1873
+ amount_of_hited_lines = 0
1874
+
1875
+ for line in line_elements:
1876
+ amount_of_lines += 1
1877
+ hits = int(line.get("hits", "0"))
1878
+ if hits > 0:
1879
+ amount_of_hited_lines += 1
1880
+ line_rate = amount_of_hited_lines / amount_of_lines if amount_of_lines > 0 else 0.0
1881
+ package.set("line-rate", str(line_rate))
1882
+ tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
1883
+
1839
1884
  @GeneralUtilities.check_arguments
1840
1885
  def standardized_tasks_run_testcases_for_angular_codeunit(self, runtestcases_script_file: str, build_environment_target_type: str, generate_badges: bool, verbosity: int, commandline_arguments: list[str]) -> None:
1841
1886
  # prepare
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.159
3
+ Version: 3.5.160
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -7,11 +7,11 @@ ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4b
7
7
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
8
8
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
9
9
  ScriptCollection/SCLog.py,sha256=rMdrEzBKQZBdObPJ9nZ5XCEXRoIFqPh8fAoiX6ZOVuw,4493
10
- ScriptCollection/ScriptCollectionCore.py,sha256=Rges2qebK89CwmNwUPKMXVlrYa-OCAJUA1bUSQE9S7E,141662
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=nXhwH6rfA-XXdQVXYQoxXUQ5sA82d1bDF2EVKdZIfo8,248595
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=vFP4e2ksl982hDKgQuC5udmBIG6Wu7m6MHG5PFa3_k8,141662
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=6Id8KRtSIuUnbPakmyNutnpF5kHwaAFkzPpxD5csYs0,250347
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.159.dist-info/METADATA,sha256=cgDT6oojuA4Pc_eDYFFTMO_k79xHPo39_9VpMi0e5ok,7689
14
- scriptcollection-3.5.159.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.159.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
- scriptcollection-3.5.159.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.159.dist-info/RECORD,,
13
+ scriptcollection-3.5.160.dist-info/METADATA,sha256=ZIoWVimoMYzMsReojXoop-Wao1qioWzZwe6w6yM06xE,7689
14
+ scriptcollection-3.5.160.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.160.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
+ scriptcollection-3.5.160.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.160.dist-info/RECORD,,