Skip to content

Commit 09f2fb1

Browse files
committed
Add --scheduled option
1 parent 8156fb2 commit 09f2fb1

File tree

9 files changed

+3574
-4
lines changed

9 files changed

+3574
-4
lines changed

lambdatest-smartui-cli-4.1.18.tgz

59.8 KB
Binary file not shown.

package-lock.json

Lines changed: 3460 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-lock.yaml

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commander/exec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ command
2222
.option('-P, --port <number>', 'Port number for the server')
2323
.option('--fetch-results [filename]', 'Fetch results and optionally specify an output file, e.g., <filename>.json')
2424
.option('--buildName <string>', 'Specify the build name')
25+
.option('--scheduled <string>', 'Specify the schedule ID')
2526
.option('--userName <string>', 'Specify the LT username')
2627
.option('--accessKey <string>', 'Specify the LT accesskey')
2728
.action(async function(execCommand, _, command) {

src/lib/ctx.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export default (options: Record<string, string>): Context => {
147147
force: options.force ? true : false,
148148
markBaseline: options.markBaseline ? true : false,
149149
buildName: options.buildName || '',
150+
scheduled: options.scheduled || '',
150151
port: port,
151152
ignoreResolutions: resolutionOff,
152153
fileExtension: extensionFiles,

src/lib/httpClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default class httpClient {
202202
}
203203
}
204204

205-
createBuild(git: Git, config: any, log: Logger, buildName: string, isStartExec: boolean, smartGit: boolean, markBaseline: boolean, baselineBuild: string) {
205+
createBuild(git: Git, config: any, log: Logger, buildName: string, isStartExec: boolean, smartGit: boolean, markBaseline: boolean, baselineBuild: string, scheduled?: string) {
206206
return this.request({
207207
url: '/build',
208208
method: 'POST',
@@ -214,7 +214,8 @@ export default class httpClient {
214214
packageVersion: pkgJSON.version,
215215
smartGit,
216216
markBaseline,
217-
baselineBuild
217+
baselineBuild,
218+
scheduled
218219
}
219220
}, log)
220221
}

src/tasks/createBuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1010
updateLogContext({task: 'createBuild'});
1111

1212
try {
13-
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild);
13+
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled);
1414
if (resp && resp.data && resp.data.buildId) {
1515
ctx.build = {
1616
id: resp.data.buildId,

src/tasks/createBuildExec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1212

1313
try {
1414
if (ctx.authenticatedInitially && !ctx.config.skipBuildCreation) {
15-
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild);
15+
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec || false, ctx.env.SMART_GIT, ctx.options.markBaseline || false, ctx.options.baselineBuild || '', ctx.options.scheduled);
1616
if (resp && resp.data && resp.data.buildId) {
1717
ctx.build = {
1818
id: resp.data.buildId,
1919
name: resp.data.buildName,
2020
url: resp.data.buildURL,
2121
baseline: resp.data.baseline,
2222
useKafkaFlow: resp.data.useKafkaFlow || false,
23+
hasDiscoveryError: false
2324
}
2425
process.env.SMARTUI_BUILD_ID = resp.data.buildId;
2526
process.env.SMARTUI_BUILD_NAME = resp.data.buildName;

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export interface Context {
5555
force?: boolean,
5656
markBaseline?: boolean,
5757
buildName?: string,
58+
scheduled?: string,
5859
port?: number,
5960
ignoreResolutions?: boolean,
6061
fileExtension?: Array<string>,

0 commit comments

Comments
 (0)