1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

fw/workload: record app version in metadata

Add the package version for an ApkWorkload to the metadata for that job.
This commit is contained in:
Sergei Trofimov 2018-05-24 14:33:44 +01:00 committed by Marc Bonnici
parent 9257a787f9
commit 79141582e9
9 changed files with 23 additions and 22 deletions

View File

@ -257,9 +257,9 @@ looking for an executable file would do so like this::
# ... # ...
def init_resources(self, context): def init_resources(self, resolver):
resource = Executable(self, self.target.abi, 'my_benchmark') resource = Executable(self, self.target.abi, 'my_benchmark')
host_exe = context.resolver.get(resource) host_exe = resolver.get(resource)
# ... # ...

View File

@ -210,8 +210,8 @@ workload and will look something like this
super(GoogleDocs, self).__init__(target, **kwargs) super(GoogleDocs, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(GoogleDocs, self).init_resources(context) super(GoogleDocs, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -19,8 +19,8 @@ class ${class_name}(ApkWorkload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -19,8 +19,8 @@ class ${class_name}(ApkReventWorkload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -19,8 +19,8 @@ class ${class_name}(ApkUiautoWorkload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -17,8 +17,8 @@ class ${class_name}(Workload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -17,8 +17,8 @@ class ${class_name}(ReventWorkload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -19,8 +19,8 @@ class ${class_name}(UiautoWorkload):
super(${class_name}, self).__init__(target, **kwargs) super(${class_name}, self).__init__(target, **kwargs)
# Define any additional attributes required for the workload # Define any additional attributes required for the workload
def init_resources(self, context): def init_resources(self, resolver):
super(${class_name}, self).init_resources(context) super(${class_name}, self).init_resources(resolver)
# This method may be used to perform early resource discovery and # This method may be used to perform early resource discovery and
# initialization. This is invoked during the initial loading stage and # initialization. This is invoked during the initial loading stage and
# before the device is ready, so cannot be used for any device-dependent # before the device is ready, so cannot be used for any device-dependent

View File

@ -279,9 +279,9 @@ class ApkUIWorkload(ApkWorkload):
super(ApkUIWorkload, self).__init__(target, **kwargs) super(ApkUIWorkload, self).__init__(target, **kwargs)
self.gui = None self.gui = None
def init_resources(self, context): def init_resources(self, resolver):
super(ApkUIWorkload, self).init_resources(context) super(ApkUIWorkload, self).init_resources(resolver)
self.gui.init_resources(context.resolver) self.gui.init_resources(resolver)
@once_per_instance @once_per_instance
def initialize(self, context): def initialize(self, context):
@ -360,9 +360,9 @@ class UIWorkload(Workload):
super(UIWorkload, self).__init__(target, **kwargs) super(UIWorkload, self).__init__(target, **kwargs)
self.gui = None self.gui = None
def init_resources(self, context): def init_resources(self, resolver):
super(UIWorkload, self).init_resources(context) super(UIWorkload, self).init_resources(resolver)
self.gui.init_resources(context.resolver) self.gui.init_resources(resolver)
@once_per_instance @once_per_instance
def initialize(self, context): def initialize(self, context):
@ -648,6 +648,7 @@ class PackageHandler(object):
self.resolve_package(context) self.resolve_package(context)
def setup(self, context): def setup(self, context):
context.update_metadata('app_version', self.apk_info.version_name)
self.initialize_package(context) self.initialize_package(context)
self.start_activity() self.start_activity()
self.target.execute('am kill-all') # kill all *background* activities self.target.execute('am kill-all') # kill all *background* activities