@@ -171,8 +171,7 @@ def test_tns_commands_time(self, demo, config, platform, expected_tns_create_tim
171
171
Npm .cache_clean ()
172
172
sleep (10 )
173
173
Folder .cleanup (self .app_name )
174
- tns_create_log = Tns .create_app (self .app_name , attributes = {"--template" : "https://github.com/" + demo },
175
- measureTime = True )
174
+ Git .clone_repo (repo_url = "https://github.com/" + demo , local_folder = self .app_name )
176
175
if "android" in platform :
177
176
Tns .platform_remove (platform = Platform .ANDROID , attributes = {"--path" : self .app_name },
178
177
assert_success = False )
@@ -212,26 +211,27 @@ def test_tns_commands_time(self, demo, config, platform, expected_tns_create_tim
212
211
tns_build_log = Tns .build_android (attributes = attributes , measureTime = True )
213
212
else :
214
213
tns_build_log = Tns .build_ios (attributes = attributes , measureTime = True )
215
-
216
- actual_tns_create_time += PerfBuildTests .get_time (tns_create_log )
214
+ if tns_create_log :
215
+ actual_tns_create_time += PerfBuildTests .get_time (tns_create_log )
217
216
actual_tns_platform_add_time += PerfBuildTests .get_time (tns_platform_add_log )
218
217
actual_tns_build_time += PerfBuildTests .get_time (tns_build_log )
219
218
run ('rm -rf {0}' .format (self .app_name ))
220
219
221
- actual_tns_create_time = actual_tns_create_time / perf_loop
220
+ if actual_tns_create_time != 0.0 :
221
+ actual_tns_create_time = actual_tns_create_time / perf_loop
222
222
actual_tns_platform_add_time = actual_tns_platform_add_time / perf_loop
223
223
actual_tns_build_time = actual_tns_build_time / perf_loop
224
224
verification_errors = []
225
225
PerfBuildTests .report_add_data (demo , config , platform , expected_tns_create_time , actual_tns_create_time ,
226
226
expected_tns_platform_add_time ,
227
227
actual_tns_platform_add_time , expected_tns_build_time , actual_tns_build_time )
228
-
229
- message = "Tns create project command for platform {1} for {0} with {4} configuration is {3} s. " \
228
+ if actual_tns_create_time != 0.0 :
229
+ message = "Tns create project command for platform {1} for {0} with {4} configuration is {3} s. " \
230
230
"The expected time is {2} s." .format (demo ,
231
231
platform , expected_tns_create_time ,
232
232
actual_tns_create_time , config )
233
-
234
- verification_errors = PerfBuildTests .assert_time (expected = expected_tns_create_time ,
233
+ if actual_tns_create_time != 0.0 :
234
+ verification_errors = PerfBuildTests .assert_time (expected = expected_tns_create_time ,
235
235
actual = actual_tns_create_time ,
236
236
tolerance = 20 ,
237
237
error_message = message , verification_errors = verification_errors )
0 commit comments