ScriptCollection 4.4.7__py3-none-any.whl → 4.4.8__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.
- ScriptCollection/ScriptCollectionCore.py +1 -1
- ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py +0 -1
- ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py +36 -5
- {scriptcollection-4.4.7.dist-info → scriptcollection-4.4.8.dist-info}/METADATA +1 -1
- {scriptcollection-4.4.7.dist-info → scriptcollection-4.4.8.dist-info}/RECORD +8 -8
- {scriptcollection-4.4.7.dist-info → scriptcollection-4.4.8.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.7.dist-info → scriptcollection-4.4.8.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.7.dist-info → scriptcollection-4.4.8.dist-info}/top_level.txt +0 -0
|
@@ -80,7 +80,6 @@ class TFCPS_CodeUnitSpecific_Go_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
80
80
|
@GeneralUtilities.check_arguments
|
|
81
81
|
def run_testcases(self) -> None:
|
|
82
82
|
codeunit_name = self.get_codeunit_name()
|
|
83
|
-
go_module_folder = self.get_go_module_folder()
|
|
84
83
|
coverprofile_file = os.path.join(GeneralUtilities.get_temp_folder(), f"{codeunit_name}.coverprofile")
|
|
85
84
|
GeneralUtilities.ensure_file_does_not_exist(coverprofile_file)
|
|
86
85
|
coverage_file = os.path.join(self.get_artifacts_folder(), "TestCoverage", "TestCoverage.xml")
|
|
@@ -43,6 +43,13 @@ class TFCPS_VisualRegressionTests:
|
|
|
43
43
|
# beginning of every run.
|
|
44
44
|
__test_results_folder_relative_path: str = "Other/Artifacts/VisualRegressionTestResults"
|
|
45
45
|
|
|
46
|
+
# The file which maps a domain to an address inside a container. It belongs to the container which owns the
|
|
47
|
+
# network-namespace, so the playwright-container uses the one of this container when it joins it.
|
|
48
|
+
__hosts_file: str = "/etc/hosts"
|
|
49
|
+
|
|
50
|
+
# The address the application under test listens on when it was started by this process.
|
|
51
|
+
__loopback_address: str = "127.0.0.1"
|
|
52
|
+
|
|
46
53
|
# The folder the screenshots of failed testcases are preserved in. Both folders are located in
|
|
47
54
|
# "Other/Artifacts", which is ignored by git.
|
|
48
55
|
__failed_testcases_folder_relative_path: str = "Other/Artifacts/VisualRegressionTestFailures"
|
|
@@ -325,14 +332,38 @@ class TFCPS_VisualRegressionTests:
|
|
|
325
332
|
# loopback-interface of that container. Sharing its network-namespace is the only way to reach it:
|
|
326
333
|
# its ports are not published to the host, and publishing them would additionally make two parallel
|
|
327
334
|
# builds on the same host collide with each other.
|
|
328
|
-
|
|
335
|
+
# The domain can not be passed as "--add-host" in this case: a container which joins the
|
|
336
|
+
# network-namespace of another one uses the hosts-file of that other container and therefore can not
|
|
337
|
+
# have entries of its own, which docker refuses with "conflicting options: custom host-to-IP mapping
|
|
338
|
+
# and the network mode". The mapping is therefore written into the hosts-file of this container, which
|
|
339
|
+
# the playwright-container sees through exactly that sharing.
|
|
340
|
+
self.__ensure_domain_is_mapped_in_the_own_hosts_file(domain_of_application)
|
|
329
341
|
result: list[str] = ["--network", f"container:{self.__get_own_container_id()}"]
|
|
330
342
|
else:
|
|
331
343
|
# The application runs directly on the host of the container, which docker makes reachable under the
|
|
332
|
-
# address "host-gateway".
|
|
333
|
-
|
|
334
|
-
result: list[str] = []
|
|
335
|
-
return result+["
|
|
344
|
+
# address "host-gateway". The playwright-container has a hosts-file of its own in this case, so the
|
|
345
|
+
# mapping can be passed as an argument.
|
|
346
|
+
result: list[str] = ["--add-host", f"{domain_of_application}:host-gateway"]
|
|
347
|
+
return result+["-e", f"{self.__environment_variable_name_of_application_host}={domain_of_application}"]
|
|
348
|
+
|
|
349
|
+
@GeneralUtilities.check_arguments
|
|
350
|
+
def __ensure_domain_is_mapped_in_the_own_hosts_file(self, domain_of_application: str) -> None:
|
|
351
|
+
"""Maps the given domain to the loopback-interface in the hosts-file of the container this process runs in.
|
|
352
|
+
|
|
353
|
+
The playwright-container joins the network-namespace of this container and therefore uses its hosts-file, so
|
|
354
|
+
this is the only place where the mapping can be put for the browser to resolve the domain.
|
|
355
|
+
The mapping is appended instead of the file being rewritten, because the file is a bind-mount of the
|
|
356
|
+
docker-daemon (which is also how __get_own_container_id recognizes the own container): replacing it would
|
|
357
|
+
break that mount and the mapping would not reach the playwright-container.
|
|
358
|
+
A mapping which is already there is not appended a second time, so that the runs for the further browsers of
|
|
359
|
+
the codeunit do not add it again."""
|
|
360
|
+
for line in GeneralUtilities.read_text_from_file(self.__hosts_file).splitlines():
|
|
361
|
+
# Everything behind a "#" is a comment, and a line maps its first field (the address) to all further
|
|
362
|
+
# fields (the names it is reachable under).
|
|
363
|
+
fields: list[str] = line.split("#", 1)[0].split()
|
|
364
|
+
if 1 < len(fields) and fields[0] == self.__loopback_address and domain_of_application in fields[1:]:
|
|
365
|
+
return
|
|
366
|
+
GeneralUtilities.append_line_to_file(self.__hosts_file, f"{self.__loopback_address}\t{domain_of_application}")
|
|
336
367
|
|
|
337
368
|
@GeneralUtilities.check_arguments
|
|
338
369
|
def __get_mount_arguments(self, codeunit_folder: str, codeunit_folder_in_container: str, playwright_project_folder_relative_path: str) -> list[str]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.4.
|
|
3
|
+
Version: 4.4.8
|
|
4
4
|
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
5
|
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
|
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=zVD-gZY85o8wiGFcpYAGNDl-tXaKzipl1Bkhqy2ois4,4681
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=ot9Ib-plQ8wejR9M2XXfnx6GR-va9k8SH1gAC5kjaJ0,5123
|
|
11
11
|
ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=o5CYHDYwXRt25TEgmN994-f_H1HSeSZv-YSfK_x994o,261810
|
|
13
13
|
ScriptCollection/TestKind.py,sha256=EBTLR8yBz5VmWA2NZIpDTbQNg6tkfv_kAsIzEJ--mCI,1756
|
|
14
14
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
|
|
15
15
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -48,7 +48,7 @@ ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=rhw0glr4gZ5enG9faOD51x
|
|
|
48
48
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
|
|
49
49
|
ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=Z8Gw-j5I7VPafHEsVeQJ2gTTKVLAnnhwZhY8IVTi2Qk,11867
|
|
50
50
|
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=6oi5vdng6wMx2inbj8KTwIFOPvZAO4ekIVLQcq4pZ9Y,162988
|
|
51
|
-
ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=
|
|
51
|
+
ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=6_63udxHnPlu_TMk_ftLZTnzriJO8MCxVCVAsweZqHs,37073
|
|
52
52
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=919mNfzVRurTJhWi8WV0oEAFoH-yd4a6m2Rbxcf2oZ4,19927
|
|
54
54
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -59,7 +59,7 @@ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=9KUJLrYqEX
|
|
|
59
59
|
ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
60
|
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=cAE_OFJBU0M3L2Ov5PUUMH7aOVVzKtnKlFoXSw43fng,8759
|
|
61
61
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
-
ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=
|
|
62
|
+
ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=m4Pax-U6o5XuspLnLfnWjyQMtoC7zBDDNJW9EhLWjeE,9012
|
|
63
63
|
ScriptCollection/TFCPS/Go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=HDZlU70lF4nxUgsi7-TaFrFpbw_imw6dBagfgL6tDW8,10593
|
|
65
65
|
ScriptCollection/TFCPS/Maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -71,8 +71,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
|
|
|
71
71
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
72
|
ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=5z990qyO5durX07xRWRwju1hl6wpjQAy2f-yRwJ-7s0,11856
|
|
73
73
|
ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
scriptcollection-4.4.
|
|
75
|
-
scriptcollection-4.4.
|
|
76
|
-
scriptcollection-4.4.
|
|
77
|
-
scriptcollection-4.4.
|
|
78
|
-
scriptcollection-4.4.
|
|
74
|
+
scriptcollection-4.4.8.dist-info/METADATA,sha256=5Mrm_a1r6igFqkt0dpgC4Vq8xKLORnMRgqYCSDEL2QA,7647
|
|
75
|
+
scriptcollection-4.4.8.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
76
|
+
scriptcollection-4.4.8.dist-info/entry_points.txt,sha256=Aj6CHuJxASMe52fK_O6-bNJ_uhxcDb-AgRxFOeTojyE,6069
|
|
77
|
+
scriptcollection-4.4.8.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
78
|
+
scriptcollection-4.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|