mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
framework/workload: Add check for platform
Remove unused ``platform`` attributes and add ``supported_platforms`` along with check so that workloads can fail early when attempting to run on an incorrect platform.
This commit is contained in:
parent
60b37995e0
commit
1648a58c11
@ -73,6 +73,12 @@ class Workload(TargetedPlugin):
|
||||
self.asset_files = []
|
||||
self.deployed_assets = []
|
||||
|
||||
supported_platforms = getattr(self, 'supported_platforms', [])
|
||||
if supported_platforms and self.target.os not in supported_platforms:
|
||||
msg = 'Supported platforms for "{}" are "{}", attemping to run on "{}"'
|
||||
raise WorkloadError(msg.format(self.name, ' '.join(self.supported_platforms),
|
||||
self.target.os))
|
||||
|
||||
def init_resources(self, resolver):
|
||||
"""
|
||||
This method may be used to perform early resource discovery and
|
||||
@ -165,6 +171,8 @@ class Workload(TargetedPlugin):
|
||||
|
||||
class ApkWorkload(Workload):
|
||||
|
||||
supported_platforms = ['android']
|
||||
|
||||
# May be optionally overwritten by subclasses
|
||||
# Times are in seconds
|
||||
loading_time = 10
|
||||
@ -326,8 +334,6 @@ class ApkUIWorkload(ApkWorkload):
|
||||
|
||||
class ApkUiautoWorkload(ApkUIWorkload):
|
||||
|
||||
platform = 'android'
|
||||
|
||||
parameters = [
|
||||
Parameter('markers_enabled', kind=bool, default=False,
|
||||
description="""
|
||||
@ -407,7 +413,7 @@ class UIWorkload(Workload):
|
||||
|
||||
class UiautoWorkload(UIWorkload):
|
||||
|
||||
platform = 'android'
|
||||
supported_platforms = ['android']
|
||||
|
||||
parameters = [
|
||||
Parameter('markers_enabled', kind=bool, default=False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user