Skip to content

Commit 427e05c

Browse files
committed
fix(quality): say "not blocking" only for a green Playwright job
Under e2e-blocking: false the report marked a failed suite as not blocking whenever a shard recorded suite_failed, even when the job was red for another reason, such as the spec-coverage threshold or skip discipline, and did block. Compute test counts now sets the flag and the wording only for a green job; a red one reads "suite failed" and keeps its ❌. Also documents that a non-blocking failure reaches the report only through the best-effort count steps.
1 parent dda05a0 commit 427e05c

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

‎.github/workflows/quality.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8387,6 +8387,14 @@ jobs:
83878387
# under `e2e-blocking: false`: the test step failed and the job is green.
83888388
# It is written with or without a report, so a suite without the html
83898389
# reporter still reaches the report as failed.
8390+
#
8391+
# This record, its upload, its download and `Compute test counts` are
8392+
# all best-effort (`continue-on-error`), and under `e2e-blocking: false`
8393+
# they are the only way a failed suite reaches the report. If one link
8394+
# breaks, the row reads ✅ for a failed suite. Accepted, because the
8395+
# suite does not block by request either way, and `Name a failed suite
8396+
# that does not block` still warns on the job. A job output is not the
8397+
# alternative: with shards, the last leg to finish writes it.
83908398
- name: Record test counts
83918399
id: test-counts-playwright
83928400
if: ${{ !cancelled() }}
@@ -10854,8 +10862,14 @@ jobs:
1085410862
for suite in ("phpunit", "newman", "playwright"):
1085510863
value = cell(suite, os.environ.get(f"{suite.upper()}_RESULT", ""))
1085610864
if suite == "playwright" and suite_failed():
10857-
value = "suite failed, not blocking (`e2e-blocking: false`)" + (f"; {value}" if value else "")
10858-
env.write("PLAYWRIGHT_NONBLOCKING=true\n")
10865+
# "Not blocking" only while the job is green. A job red
10866+
# for another reason (the coverage threshold, skip
10867+
# discipline) does block, and keeps its ❌.
10868+
if os.environ.get("PLAYWRIGHT_RESULT") == "success":
10869+
value = "suite failed, not blocking (`e2e-blocking: false`)" + (f"; {value}" if value else "")
10870+
env.write("PLAYWRIGHT_NONBLOCKING=true\n")
10871+
else:
10872+
value = "suite failed" + (f"; {value}" if value else "")
1085910873
print(f"{suite}: {value or '(no counts)'}")
1086010874
env.write(f"{suite.upper()}_COUNTS={' '.join(value.split())}\n")
1086110875
PYEOF

‎scripts/test-quality-test-counts.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
"cell-playwright-nonblocking", "a failed non-blocking suite shown as a green one"),
138138
("compute", '.get("suite_failed") is True:', '.get("suite_failed") is not False:',
139139
"cell-playwright-green", "a shard without a suite_failed mark read as failed"),
140+
("compute", 'if os.environ.get("PLAYWRIGHT_RESULT") == "success":', "if True:",
141+
"cell-playwright-nonblocking-red-job", "a red job's row says its failed suite does not block"),
140142
("phpunit", 'total -= len(json.loads(os.environ.get("EXTRA_LEGS") or "[]"))', "pass",
141143
"phpunit-extra-database-legs", "install-only database legs counted as legs that owe a count"),
142144
("legs", 'os.environ.get("INSTALL_MATRIX", "")', 'os.environ.get("TEST_MATRIX", "")',
@@ -498,6 +500,15 @@ def interrupt_the_skip(test: dict) -> None:
498500
cells.get("PLAYWRIGHT_NONBLOCKING") == "true" and cell.startswith("suite failed, not blocking"),
499501
f"want the flag and 'suite failed, not blocking' without counts, got exit {code} {cells}\n{log}")
500502

503+
# A job red for another reason (the coverage threshold, skip discipline)
504+
# blocks: the cell says the suite failed, but not that it does not block.
505+
code, cells, log = compute(r, "cell-playwright-nonblocking-red-job",
506+
{"playwright-shard-1.json": playwright_nonblocking}, {"playwright": "failure"})
507+
cell = cells.get("PLAYWRIGHT_COUNTS", "")
508+
check("cell-playwright-nonblocking-red-job",
509+
"PLAYWRIGHT_NONBLOCKING" not in cells and cell.startswith("suite failed; 1/2") and "not blocking" not in cell,
510+
f"want 'suite failed; 1/2 …' and no flag, got exit {code} {cells}\n{log}")
511+
501512
code, cells, log = compute(r, "cell-playwright-green",
502513
{"playwright-shard-1.json": leg("shard 1", 10, 10, total=1)}, {"playwright": "success"})
503514
check("cell-playwright-green", "PLAYWRIGHT_NONBLOCKING" not in cells and cells.get("PLAYWRIGHT_COUNTS") == "10/10",

0 commit comments

Comments
 (0)