Skip to content

Commit 8b49930

Browse files
committed
remove commented code
1 parent 1c3990e commit 8b49930

File tree

6 files changed

+15
-83
lines changed

6 files changed

+15
-83
lines changed

commands/init.js

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const { config } = require('yargs');
55
const constants = require('./utils/constants.js')
66

77
function create_file(file_path, content) {
8-
// console.log("creating file at - ", file_path);
9-
// console.log("file content - ", content);
108
fs.writeFileSync(file_path, content, function (err) {
119
if (err) throw err;
1210
console.log('Saved at ',file_path);
@@ -49,18 +47,6 @@ function create_ltconfig_file(args) {
4947
}
5048
};
5149

52-
// function create_base_reporter_config_file(args) {
53-
// let config = require('./utils/default_reporter_config.js')
54-
// let content = JSON.stringify(config, null, 3);
55-
// console.log("len ", args._.length);
56-
// if (args._.length == 1) {
57-
// console.log("creating file");
58-
// create_file(constants.LT_BASE_REPORTER_CONFIG_FILE_NAME, content)
59-
// }else{
60-
// console.log("ELSE");
61-
// }
62-
// };
63-
6450
function create_custom_support_file(args){
6551
const pathToFile = path.join(__dirname, "default_custom_support_file.js");
6652
const pathToNewDestination = constants.LT_BASE_CUSTOM_SUPPORT_FILE_NAME;
@@ -78,68 +64,21 @@ function create_base_reporter_config_file(args) {
7864
let config = require('./utils/default_reporter_config.js')
7965
let content = JSON.stringify(config, null, 3);
8066

81-
console.log("content - ", content);
82-
console.log("len ", args._.length);
8367
if (args._.length == 1) {
84-
console.log("creating file");
8568
create_file(constants.LT_BASE_REPORTER_CONFIG_FILE_NAME, content)
86-
}else{
87-
console.log("ELSE");
8869
}
8970
};
9071

9172
function init_implementation(args){
92-
console.log("args - ", args);
93-
// process.exit(1);
94-
// create_ltconfig_file(args);
73+
create_ltconfig_file(args);
9574
create_base_reporter_config_file(args);
9675
if ("cv" in args){
9776
if (parseInt(args["cv"])>=10){
9877
create_custom_support_file(args);
9978
}
10079
}
10180
};
102-
// module.exports = function (args) {
10381
module.exports = {
104-
create_base_reporter_config_file,init_implementation
105-
// this.create_base_reporter_config_file = function (args) {
106-
// let config = require('./utils/default_reporter_config.js')
107-
// let content = JSON.stringify(config, null, 3);
108-
// console.log("len ", args._.length);
109-
// if (args._.length == 1) {
110-
// console.log("creating file");
111-
// create_file(constants.LT_BASE_REPORTER_CONFIG_FILE_NAME, content)
112-
// }else{
113-
// console.log("ELSE");
114-
// }
115-
// };
116-
117-
118-
// create_base_reporter_config_file: create_base_reporter_config_file,
119-
// create_base_reporter_config_file: function (args) {
120-
// let config = require('./utils/default_reporter_config.js')
121-
// let content = JSON.stringify(config, null, 3);
122-
// console.log("len ", args._.length);
123-
// if (args._.length == 1) {
124-
// console.log("creating file");
125-
// create_file(constants.LT_BASE_REPORTER_CONFIG_FILE_NAME, content)
126-
// }else{
127-
// console.log("ELSE");
128-
// }
129-
// },
130-
131-
132-
133-
134-
135-
136-
// console.log("args - ", args);
137-
// // process.exit(1);
138-
// // create_ltconfig_file(args);
139-
// create_base_reporter_config_file(args);
140-
// if ("cv" in args){
141-
// if (parseInt(args["cv"])>=10){
142-
// create_custom_support_file(args);
143-
// }
144-
// }
82+
create_base_reporter_config_file:create_base_reporter_config_file,
83+
init_implementation:init_implementation,
14584
};

commands/utils/constants.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ module.exports = {
2727
"https://api.lambdatest.com/automation/api/v1/cypress/artefacts/test/",
2828
},
2929
beta: {
30-
INTEGRATION_BASE_URL: "https://api-envrn-dev.lambdatestinternal.com/liis",
30+
INTEGRATION_BASE_URL: "https://api-envi-dev.lambdatestinternal.com/liis",
3131
BUILD_BASE_URL:
32-
"https://api-envrn-dev.lambdatestinternal.com/automation/api/v1/builds/",
32+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/builds/",
3333
BUILD_STOP_URL:
34-
"https://api-envrn-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
34+
"https://api-envi-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
3535
SESSION_URL:
36-
"https://api-envrn-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
36+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
3737
REPORT_URL:
38-
"https://api-envrn-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
38+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
3939
},
4040

4141
stage: {

commands/utils/default_reporter_config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ module.exports = {
55
"overwrite": true,
66
"html": true,
77
"json": true
8-
}
9-
};
8+
}
9+
}

commands/utils/set_args.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,10 @@ function sync_args_from_cmd(args) {
240240
"Warning !! Value of reporter_config_file parameter missing. Proceeding with default reporter config"
241241
);
242242
// make sure that the default file exists on user system. If not, place it. There is a possibility that
243-
// user may have delete it from his system.
243+
// user may have deleted it from her system/or not ran init command.
244244
if (!fs.existsSync(lt_config["run_settings"]["reporter_config_file"])) {
245245
console.log("!! Warning, Creating the default reporter config file");
246246
init_commands.create_base_reporter_config_file(args);
247-
// process.exit(1);
248247

249248
}
250249
lt_config["run_settings"]["reporter_config_file"] =

commands/utils/validate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const semverCompare = require("semver/functions/compare");
44

55
const constants = require("./constants.js");
66
module.exports = validate_config = function (lt_config, validation_configs) {
7-
console.log("validating config");
7+
console.log("Validating lambdatest config");
88
return new Promise(function (resolve, reject) {
99
//validate auth keys are present
1010
if (
@@ -251,9 +251,9 @@ module.exports = validate_config = function (lt_config, validation_configs) {
251251
);
252252
}
253253
}
254-
} catch {
254+
} catch(e) {
255255
console.log(
256-
"reporter_config_file could not be parsed, please provide a valid json in Reporter Config"
256+
"reporter_config_file could not be parsed, please provide a valid json in Reporter Config - ", e
257257
);
258258
reject("Error!! Reporter JSON File does not have correct json");
259259
}

index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/usr/bin/env node
22

3-
// const { init } = require("./commands/init");
4-
const { init_implementation } = require("./commands/init.js");
5-
6-
console.log("init_implementation -> ", init_implementation);
73
const argv = require("yargs")
84
.usage("Usage: $0 <command> [options]")
95
.command(
@@ -23,9 +19,7 @@ const argv = require("yargs")
2319
});
2420
},
2521
function (argv) {
26-
// init.init_implementation(argv);
27-
init_implementation(argv);
28-
// require("./commands/init")(argv);
22+
require("./commands/init").init_implementation(argv);
2923
}
3024
)
3125
.command(

0 commit comments

Comments
 (0)