Publish early battle QA report

This commit is contained in:
2026-07-05 20:30:51 +09:00
parent 620c9c3eca
commit 5fbfada47a
3 changed files with 91 additions and 8 deletions

View File

@@ -117,6 +117,13 @@ try {
`Expected deployed release manifest commit ${expectedCommit}: ${JSON.stringify(releaseManifest)}`
);
}
if (releaseManifest.qaReport) {
const qaReport = await readJsonAsset(targetUrl, releaseManifest.qaReport);
assert(qaReport.app === 'heros_web', `Expected deployed QA report app id: ${JSON.stringify(qaReport)}`);
assert(Array.isArray(qaReport.results) && qaReport.results.length > 0, `Expected deployed QA report results: ${JSON.stringify(qaReport)}`);
assert(typeof qaReport.generatedAt === 'string' && qaReport.generatedAt.length > 0, `Expected deployed QA report timestamp: ${JSON.stringify(qaReport)}`);
console.log(`Verified QA report ${releaseManifest.qaReport} with ${qaReport.results.length} battles`);
}
const relevantLogs = consoleMessages.filter(
(message) => message.type === 'error' || (isWarning(message.type) && relevantLogPattern.test(message.text))
@@ -145,10 +152,14 @@ function isWarning(type) {
}
async function readReleaseManifest(pageUrl) {
const manifestUrl = new URL('release-manifest.json', pageUrl);
manifestUrl.searchParams.set('v', expectedQaVersion ?? String(Date.now()));
const response = await fetch(manifestUrl, { signal: AbortSignal.timeout(90000) });
assert(response.ok, `Expected deployed release manifest at ${manifestUrl.href}: ${response.status} ${response.statusText}`);
return readJsonAsset(pageUrl, 'release-manifest.json');
}
async function readJsonAsset(pageUrl, assetPath) {
const assetUrl = new URL(assetPath, pageUrl);
assetUrl.searchParams.set('v', expectedQaVersion ?? String(Date.now()));
const response = await fetch(assetUrl, { signal: AbortSignal.timeout(90000) });
assert(response.ok, `Expected deployed JSON asset at ${assetUrl.href}: ${response.status} ${response.statusText}`);
return response.json();
}