Files
simplex-chat/scripts/ci/ui-tests/android-summary.py
T
Narasimha-sc 69b3cc4f0e ui tests: about 300 more tests across all areas, server control, relays, remote desktop, CI workflow
- Tests for connection plans, prepared chats, edit/delete/selection, forwarding, drafts, group preferences and admission, group lifecycle, compose, live messages, item info, reports and moderation, privacy and SimpleX Lock, chat data and database, address and contact preferences, profiles, contact info, unread and search, files and reactions, group info and events, chat shell and statuses, joining, support and business chats, settings and appearance, network and servers, channels, remote desktop, Android intents and notifications.
- Harness: server stop/start, smp2/xftp2, SOCKS stub, CLI chat relays, CLI remote host/controller, chat scroll and drag helpers, file chooser answers, clipboard in popups.
- ui-tests workflow (manual dispatch only) running both suites on GitHub runners.
- App findings recorded in plan section 15.5 (items 7-23), each covered by a test marked @KnownAppIssue.
2026-10-22 19:45:11 +00:00

50 lines
2.0 KiB
Python
Executable File

#!/usr/bin/env python3
# Prints the results of an Android UI test run of apps/multiplatform/scripts/uitest-android.sh (its results.txt), and
# adds them to the job summary on GitHub.
# Usage: scripts/ci/ui-tests/android-summary.py <run dir>
import collections
import glob
import os
import sys
run_dir = sys.argv[1]
results = os.path.join(run_dir, "results.txt")
if not os.path.isfile(results):
sys.exit(f"no results.txt in {run_dir}")
outcomes = {"0": "passed", "-2": "failed", "-3": "skipped", "-4": "skipped", "crashed": "crashed"}
columns = ["passed", "failed", "crashed", "skipped"]
classes = collections.defaultdict(collections.Counter)
problems = []
with open(results) as f:
for line in f:
test, _, code = line.strip().rpartition(" ")
if not test:
continue
outcome = outcomes.get(code, f"code {code}")
cls = test.split("#")[0].removeprefix("chat.simplex.app.ui.")
classes[cls][outcome if outcome in columns else "failed"] += 1
if outcome not in ("passed", "skipped"):
problems.append(f"{test.removeprefix('chat.simplex.app.ui.')}: {outcome}")
totals = collections.Counter()
for counts in classes.values():
totals.update(counts)
rows = ["| Class | " + " | ".join(c.capitalize() for c in columns) + " |", "|---" * (len(columns) + 1) + "|"]
for cls in sorted(classes):
rows.append(f"| {cls} | " + " | ".join(str(classes[cls][c]) for c in columns) + " |")
summary = [f"### Android UI tests: {sum(totals.values())} tests, " + ", ".join(f"{totals[c]} {c}" for c in columns), ""]
summary += rows if classes else ["No test finished."]
if problems:
summary += ["", "Failed or crashed:", ""] + [f"- {p}" for p in problems]
shots = glob.glob(os.path.join(run_dir, "failures", "*"))
if shots:
summary += ["", f"{len(shots)} failure screenshots are in the `failures` directory of the run's artifact."]
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")