cucu 1.3.0__py3-none-any.whl → 1.3.1__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.
- cucu/cli/core.py +6 -2
- cucu/db.py +32 -14
- cucu/environment.py +16 -9
- {cucu-1.3.0.dist-info → cucu-1.3.1.dist-info}/METADATA +1 -1
- {cucu-1.3.0.dist-info → cucu-1.3.1.dist-info}/RECORD +7 -7
- {cucu-1.3.0.dist-info → cucu-1.3.1.dist-info}/WHEEL +1 -1
- {cucu-1.3.0.dist-info → cucu-1.3.1.dist-info}/entry_points.txt +0 -0
cucu/cli/core.py
CHANGED
|
@@ -241,6 +241,8 @@ def run(
|
|
|
241
241
|
):
|
|
242
242
|
"""
|
|
243
243
|
run a set of feature files
|
|
244
|
+
|
|
245
|
+
Note: All the os.environ variables are set to be available in the child processes
|
|
244
246
|
"""
|
|
245
247
|
init_global_hook_variables()
|
|
246
248
|
dumper = None
|
|
@@ -300,7 +302,9 @@ def run(
|
|
|
300
302
|
os.environ["CUCU_RECORD_ENV_VARS"] = "true"
|
|
301
303
|
|
|
302
304
|
os.environ["CUCU_RUN_ID"] = CONFIG["CUCU_RUN_ID"] = generate_short_id()
|
|
303
|
-
CONFIG["WORKER_RUN_ID"] =
|
|
305
|
+
os.environ["WORKER_PARENT_ID"] = CONFIG["WORKER_RUN_ID"] = (
|
|
306
|
+
generate_short_id()
|
|
307
|
+
)
|
|
304
308
|
if not dry_run:
|
|
305
309
|
create_run(results, filepath)
|
|
306
310
|
|
|
@@ -494,7 +498,7 @@ def run(
|
|
|
494
498
|
dumper.stop()
|
|
495
499
|
|
|
496
500
|
if not dry_run and os.path.exists(results):
|
|
497
|
-
finish_worker_record()
|
|
501
|
+
finish_worker_record(worker_run_id=CONFIG.get("WORKER_PARENT_ID"))
|
|
498
502
|
consolidate_database_files(results)
|
|
499
503
|
|
|
500
504
|
if generate_report:
|
cucu/db.py
CHANGED
|
@@ -38,6 +38,7 @@ class cucu_run(BaseModel):
|
|
|
38
38
|
full_arguments = JSONField()
|
|
39
39
|
date = TextField()
|
|
40
40
|
start_at = DateTimeField()
|
|
41
|
+
end_at = DateTimeField(null=True)
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
class worker(BaseModel):
|
|
@@ -47,6 +48,14 @@ class worker(BaseModel):
|
|
|
47
48
|
field="cucu_run_id",
|
|
48
49
|
backref="workers",
|
|
49
50
|
column_name="cucu_run_id",
|
|
51
|
+
null=True,
|
|
52
|
+
)
|
|
53
|
+
parent_id = ForeignKeyField(
|
|
54
|
+
"self",
|
|
55
|
+
field="worker_run_id",
|
|
56
|
+
backref="child_workers",
|
|
57
|
+
column_name="parent_id",
|
|
58
|
+
null=True,
|
|
50
59
|
)
|
|
51
60
|
start_at = DateTimeField()
|
|
52
61
|
end_at = DateTimeField(null=True)
|
|
@@ -114,32 +123,32 @@ class step(BaseModel):
|
|
|
114
123
|
duration = FloatField(null=True)
|
|
115
124
|
start_at = DateTimeField()
|
|
116
125
|
end_at = DateTimeField(null=True)
|
|
117
|
-
debug_output =
|
|
126
|
+
debug_output = TextField(null=True)
|
|
118
127
|
browser_logs = TextField(null=True)
|
|
119
128
|
browser_info = JSONField(null=True)
|
|
120
129
|
screenshots = JSONField(null=True)
|
|
121
130
|
|
|
122
131
|
|
|
123
132
|
def record_cucu_run():
|
|
124
|
-
worker_run_id = CONFIG["WORKER_RUN_ID"]
|
|
125
133
|
cucu_run_id_val = CONFIG["CUCU_RUN_ID"]
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"worker_run_id": worker_run_id,
|
|
129
|
-
"full_arguments": sys.argv,
|
|
130
|
-
"date": datetime.now().isoformat(),
|
|
131
|
-
}
|
|
134
|
+
worker_run_id = CONFIG["WORKER_RUN_ID"]
|
|
135
|
+
|
|
132
136
|
db.connect(reuse_if_open=True)
|
|
137
|
+
start_at = datetime.now().isoformat()
|
|
133
138
|
cucu_run.create(
|
|
134
139
|
cucu_run_id=cucu_run_id_val,
|
|
135
|
-
full_arguments=
|
|
136
|
-
date=
|
|
137
|
-
start_at=
|
|
140
|
+
full_arguments=sys.argv,
|
|
141
|
+
date=start_at,
|
|
142
|
+
start_at=start_at,
|
|
138
143
|
)
|
|
144
|
+
|
|
139
145
|
worker.create(
|
|
140
146
|
worker_run_id=worker_run_id,
|
|
141
147
|
cucu_run_id=cucu_run_id_val,
|
|
142
|
-
|
|
148
|
+
parent_id=CONFIG.get("WORKER_PARENT_ID")
|
|
149
|
+
if CONFIG.get("WORKER_PARENT_ID") != worker_run_id
|
|
150
|
+
else None,
|
|
151
|
+
start_at=datetime.now().isoformat(),
|
|
143
152
|
)
|
|
144
153
|
db.close()
|
|
145
154
|
return str(db_filepath)
|
|
@@ -266,12 +275,21 @@ def finish_feature_record(feature_obj):
|
|
|
266
275
|
db.close()
|
|
267
276
|
|
|
268
277
|
|
|
269
|
-
def finish_worker_record(custom_data=None):
|
|
278
|
+
def finish_worker_record(custom_data=None, worker_run_id=None):
|
|
270
279
|
db.connect(reuse_if_open=True)
|
|
280
|
+
target_worker_run_id = worker_run_id or CONFIG["WORKER_RUN_ID"]
|
|
271
281
|
worker.update(
|
|
272
282
|
end_at=datetime.now().isoformat(),
|
|
273
283
|
custom_data=custom_data,
|
|
274
|
-
).where(worker.worker_run_id ==
|
|
284
|
+
).where(worker.worker_run_id == target_worker_run_id).execute()
|
|
285
|
+
db.close()
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def finish_cucu_run_record():
|
|
289
|
+
db.connect(reuse_if_open=True)
|
|
290
|
+
cucu_run.update(
|
|
291
|
+
end_at=datetime.now().isoformat(),
|
|
292
|
+
).where(cucu_run.cucu_run_id == CONFIG["CUCU_RUN_ID"]).execute()
|
|
275
293
|
db.close()
|
|
276
294
|
|
|
277
295
|
|
cucu/environment.py
CHANGED
|
@@ -11,6 +11,7 @@ from cucu import config, init_scenario_hook_variables, logger
|
|
|
11
11
|
from cucu.config import CONFIG
|
|
12
12
|
from cucu.db import (
|
|
13
13
|
create_database_file,
|
|
14
|
+
finish_cucu_run_record,
|
|
14
15
|
finish_feature_record,
|
|
15
16
|
finish_scenario_record,
|
|
16
17
|
finish_step_record,
|
|
@@ -58,16 +59,21 @@ def before_all(ctx):
|
|
|
58
59
|
ctx.check_browser_initialized = partial(check_browser_initialized, ctx)
|
|
59
60
|
ctx.worker_custom_data = {}
|
|
60
61
|
|
|
61
|
-
CONFIG["WORKER_RUN_ID"]
|
|
62
|
+
if CONFIG["WORKER_RUN_ID"] != CONFIG["WORKER_PARENT_ID"]:
|
|
63
|
+
logger.debug(
|
|
64
|
+
"Create a new worker db since this isn't the parent process"
|
|
65
|
+
)
|
|
66
|
+
CONFIG["WORKER_RUN_ID"] = generate_short_id()
|
|
67
|
+
|
|
68
|
+
results_path = Path(CONFIG["CUCU_RESULTS_DIR"])
|
|
69
|
+
worker_run_id = CONFIG["WORKER_RUN_ID"]
|
|
70
|
+
cucu_run_id = CONFIG["CUCU_RUN_ID"]
|
|
71
|
+
CONFIG["RUN_DB_PATH"] = run_db_path = (
|
|
72
|
+
results_path / f"run_{cucu_run_id}_{worker_run_id}.db"
|
|
73
|
+
)
|
|
74
|
+
create_database_file(run_db_path)
|
|
75
|
+
record_cucu_run()
|
|
62
76
|
|
|
63
|
-
results_path = Path(CONFIG["CUCU_RESULTS_DIR"])
|
|
64
|
-
worker_run_id = CONFIG["WORKER_RUN_ID"]
|
|
65
|
-
cucu_run_id = CONFIG["CUCU_RUN_ID"]
|
|
66
|
-
CONFIG["RUN_DB_PATH"] = run_db_path = (
|
|
67
|
-
results_path / f"run_{cucu_run_id}_{worker_run_id}.db"
|
|
68
|
-
)
|
|
69
|
-
create_database_file(run_db_path)
|
|
70
|
-
record_cucu_run()
|
|
71
77
|
CONFIG.snapshot("before_all")
|
|
72
78
|
|
|
73
79
|
for hook in CONFIG["__CUCU_BEFORE_ALL_HOOKS"]:
|
|
@@ -80,6 +86,7 @@ def after_all(ctx):
|
|
|
80
86
|
hook(ctx)
|
|
81
87
|
|
|
82
88
|
finish_worker_record(ctx.worker_custom_data)
|
|
89
|
+
finish_cucu_run_record()
|
|
83
90
|
CONFIG.restore(with_pop=True)
|
|
84
91
|
|
|
85
92
|
|
|
@@ -7,16 +7,16 @@ cucu/browser/frames.py,sha256=216ee4cd1267e4f91b31aa2f21e94078258ef93fb6b0e4f0a9
|
|
|
7
7
|
cucu/browser/selenium.py,sha256=7940b60d9921508662ef4b154da344ff40216a719371ecb1fe908b213ecf37aa,13299
|
|
8
8
|
cucu/browser/selenium_tweaks.py,sha256=a1422159584165b73daac99050932922bf6e5162b1b60641727c92594e98b6d9,879
|
|
9
9
|
cucu/cli/__init__.py,sha256=b975f9c951b59289c9fc835d96b71f320f93b7fe7f712c76f4477c47cbfdd3c0,62
|
|
10
|
-
cucu/cli/core.py,sha256=
|
|
10
|
+
cucu/cli/core.py,sha256=07b02c622c7f5b9872ade0a9a81bf1eb724aa5b0eaa12349d49802e0b949d41f,27560
|
|
11
11
|
cucu/cli/run.py,sha256=a48ca686bc77c3e74292f87e62a487f4795d08f120301d0cc43347812f91bc56,5935
|
|
12
12
|
cucu/cli/steps.py,sha256=960e62b551ff0bed3fdd17a5597bfd5f6a90507820771bb12c21b01f99756dfe,4210
|
|
13
13
|
cucu/cli/thread_dumper.py,sha256=6775e7612c62771ea9aa3950ef3bbe4ca3086195a4e33f5ce582dd3e471e9a25,1593
|
|
14
14
|
cucu/config.py,sha256=e4013a1ab92ace3361cf3ac1f9e66b20d81eced57b0821ae49d589fb91ad5a19,14939
|
|
15
|
-
cucu/db.py,sha256=
|
|
15
|
+
cucu/db.py,sha256=d1aad16458f7aad58bab0639687a43c4d0bb05ee6ca411c3ee8ec36c725009a2,11822
|
|
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=
|
|
19
|
+
cucu/environment.py,sha256=e74dd336deff00bd12c14ced8a633878cbcc390dd04927005df9fa2997a6b2e2,12885
|
|
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
|
|
@@ -87,7 +87,7 @@ cucu/steps/text_steps.py,sha256=263fc61e81de7a637055d50e76a71e840acda7b58cf96323
|
|
|
87
87
|
cucu/steps/variable_steps.py,sha256=59272d1f7ff17318e28c63d8665c69f9fa02fd220000ab45fffb1a36d81925b9,2966
|
|
88
88
|
cucu/steps/webserver_steps.py,sha256=c169294af71231d8ac90f921e1caa57a95b1d6792f1294d4dad4574263c36f2a,1410
|
|
89
89
|
cucu/utils.py,sha256=a79b12b89cc67409bda959310a384cacbe13f87e54241720f88bf303b7fcb9bb,10939
|
|
90
|
-
cucu-1.3.
|
|
91
|
-
cucu-1.3.
|
|
92
|
-
cucu-1.3.
|
|
93
|
-
cucu-1.3.
|
|
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,,
|
|
File without changes
|