@@ -43,37 +43,37 @@ function run_test(payload, env = "prod", rejectUnauthorized,lt_config) {
43
43
}
44
44
if ( run_on_hyper ) {
45
45
try {
46
- await executeHyperExecuteCLI (
46
+ await executeHyperExecuteCLI (
47
47
lt_config [ "lambdatest_auth" ] [ "username" ] ,
48
48
lt_config [ "lambdatest_auth" ] [ "access_key" ] ,
49
49
"he_conv.yaml" ,
50
50
env ,
51
51
lt_config [ "run_settings" ] [ "sync" ]
52
52
) ;
53
- let jobID = getLastJobIDFromLog ( ) ;
54
- let build_id ;
55
- try {
56
- if ( jobID ) {
57
- build_id = await pollJobStatus (
58
- jobID ,
59
- lt_config [ "lambdatest_auth" ] [ "username" ] ,
60
- lt_config [ "lambdatest_auth" ] [ "access_key" ] ,
61
- env
62
- ) ;
53
+ let jobID = getLastJobIDFromLog ( lt_config ) ;
54
+ let build_id ;
55
+ try {
56
+ if ( jobID ) {
57
+ build_id = await pollJobStatus (
58
+ jobID ,
59
+ lt_config [ "lambdatest_auth" ] [ "username" ] ,
60
+ lt_config [ "lambdatest_auth" ] [ "access_key" ] ,
61
+ env
62
+ ) ;
63
+ }
64
+ } catch ( error ) {
65
+ console . log ( "could not fetch build id " , error ) ;
63
66
}
64
- } catch ( error ) {
65
- console . log ( "could not fetch build id " , error ) ;
66
- }
67
- //Write session_id to a file
68
- data = { build_id : build_id , session_id : jobID } ;
69
- fs . writeFileSync (
70
- "lambdatest_run.json" ,
71
- JSON . stringify ( data , null , 3 )
72
- ) ;
73
- console . log (
74
- `Uploaded tests successfully Check Dashboard : ${ constants . Dashboard_URL [ env ] } ${ build_id } `
75
- ) ;
76
- resolve ( { session_id : jobID , hyperexecute : true } ) ;
67
+ //Write session_id to a file
68
+ data = { build_id : build_id , session_id : jobID } ;
69
+ fs . writeFileSync (
70
+ "lambdatest_run.json" ,
71
+ JSON . stringify ( data , null , 3 )
72
+ ) ;
73
+ console . log (
74
+ `Uploaded tests successfully Check Dashboard : ${ constants . Dashboard_URL [ env ] } ${ build_id } `
75
+ ) ;
76
+ resolve ( { session_id : jobID , hyperexecute : true } ) ;
77
77
} catch ( error ) {
78
78
run_on_hyper = false ;
79
79
try {
@@ -210,7 +210,7 @@ async function executeHyperExecuteCLI(username, accessKey, yamlFile, env,sync) {
210
210
// console.log("HyperExecute CLI executed successfully");
211
211
}
212
212
213
- function getLastJobIDFromLog ( ) {
213
+ function getLastJobIDFromLog ( lt_config ) {
214
214
let lastJobID = null ;
215
215
try {
216
216
const logFilePath = path . join ( "hyperexecute-cli.log" ) ;
@@ -221,7 +221,10 @@ function getLastJobIDFromLog() {
221
221
while ( ( match = jobIDPattern . exec ( logContent ) ) !== null ) {
222
222
lastJobID = match [ 1 ] ;
223
223
}
224
- fs . unlinkSync ( logFilePath ) ; // Delete the file after reading
224
+
225
+ if ( ! lt_config . run_settings . verbose ) {
226
+ fs . unlinkSync ( logFilePath ) ; // Delete the file after reading
227
+ }
225
228
} catch ( error ) {
226
229
console . log ( "Error in reading log file " , error ) ;
227
230
throw error ;
@@ -273,8 +276,10 @@ function downloadHyperExecuteCLI(env) {
273
276
} else {
274
277
return reject ( new Error ( 'Unsupported OS type' ) ) ;
275
278
}
276
-
277
279
const filePath = path . join ( __dirname , binaryfileName ) ;
280
+ if ( fs . existsSync ( filePath ) ) {
281
+ return resolve ( filePath ) ;
282
+ }
278
283
const file = fs . createWriteStream ( filePath ) ;
279
284
280
285
https . get ( downloadUrl , ( response ) => {
0 commit comments