CYBER-0 ansible-testing update
This commit is contained in:
@@ -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}%')
|
||||
|
||||
Reference in New Issue
Block a user