Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lib/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default (options: Record<string, string>): Context => {
let buildNameObj: string;
let allowDuplicateSnapshotNames: boolean = false;
let useLambdaInternal: boolean = false;
let useRemoteDiscovery: boolean = false;
let useExtendedViewport: boolean = false;
let loadDomContent: boolean = false;
try {
Expand Down Expand Up @@ -108,6 +109,9 @@ export default (options: Record<string, string>): Context => {
if (config.useLambdaInternal) {
useLambdaInternal = true;
}
if (config.useRemoteDiscovery) {
useRemoteDiscovery = true;
}
if (config.useExtendedViewport) {
useExtendedViewport = true;
}
Expand Down Expand Up @@ -146,6 +150,7 @@ export default (options: Record<string, string>): Context => {
requestHeaders: config.requestHeaders || {},
allowDuplicateSnapshotNames: allowDuplicateSnapshotNames,
useLambdaInternal: useLambdaInternal,
useRemoteDiscovery: useRemoteDiscovery,
useExtendedViewport: useExtendedViewport,
loadDomContent: loadDomContent,
approvalThreshold: config.approvalThreshold,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/schemaValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ const ConfigSchema = {
type: "boolean",
errorMessage: "Invalid config; useLambdaInternal must be true/false"
},
useRemoteDiscovery: {
type: "boolean",
errorMessage: "Invalid config; useRemoteDiscovery must be true/false"
},
useExtendedViewport: {
type: "boolean",
errorMessage: "Invalid config; useExtendedViewport must be true/false"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/snapshotQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default class Queue {
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/tasks/createBuildExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
}
task.output = chalk.gray(`build id: ${resp.data.buildId}`);
task.title = 'SmartUI build created'
if (ctx.env.USE_REMOTE_DISCOVERY){
if (ctx.env.USE_REMOTE_DISCOVERY || ctx.config.useRemoteDiscovery) {
task.output += chalk.gray(`\n Using remote discovery for this build`);
}
} else {
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface Context {
requestHeaders?: Array<Record<string, string>>;
allowDuplicateSnapshotNames?: boolean;
useLambdaInternal?: boolean;
useRemoteDiscovery?: boolean;
useExtendedViewport?: boolean;
loadDomContent?: boolean;
approvalThreshold?: number;
Expand Down