CYBER-0 ansible-testing update

This commit is contained in:
Ole
2026-08-31 13:35:40 +02:00
parent ca9312379a
commit 042ddc63d5
6 changed files with 60 additions and 162 deletions
+6 -7
View File
@@ -50,18 +50,17 @@ fi
echo ""
echo "[2/3] Latest report: $(basename "$LATEST_JSON")"
# ── Phase 3: Render with Go template ────────────────────────────
echo "[3/3] Rendering report with Go template..."
# ── Phase 3: Render with gomplate ───────────────────────────────
echo "[3/3] Rendering report with gomplate..."
echo ""
cd "$REPORT_DIR"
if ! go run render.go "$LATEST_JSON" report.gohtml 2>/dev/null; then
# Fallback: if Go isn't available, just cat the JSON
if ! gomplate --context ".=$LATEST_JSON" --file "$REPORT_DIR/report.gohtml" 2>/dev/null; then
# Fallback: if gomplate isn't available, just cat the JSON
echo "---"
echo "(Go not available; showing raw JSON summary)"
echo "(gomplate not available; showing raw JSON summary)"
python3 -c "
import json, sys
with open('$(basename "$LATEST_JSON")') as f:
with open('$LATEST_JSON') as f:
r = json.load(f)
s = r['summary']
print(f'Total: {s[\"total\"]} | Passed: {s[\"passed\"]} | Failed: {s[\"failed\"]} | Rate: {s[\"passed\"]/s[\"total\"]*100:.1f}%')