cucu 1.3.2__tar.gz → 1.3.4__tar.gz

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.

Potentially problematic release.


This version of cucu might be problematic. Click here for more details.

Files changed (92) hide show
  1. {cucu-1.3.2 → cucu-1.3.4}/PKG-INFO +1 -1
  2. {cucu-1.3.2 → cucu-1.3.4}/pyproject.toml +1 -1
  3. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/cli/core.py +6 -2
  4. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/db.py +2 -2
  5. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/environment.py +14 -4
  6. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/utils.py +3 -3
  7. {cucu-1.3.2 → cucu-1.3.4}/README.md +0 -0
  8. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/__init__.py +0 -0
  9. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/ansi_parser.py +0 -0
  10. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/behave_tweaks.py +0 -0
  11. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/browser/__init__.py +0 -0
  12. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/browser/core.py +0 -0
  13. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/browser/frames.py +0 -0
  14. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/browser/selenium.py +0 -0
  15. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/browser/selenium_tweaks.py +0 -0
  16. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/cli/__init__.py +0 -0
  17. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/cli/run.py +0 -0
  18. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/cli/steps.py +0 -0
  19. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/cli/thread_dumper.py +0 -0
  20. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/config.py +0 -0
  21. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/edgedriver_autoinstaller/README.md +0 -0
  22. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/edgedriver_autoinstaller/__init__.py +0 -0
  23. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/edgedriver_autoinstaller/utils.py +0 -0
  24. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/external/jquery/jquery-3.5.1.min.js +0 -0
  25. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/formatter/__init__.py +0 -0
  26. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/formatter/cucu.py +0 -0
  27. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/formatter/json.py +0 -0
  28. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/formatter/junit.py +0 -0
  29. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/fuzzy/__init__.py +0 -0
  30. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/fuzzy/core.py +0 -0
  31. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/fuzzy/fuzzy.js +0 -0
  32. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/helpers.py +0 -0
  33. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/hooks.py +0 -0
  34. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/.gitignore +0 -0
  35. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/README.md +0 -0
  36. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/cucurc.yml +0 -0
  37. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/data/www/example.html +0 -0
  38. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/cucurc.yml +0 -0
  39. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/environment.py +0 -0
  40. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/example.feature +0 -0
  41. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/lint_rules/sid.yaml +0 -0
  42. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/steps/__init__.py +0 -0
  43. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/init_data/features/steps/my_steps.py +0 -0
  44. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/language_server/__init__.py +0 -0
  45. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/language_server/core.py +0 -0
  46. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/lint/__init__.py +0 -0
  47. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/lint/linter.py +0 -0
  48. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/lint/rules/format.yaml +0 -0
  49. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/logger.py +0 -0
  50. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/matcher/__init__.py +0 -0
  51. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/matcher/core.py +0 -0
  52. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/page_checks.py +0 -0
  53. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/__init__.py +0 -0
  54. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/bootstrap.min.css +0 -0
  55. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/bootstrap.min.js +0 -0
  56. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/dataTables.bootstrap.min.css +0 -0
  57. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/dataTables.bootstrap.min.js +0 -0
  58. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/jquery-3.5.1.min.js +0 -0
  59. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/jquery.dataTables.min.js +0 -0
  60. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/external/popper.min.js +0 -0
  61. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/favicon.png +0 -0
  62. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/html.py +0 -0
  63. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/templates/feature.html +0 -0
  64. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/templates/flat.html +0 -0
  65. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/templates/index.html +0 -0
  66. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/templates/layout.html +0 -0
  67. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/reporter/templates/scenario.html +0 -0
  68. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/__init__.py +0 -0
  69. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/base_steps.py +0 -0
  70. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/browser_steps.py +0 -0
  71. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/button_steps.py +0 -0
  72. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/checkbox_steps.py +0 -0
  73. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/command_steps.py +0 -0
  74. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/draggable_steps.py +0 -0
  75. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/dropdown_steps.py +0 -0
  76. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/file_input_steps.py +0 -0
  77. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/filesystem_steps.py +0 -0
  78. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/flow_control_steps.py +0 -0
  79. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/image_steps.py +0 -0
  80. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/input_steps.py +0 -0
  81. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/link_steps.py +0 -0
  82. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/menuitem_steps.py +0 -0
  83. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/platform_steps.py +0 -0
  84. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/radio_steps.py +0 -0
  85. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/section_steps.py +0 -0
  86. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/step_utils.py +0 -0
  87. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/tab_steps.py +0 -0
  88. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/table_steps.py +0 -0
  89. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/tables.js +0 -0
  90. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/text_steps.py +0 -0
  91. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/variable_steps.py +0 -0
  92. {cucu-1.3.2 → cucu-1.3.4}/src/cucu/steps/webserver_steps.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cucu
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: Easy BDD web testing
5
5
  Keywords: cucumber,selenium,behave
6
6
  Author: Domino Data Lab, Rodney Gomes, Cedric Young, Xin Dong, Kavya, Kevin Garton, Joy Liao
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cucu"
3
- version = "1.3.2"
3
+ version = "1.3.4"
4
4
  description = "Easy BDD web testing"
5
5
  readme = "README.md"
6
6
  license = { text = "The Clear BSD License" }
