@@ -130,8 +130,8 @@ def run_integration_test(self, plugin_name, directory, timeout):
130
130
])
131
131
132
132
133
- class EphemeralTarget (Target ):
134
- """A Tizen emulator that launches/poweroffs itself during test ."""
133
+ class TemporaryEmulator (Target ):
134
+ """A Tizen emulator that is created temporary by the tool for testing purposes ."""
135
135
136
136
def __init__ (self , name , platform ):
137
137
super ().__init__ (name , platform )
@@ -289,31 +289,31 @@ def _parse_target_info(self, capability_info):
289
289
return device_profile , tizen_version
290
290
291
291
292
- class EphemeralTargetManager (TargetManager ):
293
- """A TargetManager for EphemeralTargets ."""
292
+ class TemporaryEmulatorManager (TargetManager ):
293
+ """A TargetManager for TemporaryEmulators ."""
294
294
295
295
def __init__ (self , platforms ):
296
296
super ().__init__ ()
297
297
self .platforms = platforms
298
298
299
299
def __enter__ (self ):
300
300
for platform in self .platforms :
301
- self ._create_ephemeral_target (platform )
301
+ self ._create_emulator (platform )
302
302
return self
303
303
304
304
def __exit__ (self , exc_type , exc_value , traceback ):
305
- self ._delete_ephemeral_targets ()
305
+ self ._delete_emulators ()
306
306
super ().__exit__ (exc_type , exc_value , traceback )
307
307
308
- def _create_ephemeral_target (self , platform ):
308
+ def _create_emulator (self , platform ):
309
309
device_profile , tizen_version = platform .split ('-' , 1 )
310
310
# Target name valid characters are [A-Za-z0-9-_].
311
- target_name = f'{ device_profile } -{ tizen_version .replace ("." , "_" )} -{ os .getpid ()} '
312
- target = EphemeralTarget ( target_name , platform )
313
- target .create ()
314
- self .targets_per_platform [platform ].append (target )
311
+ emulator_name = f'{ device_profile } -{ tizen_version .replace ("." , "_" )} -{ os .getpid ()} '
312
+ emulator = TemporaryEmulator ( emulator_name , platform )
313
+ emulator .create ()
314
+ self .targets_per_platform [platform ].append (emulator )
315
315
316
- def _delete_ephemeral_targets (self ):
316
+ def _delete_emulators (self ):
317
317
for targets in self .targets_per_platform .values ():
318
318
for target in targets :
319
319
target .delete ()
@@ -384,23 +384,23 @@ def set_subparser(subparsers):
384
384
c: [wearable-4.0]
385
385
)''' )
386
386
parser .add_argument (
387
- '--use-ephemeral-targets ' ,
387
+ '--generate-emulators ' ,
388
388
default = False ,
389
389
action = 'store_true' ,
390
- help = '''Create and destroy ephemeral targets during test.
391
- Must provide --platforms or --recipe option to specify which
392
- platform targets to create.''' )
390
+ help = '''Create and destroy emulators during test.
391
+ Must provide either --platforms or --recipe option to specify which
392
+ platforms to create.''' )
393
393
parser .set_defaults (func = run_integration_test )
394
394
395
395
396
- def _get_target_manager (use_ephemeral_targets , platforms ):
397
- if use_ephemeral_targets :
398
- return EphemeralTargetManager (platforms )
396
+ def _get_target_manager (generate_emulators , platforms ):
397
+ if generate_emulators :
398
+ return TemporaryEmulatorManager (platforms )
399
399
else :
400
400
return TargetManager ()
401
401
402
402
403
- def _integration_test (plugin_dir , platforms , timeout , use_ephemeral_targets ):
403
+ def _integration_test (plugin_dir , platforms , timeout , generate_emulators ):
404
404
"""Runs integration test in the example package for plugin_dir
405
405
406
406
Currently the tools assumes that there's only one example package per plugin.
@@ -409,7 +409,7 @@ def _integration_test(plugin_dir, platforms, timeout, use_ephemeral_targets):
409
409
plugin_dir (str): The path to a single plugin directory.
410
410
platforms (List[str]): A list of testing platforms.
411
411
timeout (int): Time limit in seconds before cancelling the test.
412
- use_ephemeral_targets (bool): Whether to create and delete targets
412
+ generate_emulators (bool): Whether to create and delete targets
413
413
for test.
414
414
415
415
Returns:
@@ -450,7 +450,7 @@ def _integration_test(plugin_dir, platforms, timeout, use_ephemeral_targets):
450
450
451
451
try :
452
452
with _get_target_manager (
453
- use_ephemeral_targets ,
453
+ generate_emulators ,
454
454
platforms ,
455
455
) as target_manager :
456
456
if not platforms :
@@ -521,9 +521,9 @@ def run_integration_test(args):
521
521
)
522
522
exit (1 )
523
523
524
- if args .use_ephemeral_targets and not args .platforms and not args .recipe :
524
+ if args .generate_emulators and not args .platforms and not args .recipe :
525
525
print (
526
- '--use-ephemeral-targets option must be used with either --platforms or --recipe option.'
526
+ '--generate-emulators option must be used with either --platforms or --recipe option.'
527
527
)
528
528
exit (1 )
529
529
@@ -552,7 +552,7 @@ def run_integration_test(args):
552
552
os .path .join (packages_dir , testing_plugin ),
553
553
platforms ,
554
554
args .timeout ,
555
- args .use_ephemeral_targets ,
555
+ args .generate_emulators ,
556
556
))
557
557
558
558
print (f'============= TEST RESULT =============' )
0 commit comments