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)
|
||||
sys.exit(exit_code)
|
||||
@@ -15,6 +15,10 @@ static_dir = os.path.join(os.path.dirname(__file__), "static")
|
||||
os.makedirs(static_dir, exist_ok=True)
|
||||
app.mount("/static", StaticFiles(directory=static_dir), name="static")
|
||||
|
||||
@app.get("/favicon.ico", include_in_schema=False)
|
||||
async def favicon():
|
||||
return FileResponse(os.path.join(static_dir, "favicon.png"))
|
||||
|
||||
# Base directory for data as requested
|
||||
BASE_DATA_DIR = "/home/asf/testarena"
|
||||
# For local development on Windows, we might need to adjust this,
|
||||
|
||||
BIN
testarena_app/static/favicon.png
Normal file
BIN
testarena_app/static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 KiB |
@@ -5,6 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>TestArena | Modern Dashboard</title>
|
||||
<link rel="icon" type="image/png" href="/static/favicon.png">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
@@ -283,10 +284,8 @@
|
||||
<div class="container">
|
||||
<header>
|
||||
<div class="logo">
|
||||
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" />
|
||||
</svg>
|
||||
<img src="/static/favicon.png" alt="TestArena Logo"
|
||||
style="width: 40px; height: 40px; border-radius: 8px;">
|
||||
TestArena
|
||||
</div>
|
||||
<nav class="nav-links">
|
||||
|
||||
Reference in New Issue
Block a user