aboutsummaryrefslogtreecommitdiff
path: root/are-we-synapse-yet.py
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-04-05 15:32:30 +0200
committerGitHub <noreply@github.com>2022-04-05 15:32:30 +0200
commitc84937b85292c31411eb2329570fdbf1903582e7 (patch)
tree603672cfcab83ac6cb84620cdc1e2d566260a859 /are-we-synapse-yet.py
parent47be39c18e4c76f93fc35978b534ef178aafdbcf (diff)
Add Are We Synapse Yet to GHA (#2321)
* Add Are We Synapse Yet to GHA * Better output & add comments
Diffstat (limited to 'are-we-synapse-yet.py')
-rwxr-xr-xare-we-synapse-yet.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/are-we-synapse-yet.py b/are-we-synapse-yet.py
index 10b1be28..8d551575 100755
--- a/are-we-synapse-yet.py
+++ b/are-we-synapse-yet.py
@@ -3,7 +3,7 @@
from __future__ import division
import argparse
import re
-import sys
+import os
# Usage: $ ./are-we-synapse-yet.py [-v] results.tap
# This script scans a results.tap file from Dendrite's CI process and spits out
@@ -156,6 +156,7 @@ def parse_test_line(line):
# ✓ POST /register downcases capitals in usernames
# ...
def print_stats(header_name, gid_to_tests, gid_to_name, verbose):
+ ci = os.getenv("CI") # When running from GHA, this groups the subsections
subsections = [] # Registration: 100% (13/13 tests)
subsection_test_names = {} # 'subsection name': ["✓ Test 1", "✓ Test 2", "× Test 3"]
total_passing = 0
@@ -169,7 +170,7 @@ def print_stats(header_name, gid_to_tests, gid_to_name, verbose):
for name, passing in tests.items():
if passing:
group_passing += 1
- test_names_and_marks.append(f"{'✓' if passing else '×'} {name}")
+ test_names_and_marks.append(f"{'✅' if passing else '❌'} {name}")
total_tests += group_total
total_passing += group_passing
@@ -186,11 +187,11 @@ def print_stats(header_name, gid_to_tests, gid_to_name, verbose):
print("%s: %s (%d/%d tests)" % (header_name, pct, total_passing, total_tests))
print("-" * (len(header_name)+1))
for line in subsections:
- print(" %s" % (line,))
+ print("%s%s" % ("::group::" if ci and verbose else "", line,))
if verbose:
for test_name_and_pass_mark in subsection_test_names[line]:
print(" %s" % (test_name_and_pass_mark,))
- print("")
+ print("%s" % ("::endgroup::" if ci else ""))
print("")
def main(results_tap_path, verbose):