Skip to content

Commit 51c9a78

Browse files
committed
fix: no more release branch of hello-world templates
1 parent 40638d9 commit 51c9a78

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

core/tns/tns.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from core.osutils.os_type import OSType
1212
from core.osutils.process import Process
1313
from core.settings.settings import COMMAND_TIMEOUT, TNS_PATH, TAG, TEST_RUN_HOME, CURRENT_OS, \
14-
SUT_FOLDER, PROVISIONING
14+
SUT_FOLDER, PROVISIONING, BRANCH
1515
from core.tns.tns_platform_type import Platform
1616
from core.tns.tns_verifications import TnsAsserts
1717
from core.xcode.xcode import Xcode
@@ -178,7 +178,10 @@ def create_app(app_name, attributes={}, log_trace=False, assert_success=True, up
178178
attributes_to_string = "".join("{0} {1}".format(k, v))
179179
attr = {}
180180
if not any(s in attributes_to_string for s in ("--ng", "--template", "--tsc")):
181-
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world.tgz"}
181+
if BRANCH is "master":
182+
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world.tgz"}
183+
else:
184+
attr = {"--template": "tns-template-hello-world"}
182185
attr.update(attributes)
183186
if app_name is None:
184187
output = Tns.run_tns_command("create ", attributes=attr, log_trace=log_trace)
@@ -202,7 +205,10 @@ def create_app_ts(app_name, attributes={}, log_trace=False, assert_success=True,
202205
:param update_modules: If true update modules (branch is respected).
203206
:return: output of `tns create command`
204207
"""
205-
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world-ts.tgz"}
208+
if BRANCH is "master":
209+
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world-ts.tgz"}
210+
else:
211+
attr = {"--template": "tns-template-hello-world-ts"}
206212
attributes.update(attr)
207213
output = Tns.create_app(app_name=app_name, attributes=attributes, log_trace=log_trace,
208214
assert_success=assert_success,
@@ -218,7 +224,10 @@ def create_app_ng(app_name, attributes={}, log_trace=False, assert_success=True,
218224
template = "tns-template-hello-world-ng@" + template_version
219225
attr = {"--template": template}
220226
else:
221-
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world-ng.tgz"}
227+
if BRANCH is "master":
228+
attr = {"--template": SUT_FOLDER + os.path.sep + "tns-template-hello-world-ng.tgz"}
229+
else:
230+
attr = {"--template": "tns-template-hello-world-ng"}
222231
attributes.update(attr)
223232
output = Tns.create_app(app_name=app_name, attributes=attributes, log_trace=log_trace,
224233
assert_success=assert_success,

runNose.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from core.settings.settings import OUTPUT_FOLDER, CURRENT_OS, OSType, \
1919
ANDROID_PATH, IOS_PATH, SUT_FOLDER, CLI_PATH, ANDROID_RUNTIME_PATH, \
2020
IOS_RUNTIME_PATH, TNS_MODULES_PATH, TNS_MODULES_WIDGETS_PATH, IOS_INSPECTOR_PATH, TNS_PLATFORM_DECLARATIONS_PATH, \
21-
BRANCH, SIMULATOR_NAME, SIMULATOR_TYPE, SIMULATOR_SDK, TEST_RUN_HOME
21+
SIMULATOR_NAME, SIMULATOR_TYPE, SIMULATOR_SDK, TEST_RUN_HOME
2222
from core.tns.tns import Tns
2323
from core.tns.tns_platform_type import Platform
2424
from core.xcode.xcode import Xcode
@@ -71,13 +71,13 @@ def get_repos():
7171
Clone template-hello-world repositories
7272
"""
7373
Git.clone_repo(repo_url='[email protected]:NativeScript/template-hello-world.git',
74-
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world'), branch=BRANCH)
74+
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world'))
7575
Git.clone_repo(repo_url='[email protected]:NativeScript/template-hello-world-ts.git',
76-
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world-ts'), branch=BRANCH)
76+
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world-ts'))
7777

7878
# `nativescript-angular` do not longer use release branch
7979
Git.clone_repo(repo_url='[email protected]:NativeScript/template-hello-world-ng.git',
80-
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world-ng'), branch='master')
80+
local_folder=os.path.join(SUT_FOLDER, 'template-hello-world-ng'))
8181

8282
Npm.pack(folder=os.path.join(SUT_FOLDER, 'template-hello-world'),
8383
output_file=os.path.join(SUT_FOLDER, 'tns-template-hello-world.tgz'))

tests/webpack/hello_world_ng_tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_100_android_build_release_with_and_bundle_and_uglify(self):
154154
assert 450000 < bundle_js_size < 500000, "Actual bundle_js_size is " + str(bundle_js_size)
155155
assert 30 < starter_js_size < 50, "Actual starter_js_size is " + str(starter_js_size)
156156
assert 1300000 < vendor_js_size < 1350000, "Actual vendor_js_size is " + str(vendor_js_size)
157-
assert 11000000 < apk_size < 11500000, "Actual app is " + str(apk_size)
157+
assert 11500000 < apk_size < 12000000, "Actual app is " + str(apk_size)
158158

159159
Helpers.run_android_via_adb(app_name=self.app_name, config="release", image=self.image_original)
160160

@@ -172,7 +172,7 @@ def test_100_ios_build_release_with_and_bundle_and_uglify(self):
172172
starter_js_size = File.get_size(os.path.join(app_path, "app", "starter.js"))
173173
vendor_js_size = File.get_size(os.path.join(app_path, "app", "vendor.js"))
174174
ipa_size = File.get_size(ipa_path)
175-
assert 3500 < bundle_js_size < 3750, "Actual bundle_js_size is " + str(bundle_js_size)
175+
assert 450000 < bundle_js_size < 500000, "Actual bundle_js_size is " + str(bundle_js_size)
176176
assert 30 < starter_js_size < 50, "Actual starter_js_size is " + str(starter_js_size)
177177
assert 685000 < vendor_js_size < 695000, "Actual vendor_js_size is " + str(vendor_js_size)
178178
assert 12500000 < ipa_size < 13000000, "Actual app is " + str(ipa_size)
@@ -221,7 +221,7 @@ def test_110_ios_build_release_with_and_bundle_and_snapshot(self):
221221
assert 1300000 < bundle_js_size < 1350000, "Actual bundle_js_size is " + str(bundle_js_size)
222222
assert 30 < starter_js_size < 50, "Actual starter_js_size is " + str(starter_js_size)
223223
assert 3500000 < vendor_js_size < 3600000, "Actual vendor_js_size is " + str(vendor_js_size)
224-
assert 12500000 < ipa_size < 13000000, "Actual app is " + str(ipa_size)
224+
assert 13000000 < ipa_size < 13500000, "Actual app is " + str(ipa_size)
225225

226226
def test_120_android_build_release_with_and_bundle_and_snapshot_and_uglify(self):
227227
# Workaround for https://github.com/NativeScript/nativescript-dev-webpack/issues/370
@@ -247,7 +247,7 @@ def test_120_android_build_release_with_and_bundle_and_snapshot_and_uglify(self)
247247
assert 450000 < bundle_js_size < 500000, "Actual bundle_js_size is " + str(bundle_js_size)
248248
assert 30 < starter_js_size < 50, "Actual starter_js_size is " + str(starter_js_size)
249249
assert vendor_js_size == 0, "Actual vendor_js_size is " + str(vendor_js_size)
250-
assert 12500000 < apk_size < 13500000, "Actual app is " + str(apk_size)
250+
assert 14000000 < apk_size < 15000000, "Actual app is " + str(apk_size)
251251

252252
Helpers.run_android_via_adb(app_name=self.app_name, config="release", image=self.image_original)
253253

@@ -265,8 +265,8 @@ def test_120_ios_build_release_with_and_bundle_and_snapshot_and_uglify(self):
265265
starter_js_size = File.get_size(os.path.join(app_path, "app", "starter.js"))
266266
vendor_js_size = File.get_size(os.path.join(app_path, "app", "vendor.js"))
267267
ipa_size = File.get_size(ipa_path)
268-
assert 3500 < bundle_js_size < 3750
269-
assert 30 < starter_js_size < 50
268+
assert 450000 < bundle_js_size < 500000, "Actual bundle_js_size is " + str(bundle_js_size)
269+
assert 30 < starter_js_size < 50, "Actual starter_js_size is " + str(starter_js_size)
270270
assert 680000 < vendor_js_size < 700000, "Actual vendor_js_size is " + str(vendor_js_size)
271271
assert 12500000 < ipa_size < 13000000, "Actual app is " + str(ipa_size)
272272

0 commit comments

Comments
 (0)