@@ -301,9 +301,13 @@ def run(
301
301
  if record_env_vars:
302
302
  os.environ["CUCU_RECORD_ENV_VARS"] = "true"
303
303
 
304
- os.environ["CUCU_RUN_ID"] = CONFIG["CUCU_RUN_ID"] = generate_short_id()
304
+ cucu_run_id_seed = f"{time.perf_counter()}_{os.getpid()}"
305
+ os.environ["CUCU_RUN_ID"] = CONFIG["CUCU_RUN_ID"] = generate_short_id(
306
+ cucu_run_id_seed
307
+ )
308
+ worker_id_seed = f"{CONFIG['CUCU_RUN_ID']}_{os.getpid()}"
305
309
  os.environ["WORKER_PARENT_ID"] = CONFIG["WORKER_RUN_ID"] = (
306
- generate_short_id()
310
+ generate_short_id(worker_id_seed)
307
311
  )
308
312
  if not dry_run:
309
313
  create_run(results, filepath)
@@ -117,7 +117,7 @@ class step(BaseModel):
117
117
  text = TextField(null=True)
118
118
  table_data = JSONField(null=True)
119
119
  location = TextField()
120
- is_substep = BooleanField()
120
+ is_substep = BooleanField(null=True) # info available after step ends
121
121
  has_substeps = BooleanField()
122
122
  status = TextField(null=True)
123
123
  duration = FloatField(null=True)
@@ -200,7 +200,6 @@ def start_step_record(ctx, step_obj):
200
200
  text=step_obj.text if step_obj.text else None,
201
201
  table_data=table if step_obj.table else None,
202
202
  location=str(step_obj.location),
203
- is_substep=step_obj.is_substep,
204
203
  has_substeps=step_obj.has_substeps,
205
204
  section_level=getattr(step_obj, "section_level", None),
206
205
  start_at=step_obj.start_at,
@@ -227,6 +226,7 @@ def finish_step_record(step_obj, duration):
227
226
  parent_seq=step_obj.parent_seq,
228
227
  has_substeps=step_obj.has_substeps,
229
228
  status=step_obj.status.name,
229
+ is_substep=step_obj.is_substep,
230
230
  duration=duration,
231
231
  end_at=step_obj.end_at,
232
232
  debug_output=step_obj.debug_output,
@@ -2,6 +2,7 @@ import datetime
2
2
  import json
3
3
  import os
4
4
  import sys
5
+ import time
5
6
  import traceback
6
7
  from functools import partial
7
8
  from pathlib import Path
@@ -64,7 +65,7 @@ def before_all(ctx):
64
65
  logger.debug(
65
66
  "Create a new worker db since this isn't the parent process"
66
67
  )
67
- # use seed unique enough for multiple cucu_runs to be combined
68
+ # use seed unique enough for multiple cucu_runs to be combined but predictable within the same run
68
69
  worker_id_seed = f"{CONFIG['WORKER_PARENT_ID']}_{os.getpid()}"
69
70
  CONFIG["WORKER_RUN_ID"] = generate_short_id(worker_id_seed)
70
71
 
@@ -98,7 +99,8 @@ def after_all(ctx):
98
99
 
99
100
 
100
101
  def before_feature(ctx, feature):
101
- feature.feature_run_id = generate_short_id()
102
+ feature_run_id_seed = f"{CONFIG['WORKER_RUN_ID']}_{time.perf_counter()}"
103
+ feature.feature_run_id = generate_short_id(feature_run_id_seed)
102
104
  feature.custom_data = {}
103
105
  record_feature(feature)
104
106
 
@@ -170,7 +172,12 @@ def before_scenario(ctx, scenario):
170
172
  )
171
173
  ctx.browser_log_tee = TeeStream(ctx.browser_log_file)
172
174
 
173
- CONFIG["SCENARIO_RUN_ID"] = scenario.scenario_run_id = generate_short_id()
175
+ scenario_run_id_seed = (
176
+ f"{ctx.feature.feature_run_id}_{time.perf_counter()}"
177
+ )
178
+ CONFIG["SCENARIO_RUN_ID"] = scenario.scenario_run_id = generate_short_id(
179
+ scenario_run_id_seed
180
+ )
174
181
  record_scenario(ctx)
175
182
 
176
183
  # run before all scenario hooks
@@ -278,7 +285,10 @@ def cleanup_browsers(ctx):
278
285
 
279
286
 
280
287
  def before_step(ctx, step):
281
- step.step_run_id = generate_short_id()
288
+ step_run_id_seed = f"{ctx.scenario.scenario_run_id}_{ctx.step_index}_{time.perf_counter()}"
289
+ step.step_run_id = generate_short_id(
290
+ step_run_id_seed, length=10
291
+ ) # up to 10 characters to give two orders of magnitude less chance of collision
282
292
  step.start_at = datetime.datetime.now().isoformat()[:-3]
283
293
 
284
294
  sys.stdout.captured()
@@ -43,14 +43,14 @@ class StopRetryException(Exception):
43
43
  pass
44
44
 
45
45
 
46
- def generate_short_id(seed=None):
46
+ def generate_short_id(seed=None, length=7):
47
47
  """
48
- Generate a short 7-character ID based on seed (defaults to current performance counter).
48
+ Generate a short character ID based on seed (defaults to current performance counter).
49
49
  """
50
50
  if seed is None:
51
51
  seed = time.perf_counter()
52
52
 
53
- return hashlib.sha256(str(seed).encode("utf-8")).hexdigest()[:7]
53
+ return hashlib.sha256(str(seed).encode("utf-8")).hexdigest()[:length]
54
54
 
55
55
 
56
56
  def format_gherkin_table(table, headings=[], prefix=""):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes