ScriptCollection 4.4.51__py3-none-any.whl → 4.4.53__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.
@@ -40,7 +40,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
40
40
  from .ProgramRunnerPopen import ProgramRunnerPopen
41
41
  from .SCLog import SCLog, LogLevel
42
42
 
43
- version = "4.4.51"
43
+ version = "4.4.53"
44
44
  __version__ = version
45
45
 
46
46
  class VSCodeWorkspaceShellTask:
@@ -411,7 +411,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
411
411
  container_base_mount_folder, container_repository_folder = self.__get_folders_inside_container(base_mount_folder)
412
412
 
413
413
  #build the scbuildcodeunits-arguments based on the current state (analogous to the arguments accepted by the scbuildcodeunits-executable). each token must be a separate argument because run_program_argsasarray passes every list-element verbatim and does not split on spaces.
414
- scbuildcodeunits_arguments = ["scbuildcodeunits", "-r", container_repository_folder, "-v", "4"]
414
+ scbuildcodeunits_arguments = ["scbuildcodeunits", "-r", container_repository_folder, "-v", "4", "-e", self.target_environment_type]
415
415
  if not self.__use_cache:
416
416
  scbuildcodeunits_arguments.append("-n")
417
417
  if self.__is_pre_merge:
@@ -438,7 +438,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
438
438
  #only the arguments which scupdatedependencies really accepts are passed. It has no equivalent of the
439
439
  #pre-merge-, assert-no-new-changes-, ready-to-merge- and fastlane-flags of scbuildcodeunits, so passing one
440
440
  #of them would make the argument-parsing fail inside the container.
441
- scupdatedependencies_arguments = ["scupdatedependencies", "-r", container_repository_folder, "-v", "4"]
441
+ scupdatedependencies_arguments = ["scupdatedependencies", "-r", container_repository_folder, "-v", "4", "--targetenvironment", self.target_environment_type]
442
442
  if not self.__use_cache:
443
443
  scupdatedependencies_arguments.append("-n")
444
444
  if GeneralUtilities.string_has_content(self.additionalargumentsfile):
@@ -78,7 +78,12 @@ class TFCPS_VisualRegressionTests:
78
78
  @GeneralUtilities.check_arguments
79
79
  def run(self, update_baselines: bool, playwright_project_folder_relative_path: str = ".", domain_of_externally_started_application: str = None, environment_variables: dict[str, str] = None, playwright_project: str = None) -> None:
