Update json_to_md.py
Run Pytest with Allure and Coverage Reports / tests (push) Successful in 55s
Run Pytest with Allure and Coverage Reports / deploy (push) Has been skipped

This commit is contained in:
2025-07-10 09:55:17 +02:00
parent 38e2374de4
commit f4da8cf97d
+16 -8
View File
@@ -12,11 +12,15 @@ def json_to_adaptive_md(json_path, md_path):
f.write(f"# 🏗 Rapport de Tests (Générique)\n")
f.write(f"*Généré le {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*\n\n")
# Section Summary dynamique
if 'summary' in data:
f.write("## 📋 Summary\n")
for key, value in data['summary'].items():
f.write(f"- **{key.capitalize()}:** `{value}`\n")
total_duration = data.get('duration')
if total_duration is not None:
f.write(f"- **Durée totale:** `{total_duration:.3f}` s\n")
f.write("\n")
# Traitement hiérarchique automatique
@@ -41,15 +45,19 @@ def json_to_adaptive_md(json_path, md_path):
f.write(f" - Param {i}: `{param}`\n")
# Métadonnées communes
f.write(f"- **Statut:** {'✅ Passed' if test['outcome'] == 'passed' else '❌ Failed'}\n")
if 'duration' in test:
f.write(f"- **Durée:** {test['duration']:.3f}s\n")
if "outcome" in test:
f.write(f"- **Statut:** `{test['outcome']}`\n")
if "call" in test and "duration" in test["call"]:
f.write(f"- **Durée:** `{test['call']['duration']:.3f}`s\n")
# Détails spécifiques au résultat
if test['outcome'] != 'passed':
for key in ['message', 'longrepr', 'crash']:
if key in test:
f.write(f"\n**{key.capitalize()}:**\n```\n{str(test[key])}\n```\n")
if test.get("outcome") != "passed":
call_data = test.get("call", {})
if call_data:
f.write("\n**Détails (raw call):**\n")
for key, value in call_data.items():
f.write(f"\n- **{key}:**\n```\n{str(value)}\n```\n")
f.write("\n" + "-"*50 + "\n")