Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: warn in merge-report comment when triggering run was cancelled (#40487)

Simon Knottfede9293d2fb
diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml
index 5d5ff39f3c..3f91e00c91 100644
--- a/.github/workflows/create_test_report.yml
+++ b/.github/workflows/create_test_report.yml
@@ -37,6 +37,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
HTML_REPORT_URL: 'https://mspwblobreport.z1.web.core.windows.net/run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}/index.html'
+ WORKFLOW_RUN_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
- name: Azure Login
uses: azure/login@v2
diff --git a/tests/config/ghaMarkdownReporter.ts b/tests/config/ghaMarkdownReporter.ts
index fdd223b543..095496916d 100644
--- a/tests/config/ghaMarkdownReporter.ts
+++ b/tests/config/ghaMarkdownReporter.ts
@@ -52,6 +52,11 @@ class MarkdownReporter implements Reporter {
async onEnd(result: FullResult) {
const summary = this._generateSummary();
const lines: string[] = [];
+ const incompleteWarning = this._incompleteRunWarning();
+ if (incompleteWarning) {
+ lines.push(incompleteWarning);
+ lines.push(``);
+ }
if (this._fatalErrors.length)
lines.push(`**${this._fatalErrors.length} fatal errors, not part of any test**`);
if (summary.unexpected.length) {
@@ -87,6 +92,13 @@ class MarkdownReporter implements Reporter {
await fs.promises.writeFile(reportFile, report);
}
+ protected _incompleteRunWarning(): string | undefined {
+ const conclusion = process.env.WORKFLOW_RUN_CONCLUSION;
+ if (!conclusion || conclusion === 'success' || conclusion === 'failure')
+ return undefined;
+ return `> [!WARNING]\n> The triggering workflow run ended with status \`${conclusion}\`. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.`;
+ }
+
protected _generateSummary() {
let didNotRun = 0;
let skipped = 0;