From 8c267e2ab63f2852168e5ae00ebf8854ce2d87f3 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sun, 5 Jul 2026 18:46:19 +0900 Subject: [PATCH] Fail release QA on relevant warnings --- scripts/verify-release-candidate.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/verify-release-candidate.mjs b/scripts/verify-release-candidate.mjs index d7619f7..6528afd 100644 --- a/scripts/verify-release-candidate.mjs +++ b/scripts/verify-release-candidate.mjs @@ -6,6 +6,7 @@ const targetUrl = withDebugParam(process.env.RELEASE_QA_URL ?? 'http://127.0.0.1 const screenshotDir = 'dist'; const expectedTitle = '\uC0BC\uAD6D\uC9C0: \uC138 \uD615\uC81C\uC758 \uB9F9\uC138'; const firstBattleUnlockLabel = '\uD669\uAC74 \uC794\uB2F9 \uCD94\uACA9 \uAC1C\uBC29'; +const relevantLogPattern = /asset|audio|cannot|failed|map|missing|portrait|sprite|story|texture|unit/i; let serverProcess; let browser; @@ -319,9 +320,11 @@ try { `Expected title continue to reopen ending: ${JSON.stringify(endingContinueState)}` ); - const errors = consoleMessages.filter((message) => message.type === 'error'); + const relevantLogs = consoleMessages.filter( + (message) => message.type === 'error' || (isWarning(message.type) && relevantLogPattern.test(message.text)) + ); const blockingRequestFailures = requestFailures.filter((request) => request.failure !== 'net::ERR_ABORTED'); - assert(errors.length === 0, `Unexpected browser console errors: ${JSON.stringify(errors)}`); + assert(relevantLogs.length === 0, `Unexpected browser console issues: ${JSON.stringify(relevantLogs)}`); assert(pageErrors.length === 0, `Unexpected browser runtime errors: ${JSON.stringify(pageErrors)}`); assert(blockingRequestFailures.length === 0, `Unexpected browser request failures: ${JSON.stringify(blockingRequestFailures)}`); @@ -340,6 +343,10 @@ function withDebugParam(url) { return parsed.toString(); } +function isWarning(type) { + return type === 'warning' || type === 'warn'; +} + async function waitForTitle(page) { await page.waitForFunction(() => document.querySelector('canvas') !== null, undefined, { timeout: 90000 }); await page.waitForFunction(() => window.__HEROS_DEBUG__ !== undefined, undefined, { timeout: 90000 });