Skip to content

Commit 71f3169

Browse files
committed
added show render errors in options and config
1 parent e5d94b0 commit 71f3169

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

src/commander/exec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ command
2525
.option('--scheduled <string>', 'Specify the schedule ID')
2626
.option('--userName <string>', 'Specify the LT username')
2727
.option('--accessKey <string>', 'Specify the LT accesskey')
28+
.option('--show-render-errors', 'Show render errors from SmartUI build')
2829
.action(async function(execCommand, _, command) {
2930
const options = command.optsWithGlobals();
3031
if (options.buildName === '') {

src/lib/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default {
2525
waitForTimeout: 1000,
2626
enableJavaScript: false,
2727
allowedHostnames: [],
28-
smartIgnore: false
28+
smartIgnore: false,
29+
showRenderErrors: false
2930
},
3031
DEFAULT_WEB_STATIC_CONFIG: [
3132
{

src/lib/ctx.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export default (options: Record<string, string>): Context => {
155155
loadDomContent: loadDomContent,
156156
approvalThreshold: config.approvalThreshold,
157157
rejectionThreshold: config.rejectionThreshold,
158+
showRenderErrors: config.showRenderErrors ?? false
158159
},
159160
uploadFilePath: '',
160161
webStaticConfig: [],
@@ -192,7 +193,8 @@ export default (options: Record<string, string>): Context => {
192193
fetchResultsFileName: fetchResultsFileObj,
193194
baselineBranch: options.baselineBranch || '',
194195
baselineBuild: options.baselineBuild || '',
195-
githubURL : options.githubURL || ''
196+
githubURL : options.githubURL || '',
197+
showRenderErrors: options.showRenderErrors ? true : false
196198
},
197199
cliVersion: version,
198200
totalSnapshots: -1,

src/lib/schemaValidation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ const ConfigSchema = {
295295
minimum: 0,
296296
maximum: 100,
297297
errorMessage: "Invalid config; rejectionThreshold must be a number"
298+
},
299+
showRenderErrors: {
300+
type: "boolean",
301+
errorMessage: "Invalid config; showRenderErrors must be true/false"
298302
}
299303
},
300304
anyOf: [

src/tasks/exec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1616
}
1717
}
1818

19-
if(ctx.env.SHOW_RENDER_ERRORS && ctx.build && ctx.build.id) {
19+
if((ctx.env.SHOW_RENDER_ERRORS||ctx.options.showRenderErrors||ctx.config.showRenderErrors) && ctx.build && ctx.build.id) {
2020
if(ctx.env.LT_USERNAME&&ctx.env.LT_ACCESS_KEY) {
2121
startSSEListener(ctx);
2222
} else {

src/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface Context {
4343
loadDomContent?: boolean;
4444
approvalThreshold?: number;
4545
rejectionThreshold?: number;
46+
showRenderErrors?: boolean
4647
};
4748
uploadFilePath: string;
4849
webStaticConfig: WebStaticConfig;
@@ -71,7 +72,8 @@ export interface Context {
7172
fetchResultsFileName?: string,
7273
baselineBranch?: string,
7374
baselineBuild?: string,
74-
githubURL?: string
75+
githubURL?: string,
76+
showRenderErrors?: boolean
7577
}
7678
cliVersion: string;
7779
totalSnapshots: number;

0 commit comments

Comments
 (0)