1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00
Commit Graph

48 Commits

Author SHA1 Message Date
Marc Bonnici
346ce2fb15 framework/workload: Fix typo and formatting 2017-12-14 09:50:26 +00:00
Marc Bonnici
6df498b4bd framework/workload: Fix path of deployed asset
Get pushed file basename to ensure the assets deployed path is correct.
2017-12-14 08:15:39 +00:00
Brendan Jackman
feabecd19d framework/workload: Calm pylint 2017-12-07 15:37:49 +00:00
Brendan Jackman
69f52f3359 framework/workload: Remove unused imports 2017-12-07 15:37:49 +00:00
Brendan Jackman
aa2abd16a3 Run autoflake to remove unused imports & variables 2017-12-07 15:37:49 +00:00
Marc Bonnici
698c61b0a5 framework/workload: Adds support for gui only workloads
Adds new workload types to allow for using a gui without requiring an
apk file.
2017-11-30 17:17:18 +00:00
Marc Bonnici
0f28a07476 framework/workload: Rename ReventWorkload to ApkReventWorkload
To reflect that the current implementation of ReventWorkload uses an APK
file on the device the name has been changed appropriately and the
relevant workloads have been updated.
2017-11-30 17:17:18 +00:00
Marc Bonnici
ac5741136d Framework/Workload: Fix super propagation.
Previously super calls were not being propagated correctly so either
call the relevant super or remove the empty methods.
2017-11-28 08:12:31 +00:00
Marc Bonnici
74347b9e67 Framework/Workload: Change condition for pushing assets
Changes from checking if there are deployable assets to checking for
discovered assets. This allows for automated pushing of assets without
invoking the resource getters, for example pre discovered files.
2017-11-28 08:12:31 +00:00
Marc Bonnici
30da77a1cf Framework: Moved resource deployment to base workload 2017-11-28 08:12:31 +00:00
Marc Bonnici
2611579d29 Framework/Workload: Fix typo 2017-11-23 17:49:30 +00:00
Marc Bonnici
e9ae08e00b Framework/Workload: Utilize package_names during package resolution
Iterate through available package names when resolving an apk file from
the host.
2017-11-23 17:49:30 +00:00
Marc Bonnici
ff529462e0 Framework/Workload: Require package name for package resolution
Mandate that either a package name is specified or the owner defines
supported package names. This prevents any apk file in the correct
location incorrectly being resolved.
2017-11-23 17:49:30 +00:00
Sergei Trofimov
49eb40fec7 framework/workload: add markers_enabled param for uiauto workloads
Some workloads can insert timestamped markers into the logs if this
parameter is enabled in their automation. These markers can then be
used to look at measurements for specific parts of the execution.
2017-11-22 09:22:21 +00:00
Sergei Trofimov
73a530917a framework/workload: fix asset_files and deployed_assets
These two lists are updated by workloads as assets are discovered and
deployed. As these are defined as class attributes in the base Workload
class, the same two list instances are shared between all classes. This
results in subsequent workloads re-deploying assets from the previous
workloads, and may lead to mismatches with deployable_assets, which is
overwritten on per-workload basis.

Make these into instance attriutes to prevent these issues.
2017-11-22 09:22:21 +00:00
Sergei Trofimov
652f107d10 framework/workload: fix class attribute docs
Change from free-floating strings into comments and move above the
corresponding attribute.
2017-11-22 09:22:21 +00:00
Marc Bonnici
8a913639bd Framework/Workload: Fix call to deploy assets 2017-11-15 15:59:27 +00:00
Marc Bonnici
d3a2242dd3 Framework/Workload: Fix incorrect error message being reported 2017-11-15 14:47:36 +00:00
Marc Bonnici
4e3a30b515 AndroidTarget: Ensure permissions are granted for installed application
Upon clearing data of a previously installed application the runtime
permissions can also be cleared, to avoid having to reinstall the
application all available permissions are explicitly granted to the
required application.
2017-11-15 14:47:36 +00:00
Marc Bonnici
c332715e4a Workload: Adds support for deploying/cleanup of additional assets
Allows for automatically pushing a set of arbitrary assets to the device
during initialization and adds a parameter to specify whether the assets should
be removed again at the end of the run.
2017-11-15 14:47:36 +00:00
Brendan Jackman
71815e4e1c framework/workload: Implement Workload.requires_network attribute 2017-10-18 11:50:29 +01:00
Brendan Jackman
06b451d31b framework: Add feature to mark workloads unsafe for confidential devices
Some workloads, such as Geekbench, may phone home and report data about the
device they are running on. This poses a risk for users that are testing on
unreleased or otherwise confidential devices - perhaps they use a standard
agenda to run a large battery of tests, in which case they may forget to disable
these dangerous workloads.

