Skip to content

Release 3 Sep #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 3, 2023
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
4 changes: 2 additions & 2 deletions commands/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module.exports = {
DEFAULT_TEST_PATH: ".",
LAMBDA_CONFIG: "./lambdatest-config.json",
SUPPORTED_CYPRESS_VERSIONS: ["5", "6"],
WHITELISTED_ENV_VARS: ["CI_BUILD_ID", "PERCY_TOKEN"],
WHITELISTED_ENV_VARS: ["CI_BUILD_ID", "PERCY_TOKEN", "QASE_REPORT", "QASE_RUN_ID", "QASE_RUN_NAME", "QASE_RUN_DESCRIPTION", "QASE_API_TOKEN", "QASE_API_BASE_URL", "QASE_ENVIRONMENT_ID", "QASE_SCREENSHOT_FOLDER", "QASE_SCREENSHOT_SENDING", "QASE_RUN_COMPLETE"],
BUILD_END_STATES:
"&status=running,queued,created,initiated,pqueued,error,lambda error,failed",
"&status=running,queued,created,initiated,pqueued,error,lambda error,failed,completed,queue_timeout,idle_timeout,stopped,cancelled,passed,timeout,inactive",
BUILD_ERROR_STATES: "&status=error,lambda error,failed",
CYPRESS_ENV_FILE_PATH: "cypress.env.json",
ENVS: ["stage", "beta", "prod", "preprod", "stage_new"],
Expand Down
30 changes: 30 additions & 0 deletions commands/utils/poller/build_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const constants = require("../constants");
const request = require("request");
const builds = require("./build");
//const poller=require("./poller.js")
var get_build_info_count = 0;

function get_completed_build_info(lt_config, session_id, env) {
let options = {
Expand Down Expand Up @@ -66,6 +67,14 @@ function get_build_info(lt_config, session_id, env, update_status, callback) {
error: 0,
"lambda error": 0,
failed: 0,
completed: 0,
queue_timeout : 0,
idle_timeout : 0,
stopped : 0,
cancelled : 0,
passed : 0,
timeout : 0,
inactive : 0,
};
let build_info = JSON.parse(body);
if (build_info.Meta.result_set.count > 0) {
Expand All @@ -81,6 +90,27 @@ function get_build_info(lt_config, session_id, env, update_status, callback) {
statsNew["pqueued"] ==
0
) {
if (
statsNew["error"] +
statsNew["lambda error"] +
statsNew["failed"] +
statsNew["completed"] +
statsNew["queue_timeout"] +
statsNew["idle_timeout"] +
statsNew["stopped"] +
statsNew["cancelled"] +
statsNew["passed"] +
statsNew["timeout"] +
statsNew["inactive"] ==
0
) {
get_build_info_count = get_build_info_count + 1;
if (get_build_info_count > 4) {
update_status(false);
return callback(null, JSON.parse(body));
}
return setTimeout(callback, 5000, null);
}
update_status(false);
return callback(null, JSON.parse(body));
}
Expand Down
5 changes: 5 additions & 0 deletions commands/utils/poller/poller.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function poll_build(lt_config, session_id, env) {
build_stats
.get_completed_build_info(lt_config, session_id, env)
.then(function (build_info) {
if (!build_info || build_info.data == null) {
console.log("Build info not found");
resolve(1);
return;
}
let stats = {};
let status = [];
for (i = 0; i < build_info["data"].length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambdatest-cypress-cli",
"version": "3.0.17",
"version": "3.0.18",
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
"author": "LambdaTest <[email protected]>",
Expand Down