Skip to content

Commit 78208a6

Browse files
committed
update warning message on discovery
1 parent 685f52b commit 78208a6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/lib/processSnapshot.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ export default async function processSnapshot(snapshot: Snapshot, ctx: Context):
443443
for (let viewport in discoveryErrors.browsers[browser]) {
444444
if (discoveryErrors.browsers[browser][viewport].length > 0) {
445445
hasBrowserErrors = true;
446+
ctx.build.hasDiscoveryError=true
446447
break;
447448
}
448449
}
@@ -451,7 +452,7 @@ export default async function processSnapshot(snapshot: Snapshot, ctx: Context):
451452

452453
if (hasBrowserErrors) {
453454
discoveryErrors.timestamp = new Date().toISOString();
454-
ctx.log.error(discoveryErrors);
455+
// ctx.log.warn(discoveryErrors);
455456
}
456457
return {
457458
processedSnapshot: {

src/tasks/finalizeBuild.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1717
if (ctx.build.id) {
1818
await ctx.client.finalizeBuild(ctx.build.id, ctx.totalSnapshots, ctx.log);
1919
}
20+
if (ctx.build.hasDiscoveryError){
21+
ctx.log.warn(`We found some network errors while capturing DOM snapshots. These network errors may cause visual differences in your screenshots. Please go to ${ctx.build.url} for more details`);
22+
}
2023
} catch (error: any) {
2124
ctx.log.debug(error);
2225
task.output = chalk.gray(error.message);
@@ -60,7 +63,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
6063
}
6164
task.output = chalk.gray(buildUrls);
6265
task.title = 'Finalized build';
63-
66+
6467
// cleanup and upload logs
6568
try {
6669
await ctx.browser?.close();

src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export interface Build {
149149
url: string;
150150
baseline: boolean;
151151
useKafkaFlow: boolean;
152+
hasDiscoveryError: boolean;
152153
}
153154

154155
export interface WebConfig {

0 commit comments

Comments
 (0)