Skip to content

Commit b1137f3

Browse files
add useremotediscovery in cli config
1 parent 3153208 commit b1137f3

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

src/lib/ctx.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default (options: Record<string, string>): Context => {
2525
let buildNameObj: string;
2626
let allowDuplicateSnapshotNames: boolean = false;
2727
let useLambdaInternal: boolean = false;
28+
let useRemoteDiscovery: boolean = false;
2829
let useExtendedViewport: boolean = false;
2930
let loadDomContent: boolean = false;
3031
try {
@@ -108,6 +109,9 @@ export default (options: Record<string, string>): Context => {
108109
if (config.useLambdaInternal) {
109110
useLambdaInternal = true;
110111
}
112+
if (config.useRemoteDiscovery) {
113+
useRemoteDiscovery = true;
114+
}
111115
if (config.useExtendedViewport) {
112116
useExtendedViewport = true;
113117
}
@@ -146,6 +150,7 @@ export default (options: Record<string, string>): Context => {
146150
requestHeaders: config.requestHeaders || {},
147151
allowDuplicateSnapshotNames: allowDuplicateSnapshotNames,
148152
useLambdaInternal: useLambdaInternal,
153+
useRemoteDiscovery: useRemoteDiscovery,
149154
useExtendedViewport: useExtendedViewport,
150155
loadDomContent: loadDomContent,
151156
approvalThreshold: config.approvalThreshold,

src/lib/schemaValidation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ const ConfigSchema = {
272272
type: "boolean",
273273
errorMessage: "Invalid config; useLambdaInternal must be true/false"
274274
},
275+
useRemoteDiscovery: {
276+
type: "boolean",
277+
errorMessage: "Invalid config; useRemoteDiscovery must be true/false"
278+
},
275279
useExtendedViewport: {
276280
type: "boolean",
277281
errorMessage: "Invalid config; useExtendedViewport must be true/false"

src/lib/snapshotQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default class Queue {
327327
}
328328

329329
let processedSnapshot, warnings, discoveryErrors;
330-
if (this.ctx.env.USE_REMOTE_DISCOVERY) {
330+
if (this.ctx.env.USE_REMOTE_DISCOVERY || this.ctx.config.useRemoteDiscovery) {
331331
this.ctx.log.debug(`Using remote discovery`);
332332
let result = await prepareSnapshot(snapshot, this.ctx);
333333

src/tasks/createBuildExec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
3636
}
3737
task.output = chalk.gray(`build id: ${resp.data.buildId}`);
3838
task.title = 'SmartUI build created'
39-
if (ctx.env.USE_REMOTE_DISCOVERY){
39+
if (ctx.env.USE_REMOTE_DISCOVERY || ctx.config.useRemoteDiscovery) {
4040
task.output += chalk.gray(`\n Using remote discovery for this build`);
4141
}
4242
} else {

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface Context {
3838
requestHeaders?: Array<Record<string, string>>;
3939
allowDuplicateSnapshotNames?: boolean;
4040
useLambdaInternal?: boolean;
41+
useRemoteDiscovery?: boolean;
4142
useExtendedViewport?: boolean;
4243
loadDomContent?: boolean;
4344
approvalThreshold?: number;

0 commit comments

Comments
 (0)