mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 07:04:17 +00: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:
		
				
					committed by
					
						 Marc Bonnici
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							9257a787f9
						
					
				
				
					commit
					79141582e9
				
			| @@ -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') | ||||
|             host_exe = context.resolver.get(resource) | ||||
|             host_exe = resolver.get(resource) | ||||
|  | ||||
|         # ... | ||||
|  | ||||
|   | ||||
| @@ -210,8 +210,8 @@ workload and will look something like this | ||||
|              super(GoogleDocs, self).__init__(target, **kwargs) | ||||
|              # Define any additional attributes required for the workload | ||||
|  | ||||
|             def init_resources(self, context): | ||||
|              super(GoogleDocs, self).init_resources(context) | ||||
|             def init_resources(self, resolver): | ||||
|              super(GoogleDocs, self).init_resources(resolver) | ||||
|              # This method may be used to perform early resource discovery and | ||||
|              # initialization. This is invoked during the initial loading stage and | ||||
|              # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -19,8 +19,8 @@ class ${class_name}(ApkWorkload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -19,8 +19,8 @@ class ${class_name}(ApkReventWorkload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -19,8 +19,8 @@ class ${class_name}(ApkUiautoWorkload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -17,8 +17,8 @@ class ${class_name}(Workload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -17,8 +17,8 @@ class ${class_name}(ReventWorkload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -19,8 +19,8 @@ class ${class_name}(UiautoWorkload): | ||||
|         super(${class_name}, self).__init__(target, **kwargs) | ||||
|         # Define any additional attributes required for the workload | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(${class_name}, self).init_resources(context) | ||||
|     def init_resources(self, resolver): | ||||
|         super(${class_name}, self).init_resources(resolver) | ||||
|         # This method may be used to perform early resource discovery and | ||||
|         # initialization. This is invoked during the initial loading stage and | ||||
|         # before the device is ready, so cannot be used for any device-dependent | ||||
|   | ||||
| @@ -279,9 +279,9 @@ class ApkUIWorkload(ApkWorkload): | ||||
|         super(ApkUIWorkload, self).__init__(target, **kwargs) | ||||
|         self.gui = None | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(ApkUIWorkload, self).init_resources(context) | ||||
|         self.gui.init_resources(context.resolver) | ||||
|     def init_resources(self, resolver): | ||||
|         super(ApkUIWorkload, self).init_resources(resolver) | ||||
|         self.gui.init_resources(resolver) | ||||
|  | ||||
|     @once_per_instance | ||||
|     def initialize(self, context): | ||||
| @@ -360,9 +360,9 @@ class UIWorkload(Workload): | ||||
|         super(UIWorkload, self).__init__(target, **kwargs) | ||||
|         self.gui = None | ||||
|  | ||||
|     def init_resources(self, context): | ||||
|         super(UIWorkload, self).init_resources(context) | ||||
|         self.gui.init_resources(context.resolver) | ||||
|     def init_resources(self, resolver): | ||||
|         super(UIWorkload, self).init_resources(resolver) | ||||
|         self.gui.init_resources(resolver) | ||||
|  | ||||
|     @once_per_instance | ||||
|     def initialize(self, context): | ||||
| @@ -648,6 +648,7 @@ class PackageHandler(object): | ||||
|         self.resolve_package(context) | ||||
|  | ||||
|     def setup(self, context): | ||||
|         context.update_metadata('app_version', self.apk_info.version_name) | ||||
|         self.initialize_package(context) | ||||
|         self.start_activity() | ||||
|         self.target.execute('am kill-all')  # kill all *background* activities | ||||
|   | ||||
		Reference in New Issue
	
	Block a user