80
80
  """Executes the visual-regression-tests of the codeunit.
81
- If 'update_baselines' is true then the baseline-screenshots are regenerated instead of being compared.
81
+ If 'update_baselines' is false the screenshots are compared with the baselines and a difference fails the
82
+ run. If 'update_baselines' is true the baseline-screenshots are regenerated instead: missing ones are
83
+ created and changed ones are overwritten, and a difference therefore does not fail the run, because
84
+ regenerating or adding a baseline is exactly the purpose of that mode. In that mode the run only fails if
85
+ a screenshot could not be produced at all (for example because the page did not load); see the
86
+ construction of the command below for how this is detected.
82
87
  'playwright_project_folder_relative_path' is the folder inside the codeunit which contains
83
88
  "package.json" and "playwright.config.ts"; it allows codeunits which are not implemented in javascript
84
89
  to keep these files out of their sourcecode-folder.
@@ -107,15 +112,27 @@ class TFCPS_VisualRegressionTests:
107
112
  # absolute path because the working-folder is not necessarily the codeunit-folder itself.
108
113
  output_folder: str = self.__append_relative_path(codeunit_folder_in_container, self.__test_results_folder_relative_path)
109
114
  self.__remove_layouts_of_previous_run(codeunit_folder, playwright_project)
110
- command: str = f"npx playwright test --output={output_folder}"
115
+ test_command: str = f"npx playwright test --output={output_folder}"
111
116
  if playwright_project is not None:
112
- command = f"{command} --project={playwright_project}"
113
- if update_baselines:
114
- command = f"{command} --update-snapshots"
117
+ test_command = f"{test_command} --project={playwright_project}"
115
118
  # The dependencies are installed inside the container because the "node_modules"-folder of the codeunit can
116
119
  # contain packages for another operating-system. "--no-save" is required so that the installation does not
117
120
  # modify "package.json" or "package-lock.json".
118
- command = f"npm install --no-audit --no-fund --no-save && {command}"
121
+ install_command: str = "npm install --no-audit --no-fund --no-save"
122
+ if update_baselines:
123
+ # The update-run writes the baseline-screenshots (it creates the missing ones and overwrites the
124
+ # changed ones). Since playwright 1.50 that run reports every testcase whose screenshot it created or
125
+ # changed as failed and therefore returns a non-zero exit-code; this must not fail this task, because
126
+ # creating or changing a baseline is exactly its purpose. The only real failure here is a screenshot
127
+ # which could not be produced at all (for example because the page did not load). That is detected by
128
+ # a second run which compares the freshly written baselines: a testcase whose screenshot could be
129
+ # captured stabilizes and therefore matches its own new baseline, while a testcase which can not
130
+ # produce a screenshot keeps failing (a missing baseline is regenerated by the second run and still
131
+ # fails it). The exit-code of the second run therefore decides about success, so the one of the
132
+ # update-run is discarded by separating the two runs with ";" instead of "&&".
133
+ command = f"{install_command} && ( {test_command} --update-snapshots ; {test_command} )"
134
+ else:
135
+ command = f"{install_command} && {test_command}"
119
136
  arguments: list[str] = ["run", "--rm"]
120
137
  # Playwright recommends this because the default-size of the shared memory of a container is too small for
121
138
  # chromium, which makes chromium crash on pages which are not trivial.
@@ -129,7 +146,14 @@ class TFCPS_VisualRegressionTests:
129
146
  arguments = arguments+["-w", working_folder, image, "/bin/sh", "-c", command]
130
147
  result = self.__sc.run_program_argsasarray("docker", arguments, throw_exception_if_exitcode_is_not_zero=False, print_live_output=True, print_errors_as_information=True)
131
148
  if result[0] != 0:
132
- message: str = f"The visual-regression-tests of the codeunit \"{self.__tfcps_codeunit.get_codeunit_name()}\" failed (exit-code {result[0]})."
149
+ if update_baselines:
150
+ # A non-zero exit-code of the second run means a screenshot could not be produced even against its
151
+ # freshly written baseline, so the baseline could not be generated for that testcase at all. A
152
+ # difference to a previous baseline can not reach this point, because the update-run before it
153
+ # already overwrote the previous baseline with the current screenshot.
154
+ message: str = f"The baseline-screenshots of the codeunit \"{self.__tfcps_codeunit.get_codeunit_name()}\" could not be generated completely (exit-code {result[0]}). At least one testcase could not produce a screenshot (for example because the page did not load)."
155
+ else:
156
+ message: str = f"The visual-regression-tests of the codeunit \"{self.__tfcps_codeunit.get_codeunit_name()}\" failed (exit-code {result[0]})."
133
157
  folder_with_screenshots: str = self.__preserve_screenshots_of_failed_testcases(codeunit_folder)
134
158
  if folder_with_screenshots is None:
135
159
  message = f"{message} No screenshots of failed testcases were generated, so probably no testcase was executed at all."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.4.51
3
+ Version: 4.4.53
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Author-email: Marius Göcke <marius.goecke@gmail.com>
6
6
  License-Expression: GPL-3.0-only
@@ -11,7 +11,7 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=vwKq-MOcqsgiKhSf-MBUDBC_UyaU8evP3Ro
11
11
  ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
12
12
  ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=u9141B9D-Kef-9uo3yR7BXKUMzIKLVsesnYk7H-cWm4,6157
13
13
  ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
14
- ScriptCollection/ScriptCollectionCore.py,sha256=ERfrLfMtMI37dBOw9KOHrNST5HLkO-JAi6osOs6gJaE,310633
14
+ ScriptCollection/ScriptCollectionCore.py,sha256=WW-sRHpZcfKA-nPW-U3nofPN6VK5Ee417d4JVXAr0lQ,310633
15
15
  ScriptCollection/TestKind.py,sha256=jqLJwNvQeyea7SZf-UFzMC9pM0znv4do7FIC1xq8u9M,1672
16
16
  ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
17
17
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -39,7 +39,7 @@ ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW
39
39
  ScriptCollection/TFCPS/TFCPS_CodeSpellCheck.py,sha256=zV62O7UiGjewx1yQUIWmUJ9D-5ipkV_f28uNhp-JWUs,5306
40
40
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=yosafTfbB0LBMKomZvLnFJpgJpJOMHsGKLirVjG1slk,40501
41
41
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Mj9t1SyRpkYZE74cLsGWYv4xB89gXL2ld-RX3xvvGdw,9835
42
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=SOuLgq2hnz78Hy2rQF2xH6oDShnqLUitiviblh579w8,56321
42
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=6-89_bEbhbbXSyIwYDseSiMQmE0eoBNy4KmKbWwSxjo,56410
43
43
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=BVK3fpEyjcXYVHIb6YYLH7bWe6iKRaCtPrJ3tXAemYw,6582
44
44
  ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
45
45
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
@@ -48,7 +48,7 @@ ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=Jb7AaMcJDW-gYEYBUVZAG3
48
48
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
49
49
  ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=2Tx5HLk1ZftBWDCTiGZdP2QiiGNyWsEuTCSt33dNQjc,23891
50
50
  ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=eGmKZSoS2EQin-qrHTewJrvm-2VzdZhw6d0LceIonF0,158891
51
- ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=6_63udxHnPlu_TMk_ftLZTnzriJO8MCxVCVAsweZqHs,37073
51
+ ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=Bf9TAQxwkhQMolvf6ZYsVNfp0jGQ1pmc3gUT3qMIJuw,39568
52
52
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  ScriptCollection/TFCPS/CPP/TFCPS_CodeUnitSpecific_CPP.py,sha256=BNZPMjGiWLMBH7QDtP06WEVLMnI38NLX4Dpd13bSbi4,16614
54
54
  ScriptCollection/TFCPS/CPP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -73,8 +73,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
73
73
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
75
75
  ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
- scriptcollection-4.4.51.dist-info/METADATA,sha256=7QfMnJPmt0aJhlyM48ax7IReCWPfaFxOAHnV5sXXUB0,8032
77
- scriptcollection-4.4.51.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
78
- scriptcollection-4.4.51.dist-info/entry_points.txt,sha256=1nA5gUD0Y9L105JGIfTnnqDZhFjzKcFpFaUSrLn-Sw0,5991
79
- scriptcollection-4.4.51.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
80
- scriptcollection-4.4.51.dist-info/RECORD,,
76
+ scriptcollection-4.4.53.dist-info/METADATA,sha256=KtBEm7YcfQ81A6-N8uBZYCOJ0YrEZ-lysQP592qgv-Y,8032
77
+ scriptcollection-4.4.53.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
78
+ scriptcollection-4.4.53.dist-info/entry_points.txt,sha256=1nA5gUD0Y9L105JGIfTnnqDZhFjzKcFpFaUSrLn-Sw0,5991
79
+ scriptcollection-4.4.53.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
80
+ scriptcollection-4.4.53.dist-info/RECORD,,