Make sure sitespeed.io do not fail if a test fails.

https://github.com/sitespeedio/sitespeed.io/issues/4453
https://github.com/sitespeedio/sitespeed.io/pull/4454
This commit is contained in:
Peter Hedenskog 2025-03-03 16:03:24 +01:00
parent c1920e615d
commit 29a1d9880c
2 changed files with 13 additions and 10 deletions

View File

@ -128,15 +128,17 @@ export default class PageXrayPlugin extends SitespeedioPlugin {
);
}
} else {
pageSummary[0].statistics = this.pageXrayAggregator.summarizePerUrl(
message.url
);
queue.postMessage(
make('pagexray.pageSummary', pageSummary[0], {
url: message.url,
group // TODO get the group from the URL?
})
);
// Check that we actually have one tested page
if (pageSummary.length > 0) {
pageSummary[0].statistics =
this.pageXrayAggregator.summarizePerUrl(message.url);
queue.postMessage(
make('pagexray.pageSummary', pageSummary[0], {
url: message.url,
group // TODO get the group from the URL?
})
);
}
let iteration = 1;
for (let summary of pageSummary) {
queue.postMessage(

View File

@ -140,7 +140,8 @@ export class PageXrayAggregator {
}
}
summarizePerUrl(url) {
return this.summarizePerObject(this.urls[url]);
// If we do not have a tested working page there's nothing to summarize
return this.urls[url] ? this.summarizePerObject(this.urls[url]) : {};
}
summarize() {
if (Object.keys(this.stats).length === 0) {