Skip to content

Commit ae71107

Browse files
authored
Merge pull request #609 from AutomationSolutionz/lorust-report-enhancements
Lorust report enhancements
2 parents 97f62b3 + 4f2b327 commit ae71107

10 files changed

Lines changed: 1393 additions & 420 deletions

File tree

4.54 MB
Binary file not shown.
16.1 MB
Binary file not shown.

Apps/lorust/lorust_Linux_x86_64.exe

100644100755
-114 KB
Binary file not shown.
726 KB
Binary file not shown.
7.39 MB
Binary file not shown.

Framework/Built_In_Automation/Sequential_Actions/lorust_performance_action.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ def lorust_performance_action_handler(
6161
for i in range(l, r+1):
6262
actions_to_execute.append(i-1) #[9,10,11,12,13,14]
6363

64+
if max_tasks is None:
65+
CommonUtil.ExecLog(
66+
sModuleInfo,
67+
"`max tasks` parameter is missing",
68+
3,
69+
)
70+
return "zuez_failed"
71+
6472
def find_row_by(
6573
action: List[List[str]],
6674
left: str | None = None,
@@ -86,7 +94,8 @@ def find_row_by(
8694
load_gen_function = {
8795
"spawn_rate": spawn_rate,
8896
"timeout": timeout,
89-
"functions_to_execute": []
97+
"max_tasks": max_tasks,
98+
"functions_to_execute": [],
9099
}
91100
flow = {
92101
"functions": [
@@ -213,8 +222,12 @@ def find_row_by(
213222
metrics_output_path = save_path / "lorust_performance_report"
214223
metrics_output_path.mkdir(parents=True, exist_ok=True)
215224

216-
flow_save_path = metrics_output_path / "flow.json"
217-
metrics_output_json_path = metrics_output_path / "http.json"
225+
step_no: int = CommonUtil.current_step_sequence # type: ignore
226+
action_no: int = CommonUtil.current_action_no # type: ignore
227+
tc_id: str = CommonUtil.current_tc_no
228+
file_name_prefix = f"{tc_id}_STEP-{step_no}_ACTION-{action_no}"
229+
flow_save_path = metrics_output_path / f"{file_name_prefix}_flow.json"
230+
metrics_output_json_path = metrics_output_path / f"{file_name_prefix}_http.json"
218231

219232
# Save the flow configuration
220233
with open(flow_save_path, "w") as f:
@@ -237,11 +250,16 @@ def find_row_by(
237250
binary_name = f"lorust_{uname.system}_{uname.machine}.exe"
238251
lorust_path = lorust_path / binary_name
239252

240-
subprocess.run(' '.join([
241-
str(lorust_path),
242-
f"--output-path {metrics_output_path}",
243-
f"--flow-path {flow_save_path}",
244-
]), shell=True)
253+
subprocess.run(
254+
" ".join(
255+
[
256+
str(lorust_path),
257+
f"--output-path {metrics_output_json_path}",
258+
f"--flow-path {flow_save_path}",
259+
]
260+
),
261+
shell=True,
262+
)
245263

246264
testendtime = time.perf_counter()
247265
duration = testendtime - teststarttime
@@ -296,7 +314,7 @@ def create_html_report(
296314

297315
step_no: int = CommonUtil.current_step_sequence # type: ignore
298316
action_no: int = CommonUtil.current_action_no # type: ignore
299-
file_name = report_save_path / f"{tc_id}_STEP-{step_no}_ACTION-{action_no}.html"
317+
file_name = report_save_path / f"{tc_id}_STEP-{step_no}_ACTION-{action_no}_report.html"
300318

301319
with open(file_name, "w", encoding="utf-8") as file:
302320
file.write(html)

Framework/Utilities/CommonUtil.py

Lines changed: 312 additions & 72 deletions
Large diffs are not rendered by default.

Framework/Utilities/RequestFormatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ def login():
137137
return data, r.status_code
138138

139139

140-
def form_uri(resource_path):
140+
def form_uri(resource_path: str | None = None) -> str:
141141
web_server_address = ConfigModule.get_config_value(AUTHENTICATION_CATEGORY, SERVER_ADDRESS_TAG)
142142
base_server_address = web_server_address
143-
if len(resource_path) > 0:
143+
if resource_path and len(resource_path) > 0:
144144
if resource_path[0] == "/":
145145
resource_path = resource_path[1:]
146146
base_server_address += "/" + resource_path

0 commit comments

Comments
 (0)