Fail release QA on relevant warnings

This commit is contained in:
2026-07-05 18:46:19 +09:00
parent 83adf11458
commit 8c267e2ab6

View File

@@ -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 });