This provides a mechanism to prevent running those workloads from running by
setting allow_phone_home=False in the user configuration.
2017-10-04 15:43:03 +01:00
Sergei Trofimov
9cb7ea862c framework/workload: default view for ApkWorkload
- Add "activity" property to PackageManager exposing the underlying
  apk_info attribute.
- Add "view" class attribute to ApkWorkload, initialized to None
- If "view" is not set for a particular workload, set a default based on
  the package and activity of the underlying workload.
2017-09-29 14:22:22 +01:00
Sergei Trofimov
0934037e1b revent fixes
- do not attempt to replay setup if a setup recording has not been
  provided (perviously, setup was mandatory).
- update the apk initialization to the correct method inside the record
  command.
2017-09-27 10:32:41 +01:00
Sergei Trofimov
fe53efcd49 framework/workload: ApkWorkload consistent package handling
Rename "package" parameter to "package_name" (to be cosnsitent with
package_names class attribute). "package" is now a property containting
the name of the actual package used after the APK is resolved.
2017-09-27 10:32:20 +01:00
Brendan Jackman
a79fb83fd1 framework/workload: Fix resolve_packge_from_target
This currently raises an error undonditionally when self.package is set, fix the
indentation so it only does that if it isn't installed on the target.
2017-09-15 18:04:11 +01:00
Marc Bonnici
f8e4d34e60 APKResolution: Uses loose version matching
Allows for more flexible version matching  e.g. specifying a
version of 4, 4.3, 4.3.1 will all resolve to an apk version of 4.3.1
2017-07-20 14:30:52 +01:00
Marc Bonnici
c722a6a73c ApkResolution: Now takes into account apk abi when resolving.
Previously any apk found would be selected even if the abi did not match
the device, now an apk is only selected if it is compatible with the
device. Additionally the 'exact_abi' parameter has been added to allow only
selecting an apk if a devices primary abi's native code is present in
the apk, or there is no native code.
2017-07-20 14:30:52 +01:00
Marc Bonnici
f9bc0261bf AndroidWorkload: Adds support for apk replacement/downgrading
Now tries to replace and downgrade an apk if already installed.
2017-07-10 11:08:44 +01:00
Marc Bonnici
4d397ab465 AndroidWorkload: Uninstall uiauto apks before reinstalling
Due to the fact that uiauto apk files built on different machines will
be signed with different keys, adb will fail to overwrite a previous
version even when set to replace. This commit now will uninstall the
previous uiauto apk file if present before attempting to install the new
version.
2017-07-10 11:08:43 +01:00
Marc Bonnici
27b488cc56 Jobs: Fixes job initialize/finalize
Previously initialize and finalize were being called for each iteration
of each workload at the start/end of the run which is incorrect
behaviour. To prevent this, each iteration of a workload now shares a
single instance of the workload combined with the 'once_per_instance' decorator
to ensure that the methods are only invoked once per set of workload
runs.
2017-07-10 11:08:43 +01:00
Marc Bonnici
5232bc3504 Workload: Move gui deployment into setup
Ensures that the correct workload gui is deployed before each iteration.
2017-07-10 11:08:43 +01:00
Marc Bonnici
0b245ac2c8 Workload: Move package initialization into setup
To support runs that require different versions of an application
the discovery/installation process should be performed at the beginning
of each iteration and therefore has been moved into setup.
2017-07-10 11:08:43 +01:00
Marc Bonnici
0317604481 Workload: Moved uiauto command initialization to setup
In order to be able to pass the package name of the app under test to
the instrumented test, the generation of the uiautomator commands needed
to be postponed until after the apk resolution had been performed.
2017-07-10 11:08:43 +01:00
Marc Bonnici
d6f18466c9 Workload: Makes APK starting activity optional
The starting activity is not always listed in an apk or required to start
an application to its default state, for example youtube. Therefore now the
starting activity will only be used if one is available.
2017-07-10 11:08:43 +01:00
Marc Bonnici
1b93a4162b Workload: Updated to use a ParameterDict
In order to pass arguments to the instrumented test via the command line
they need to be encoded, this commit utilises a ParamDict to ensure
parameters are encoded correctly before passing them as arguments.
2017-07-10 11:08:43 +01:00
Marc Bonnici
279ed6a2c9 Workload: Splits ApkUIWorkload into ApkWorkload
This commit removes the UI elements from ApkUIWorkload to provide a base
ApkWorkload class in order to support workloads that do not require a GUI.
It also remove the `@once` decorator as apk resolution may need to be
run more than once per run.
2017-06-15 17:48:58 +01:00
Marc Bonnici
e186056182 Workload: Adds workload parameters for APKHandler
Now accepts parameters which can be used to determine which apk is to be used
and to control the apk installation procedure.
2017-06-15 17:44:41 +01:00
Marc Bonnici
4523fb74b6 Workload: Fixes apk resolution when not present on host.
Previously apk resolution would fail if the application apk was not present on
device as this was used to retrieve information e.g. the package name. To work
around this, the resolution process now supports searching the device for either
a list of package names retrieved from the workload or as a parameter passed by
the user at runtime and if found on the device will be pulled to the host to
perform its analysis.
2017-06-15 17:44:41 +01:00
Marc Bonnici
0c3e1c2526 Workload: Renamed ApkHander to PackageHandler 2017-06-12 14:57:55 +01:00
Marc Bonnici
b9b237f288 Android Workload: Updated to install and use Uiautomator 2 tests.
The new method of using uiautomation 2 is by using instrumented apk files rather
than JAR files. This commit updates the base workload has been updated to
install/uninstall the new uiautomation APK files and to invoke the relevant
instrumentation.
2017-06-12 14:57:54 +01:00
Marc Bonnici
4b84a68038 Workload: Added ReventWorkload and updated ReventGUI
Added a new ReventWorkload as a base for revent based workloads.
Updated ReventGui to use `revent_recorder` and now uses `target.model`
instead of `taget.name`.
2017-04-25 10:35:02 +01:00
Marc Bonnici
a17e11251e Workload: Corrected doc string 2017-04-20 11:49:53 +01:00
Marc Bonnici
e60e31ff8e Imports: Updated Imports
Switch remaining wlauto imports to wa.
Added other missing imports.
2017-04-20 11:49:53 +01:00
Sergei Trofimov
18e7ffb826 workload: adding basic UIAutomator workload implementation
Added a workload type to handle workloads that have both an APK with an
application and associated automation JAR. Added benchmarkpi
implementation using using the new workload.
2017-03-29 09:55:40 +01:00
Sergei Trofimov
0032e347fe Implemeting target assistants
- Workload's update_result stage has now been broken up into two parts:
  extract_results and update_output. This is to allow the assistant to
  pull output from the target in between the two stages.
- Updated assistant implementations for Linux and Android targets from
  the exisiting code.
- Extended target descriptor code to handle assistants and their
  parameters as well.
- Updated  the target manager to actually make use of the assistants.
2017-03-29 09:53:27 +01:00
Sergei Trofimov
42539bbe0d New target description + moving target stuff under "framework"
Changing the way target descriptions work from a static mapping to
something that is dynamically generated and is extensible via plugins.
Also moving core target implementation stuff under "framework".
2017-03-06 11:10:25 +00:00
Marc Bonnici
1f1f2b12c6 WA3 Exsisting Code 2017-02-21 15:02:28 +00:00