Skip to content

Commit 98b1511

Browse files
authored
Merge pull request #315 from shrinishLT/DOT-5844
Add --scheduled option
2 parents 8156fb2 + e57d647 commit 98b1511

File tree

8 files changed

+9
-6
lines changed

8 files changed

+9
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules
22
dist
33
.idea
4-
pnpm-lock.yaml

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-cli",
3-
"version": "4.1.18",
3+
"version": "4.1.19",
44
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
55
"files": [
66
"dist/**/*"

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled);
1616
if (resp && resp.data && resp.data.buildId) {
1717
ctx.build = {
1818
id: resp.data.buildId,

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)