repo structure
This commit is contained in:
@@ -72,7 +72,7 @@ def run_test_suite(tasks):
|
||||
shell_script = "/home/asf/testarena_backend/TPF/test_execution.sh"
|
||||
if os.name != 'nt':
|
||||
subprocess.run(["chmod", "+x", shell_script])
|
||||
|
||||
print("tasks:", tasks)
|
||||
for task in tasks:
|
||||
print(f"--- Starting Task: {task['id']} ---")
|
||||
|
||||
@@ -109,6 +109,8 @@ def run_test_suite(tasks):
|
||||
|
||||
if not json_found:
|
||||
aggregated_results[task['id']] = ["ERROR", "N/A"]
|
||||
else:
|
||||
print(f"--- Completed Task: {json_found} ---")
|
||||
return aggregated_results
|
||||
|
||||
def generate_html_report(scenario_name, results, output_path):
|
||||
@@ -142,14 +144,14 @@ def generate_html_report(scenario_name, results, output_path):
|
||||
f.write(report_content)
|
||||
print(f"HTML Report generated at: {report_file}")
|
||||
|
||||
def save_summary(results, task_id_path):
|
||||
def save_summary(results):
|
||||
json_path = os.path.join(task_id_path, "final_summary.json")
|
||||
with open(json_path, "w") as f:
|
||||
results = results.replace("file:///home/asf/testarena/", "http://asf-server.duckdns.org:8080/results/")
|
||||
json.dump(results, f, indent=4)
|
||||
print(f"\nFinal results saved to {json_path}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit_code = 0
|
||||
if len(sys.argv) > 3:
|
||||
queue_id = sys.argv[1] #"1234"
|
||||
scenario_path = sys.argv[2] #"application_layer/business_stack/actuator_manager/test/actuator_manager_init_test.test_scenario.xml"
|
||||
@@ -175,9 +177,20 @@ if __name__ == "__main__":
|
||||
"cmd": exec_cmd,
|
||||
"path": task_id_path
|
||||
})
|
||||
|
||||
final_data = run_test_suite(my_tasks)
|
||||
save_summary(final_data, task_id_path)
|
||||
if not my_tasks:
|
||||
print("No test cases found in the scenario.")
|
||||
final_data= {
|
||||
"INVALID_SCENARIO": [
|
||||
"FAIL",
|
||||
"N/A"
|
||||
],
|
||||
}
|
||||
exit_code = 1
|
||||
else:
|
||||
final_data = run_test_suite(my_tasks)
|
||||
print("\n--- Final Aggregated Results ---", final_data)
|
||||
save_summary(final_data)
|
||||
|
||||
# Generate report INSIDE the task folder
|
||||
generate_html_report(os.path.basename(scenario_path), final_data, task_id_path)
|
||||
generate_html_report(os.path.basename(scenario_path), final_data, task_id_path)
|
||||
sys.exit(exit_code)
|
||||
Reference in New Issue
Block a user