Files
spacedandy-agents-simplex 86358ba5bc ci: build the desktop app for Linux, run a UI smoke test under Xvfb and the desktop tests
First iteration on f/ci-desktop: the core job builds libsimplex.so with scripts/desktop/build-lib-linux.sh on ubuntu-24.04 (GHC 9.6.3, direct-sqlcipher +openssl, no VLC) and caches it by source hash, with the cabal store cached separately. The app job builds :desktop:createDistributable with Corretto 17 and the repo's assets, runs :common:desktopTest, then starts the app under Xvfb and openbox with software rendering and drives onboarding to the chat list and typing in the search field with the ui helper (xdotool input, tesseract OCR to find text), saving numbered screenshots, the text read from them and a step log as artifacts.
2026-10-14 17:33:34 +00:00

35 lines
1.5 KiB
Python
Executable File

#!/usr/bin/env python3
# Prints the results in the JUnit XML reports of a Gradle test task, and adds them to the job summary on GitHub.
# Usage: scripts/ci/desktop-linux/test-summary.py <test-results dir>
import glob
import os
import sys
import xml.etree.ElementTree as ET
results_dir = sys.argv[1]
suites = [ET.parse(path).getroot() for path in sorted(glob.glob(os.path.join(results_dir, "*.xml")))]
if not suites:
sys.exit(f"no test results in {results_dir}")
rows = ["| Suite | Tests | Failed | Skipped | Seconds |", "|---|---|---|---|---|"]
failures = []
totals = [0, 0, 0]
for suite in suites:
tests, failed, skipped = (int(suite.get(k, 0)) for k in ("tests", "failures", "skipped"))
failed += int(suite.get("errors", 0))
totals = [totals[0] + tests, totals[1] + failed, totals[2] + skipped]
rows.append(f"| {suite.get('name')} | {tests} | {failed} | {skipped} | {suite.get('time')} |")
for case in suite.iter("testcase"):
for problem in list(case.findall("failure")) + list(case.findall("error")):
failures.append(f"{case.get('classname')}.{case.get('name')}: {problem.get('message')}")
summary = [f"### desktopTest: {totals[0]} tests, {totals[1]} failed, {totals[2]} skipped", ""] + rows
if failures:
summary += ["", "Failures:", ""] + [f"- {f}" for f in failures]
print("\n".join(summary))
if os.environ.get("GITHUB_STEP_SUMMARY"):
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f:
f.write("\n".join(summary) + "\n")