Skip to content

Commit 8a80b5b

Browse files
author
vhristov5555
committed
Fix perf test for creating project which are not templates
1 parent b7435bc commit 8a80b5b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/perf/cli_operations_time.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ def test_tns_commands_time(self, demo, config, platform, expected_tns_create_tim
171171
Npm.cache_clean()
172172
sleep(10)
173173
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)
176175
if "android" in platform:
177176
Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name},
178177
assert_success=False)
@@ -212,26 +211,27 @@ def test_tns_commands_time(self, demo, config, platform, expected_tns_create_tim
212211
tns_build_log = Tns.build_android(attributes=attributes, measureTime=True)
213212
else:
214213
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)
217216
actual_tns_platform_add_time += PerfBuildTests.get_time(tns_platform_add_log)
218217
actual_tns_build_time += PerfBuildTests.get_time(tns_build_log)
219218
run('rm -rf {0}'.format(self.app_name))
220219

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
222222
actual_tns_platform_add_time = actual_tns_platform_add_time / perf_loop
223223
actual_tns_build_time = actual_tns_build_time / perf_loop
224224
verification_errors = []
225225
PerfBuildTests.report_add_data(demo, config, platform, expected_tns_create_time, actual_tns_create_time,
226226
expected_tns_platform_add_time,
227227
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. " \
230230
"The expected time is {2} s.".format(demo,
231231
platform, expected_tns_create_time,
232232
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,
235235
actual=actual_tns_create_time,
236236
tolerance=20,
237237
error_message=message, verification_errors=verification_errors)

0 commit comments

Comments
 (0)