cucu 1.3.1__py3-none-any.whl → 1.3.2__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.

Potentially problematic release.


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

cucu/environment.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import datetime
2
2
  import json
3
+ import os
3
4
  import sys
4
5
  import traceback
5
6
  from functools import partial
@@ -63,7 +64,9 @@ def before_all(ctx):
63
64
  logger.debug(
64
65
  "Create a new worker db since this isn't the parent process"
65
66
  )
66
- CONFIG["WORKER_RUN_ID"] = generate_short_id()
67
+ # use seed unique enough for multiple cucu_runs to be combined
68
+ worker_id_seed = f"{CONFIG['WORKER_PARENT_ID']}_{os.getpid()}"
69
+ CONFIG["WORKER_RUN_ID"] = generate_short_id(worker_id_seed)
67
70
 
68
71
  results_path = Path(CONFIG["CUCU_RESULTS_DIR"])
69
72
  worker_run_id = CONFIG["WORKER_RUN_ID"]
@@ -71,8 +74,12 @@ def before_all(ctx):
71
74
  CONFIG["RUN_DB_PATH"] = run_db_path = (
72
75
  results_path / f"run_{cucu_run_id}_{worker_run_id}.db"
73
76
  )
74
- create_database_file(run_db_path)
75
- record_cucu_run()
77
+ if not run_db_path.exists():
78
+ logger.debug(
79
+ f"Creating new run database file: {run_db_path} for {worker_id_seed}"
80
+ )
81
+ create_database_file(run_db_path)
82
+ record_cucu_run()
76
83
 
77
84
  CONFIG.snapshot("before_all")
78
85
 
cucu/utils.py CHANGED
@@ -43,14 +43,14 @@ class StopRetryException(Exception):
43
43
  pass
44
44
 
45
45
 
46
- def generate_short_id():
46
+ def generate_short_id(seed=None):
47
47
  """
48
- Generate a short 7-character ID based on current performance counter.
49
- Used for both cucu_run_id and scenario_run_id.
48
+ Generate a short 7-character ID based on seed (defaults to current performance counter).
50
49
  """
51
- return hashlib.sha256(
52
- str(time.perf_counter()).encode("utf-8")
53
- ).hexdigest()[:7]
50
+ if seed is None:
51
+ seed = time.perf_counter()
52
+
53
+ return hashlib.sha256(str(seed).encode("utf-8")).hexdigest()[:7]
54
54
 
55
55
 
56
56
  def format_gherkin_table(table, headings=[], prefix=""):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cucu
3
- Version: 1.3.1
3
+ Version: 1.3.2
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
@@ -16,7 +16,7 @@ cucu/db.py,sha256=d1aad16458f7aad58bab0639687a43c4d0bb05ee6ca411c3ee8ec36c725009
16
16
  cucu/edgedriver_autoinstaller/README.md,sha256=b43900588aa045d0a3b7ea17d6762a8a4202fc57e2384336fa97394b955b44ba,84
17
17
  cucu/edgedriver_autoinstaller/__init__.py,sha256=7e8eb12493ef71ce57be78bc7a95dfc43a0fc491f9fdbe959368c3f494f07d1b,969
18
18
  cucu/edgedriver_autoinstaller/utils.py,sha256=891293c30efb086693027b6dfd00efc6528fc69314e28b71f7939e0fdee485c3,6802
19
- cucu/environment.py,sha256=e74dd336deff00bd12c14ced8a633878cbcc390dd04927005df9fa2997a6b2e2,12885
19
+ cucu/environment.py,sha256=d69036c08040961261df71f097a06984a984ac2d88cc481e05f1209026b4365c,13222
20
20
  cucu/external/jquery/jquery-3.5.1.min.js,sha256=f7f6a5894f1d19ddad6fa392b2ece2c5e578cbf7da4ea805b6885eb6985b6e3d,89476
21
21
  cucu/formatter/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
22
22
  cucu/formatter/cucu.py,sha256=8c78ba5bd4934508c3cb48f53ff1cb2e50533ec4ba12f532bea7948ed5acdef3,9291
@@ -86,8 +86,8 @@ cucu/steps/tables.js,sha256=3acd9aec5a3e720d375d5962ed44af72705569de0dee2757afe1
86
86
  cucu/steps/text_steps.py,sha256=263fc61e81de7a637055d50e76a71e840acda7b58cf96323963038c34a4b5eec,2576
87
87
  cucu/steps/variable_steps.py,sha256=59272d1f7ff17318e28c63d8665c69f9fa02fd220000ab45fffb1a36d81925b9,2966
88
88
  cucu/steps/webserver_steps.py,sha256=c169294af71231d8ac90f921e1caa57a95b1d6792f1294d4dad4574263c36f2a,1410
89
- cucu/utils.py,sha256=a79b12b89cc67409bda959310a384cacbe13f87e54241720f88bf303b7fcb9bb,10939
90
- cucu-1.3.1.dist-info/WHEEL,sha256=76443c98c0efcfdd1191eac5fa1d8223dba1c474dbd47676674a255e7ca48770,79
91
- cucu-1.3.1.dist-info/entry_points.txt,sha256=d7559122140cecbb949d0835940a1942836fbc1bd834dd666838104b8763c09a,40
92
- cucu-1.3.1.dist-info/METADATA,sha256=81bebb348418295df9e0b26f7fb79a08c9d8f557c0762ecc1957f25182fc7bca,16705
93
- cucu-1.3.1.dist-info/RECORD,,
89
+ cucu/utils.py,sha256=7b4a379dcf76b73eec6953f72bc550e3573e7d4220750e5722148df8f8de222c,10944
90
+ cucu-1.3.2.dist-info/WHEEL,sha256=76443c98c0efcfdd1191eac5fa1d8223dba1c474dbd47676674a255e7ca48770,79
91
+ cucu-1.3.2.dist-info/entry_points.txt,sha256=d7559122140cecbb949d0835940a1942836fbc1bd834dd666838104b8763c09a,40
92
+ cucu-1.3.2.dist-info/METADATA,sha256=6ae4ac453333e6f5f4f8b93f7563a8a4b3a5d236ab2eeba88de6e8555b7cb721,16705
93
+ cucu-1.3.2.dist-info/RECORD,,
File without changes