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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lambdatest/smartui-cli",
"version": "4.1.44",
"version": "4.1.45",
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
"files": [
"dist/**/*"
Expand Down
29 changes: 29 additions & 0 deletions src/lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,35 @@ export default async (ctx: Context): Promise<FastifyInstance<Server, IncomingMes
}
});

// Get build info
server.get('/build/info', opts, async (request, reply) => {
let replyCode: number;
let replyBody: Record<string, any>;

try {
if (ctx.build && ctx.build.id) {
const buildInfo = ctx.build;
const data = {
buildId: buildInfo.id,
buildName: buildInfo.name,
baseline: buildInfo.baseline,
projectToken: ctx.env.PROJECT_TOKEN || '',
}
replyCode = 200;
replyBody = { data: data };
} else {
throw new Error('Build information is not available');
}
} catch (error: any) {
ctx.log.debug(`build info failed; ${error}`);
replyCode = 500;
replyBody = { error: { message: error.message } };
}

return reply.code(replyCode).send(replyBody);

});

// Use the helper function to find and start server on available port
if (ctx.sourceCommand && ctx.sourceCommand === 'exec-start') {

Expand Down