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

297 Commits

Author SHA1 Message Date
Marc Bonnici
31b46fb3b7 framework/configuration: Refactor code into seperate method 2018-03-20 08:24:58 +00:00
Sergei Trofimov
f3bb8e135a fw/execution: record UI state on error
Record UI state if an error occurs during setup, run, and output
processing stages (for other stages, the UI state is unlikely to be
relevant as they typically would not include UI manipulation).
2018-03-19 09:06:21 +00:00
Sergei Trofimov
e93199a0a0 fw/execution: add record_ui_state() to context
Add a method to record UI state (take a screen shot, and, for Android
devices, dump the UI tree structure) to ExecutionContext.
2018-03-19 09:06:21 +00:00
Sergei Trofimov
c0049d0a86 fw/job: only finalize if initialized
Only run finalize() for a job if initialize has succeed. finalize()
should be able to assume that initialize() has succeed, without needing
to check that that file have been created, variables set, etc.
2018-03-19 09:06:21 +00:00
Sergei Trofimov
f946f13838 fw/job: add workload to INFO logging
Add workload label to the INFO-level log messages produced by the job.
2018-03-16 15:38:09 +00:00
Sergei Trofimov
5b15b115a7 framework/output: add list_workloads to RunOutput
Add a convenience method to list which workloads (as per their label)
were involved in a run.
2018-03-16 15:38:09 +00:00
Sascha Bischoff
dd7ff641f3 fw/workload: Fix installed apk info
Fix an issue where AndroidWorkload.pull_apk would sometimes get the
wrong package if the desired package name is a substring of another
package name. Rather than using a regex to match the package name, use
the new get_package_info method to match the name exactly.
2018-03-15 17:06:23 +00:00
Sergei Trofimov
9689420cff fw/execution: fix Exception on abort
Hitting CTRL-C will abort execution of the current job, but will still
trigger run finalization, and possibly, post-processing and teardown of
the current job. If an exception is raised during this
post-process/teardown, the previous exception state (for the
KeybardInterrupt) will be clobbered. That means that, after the new
exception has been handled, WA would attempt to execute the next job,
rather than go to finalization of the run.

To avoid this, set a flag in the context upon catching KeybardInterrupt,
and check this flag before attempting to execute the next job in the
queue.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
fda418093d fw/execution: change how error events get added
Rather than relying on a custom Logger with a context to add events when
they are logged, have the runner register hooks for corresponding
signals that do that.

The issue with the previous approach is that the event ended up
being added too late -- after the current job was already cleared, so
all events were added at run level.

With the new approach, the event will be added when it is first logged,
while there is still a current job being set. There will be no
duplication for Exceptions being re-raised and handled at different
levels because log_error() will ensure that each Exception is logged
only once.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
10f79c37c2 fw/target/descriptor: add usability functions
- Add SimpleTargetDescriptor that simply returns a global list of target
  descriptions.
- Add create_target_description function to populate that list with a
  description crated from the specified components.
- Add add_description_for_target helper function to create a description
  for the specified target class, and specified components. For
  components that are not explicitly specified, attempt to guess
  sensible defaults based on the target class' bases.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
9303c70727 fw/target/descriptor: fixes
- fix TargetDescription._set to set lists rather than dicts for params
  to be consistent with how params are set after creation (should
  probably get rid of this entirely...)
- fix the comment describing the structure of TARGETS
2018-03-08 11:18:12 +00:00
Sergei Trofimov
879dfc7700 framework/output: output fixes
- Get events from the result
- Correctly handle pending jobs
2018-03-08 11:18:12 +00:00
Sergei Trofimov
79aaef9986 fw/execution: abort and unresponsive target handling
Make sure KeyboardInterrupt's and unresponsive target errors are caught
and handled at appropriate points in the execution.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
04ab336afc fw: fix error logging
- Keep track of logged exceptions inside log_error itself.
- signal: log the exception, if there is one  in the finally clause of
  the  signal wrapper; this will ensure that the error will be logged
  closer to the command that originated.
- entrypoint: use log.log_error for top-level error logging, rather than
  the  entrypoint logger directly; this will ensure that errors are not
  repeated unnecessarily.
- Log CTRL-C message at zeroth indent level to make it easier to see in
  the  non-verbose output where it occurred.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
6fe31d6cad fw/execution: Handle unresponsive targets
If a target error occurs, check whether the target is unresponsive. If
it is, attempt to hard reset it if possible, or gracefully terminate
execution if not.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
fdb872d9cd fw/target/manager: Add verify_target_responsive()
Add a method to check that the target is still responsive, and cache
the value so that the target does not need to be repeatedly probed
during various stages of wrapping up execution.
2018-03-08 11:18:12 +00:00
Sergei Trofimov
1b9ac9236a framework/exception: add ExecutionError
Add an exception class to represent an error from within the execution
framework (rather than a plugin).
2018-03-08 11:18:12 +00:00
Sergei Trofimov
d44c2ff919 framework/execution: end_run() fix part 2
Missed some "output" references in the previous commit.
2018-02-23 12:38:50 +00:00
Sergei Trofimov
0728f35cbe framwork/target: parameterize disabling of SELinux
Add a parameter to optionally not attempt to disable SELinux as that can
cause problems on some platforms.
2018-02-22 11:20:35 +00:00
Sergei Trofimov
cec3eaa375 framework/execution: fix end_run() on crash
ExecutionContext.end_run() does final updates to the run info in the run
output (final status, run duration, etc). This was previously accessed
via self.output in the context. Typically, this would correctly resolve
to the run output, as there would be no current job. However, in the
event of a crash, current_job would be set, and this would resolve to
the job output itself, resulting in run info not being updated. Use
run_output to avoid this.
2018-02-22 11:20:35 +00:00
Sergei Trofimov
12a33c8aeb framework: move instruments -> instrument
Use the singular to be consistent with other modules in wa.framework.
2018-02-22 08:41:04 +00:00
Marc Bonnici
b7aa7d68b5 config/plugin_cache: Add specific error for global and config entries
Add a special error for finding `global` or `config``  entries in
configuration to provide a more helpful error message.
2018-02-16 15:32:41 +00:00
Marc Bonnici
b103ae34ce configuration/core: Add missing initialization for classifiers 2018-02-16 14:43:52 +00:00
Sergei Trofimov
7313ed5cb5 framework/output: load job_specs
- Load job_specs from jobsfile on reload of RunOutput
- Attach the corresponding spec to a JobOutput
2018-02-16 13:56:03 +00:00
Sergei Trofimov
03328f0456 framework/output: improve access to config
Make it easier to access a run's configuration but automatically
deserializing it on reload of RunOutput, and exposing it via appropriate
settings.
2018-02-16 13:56:03 +00:00
Sergei Trofimov
8466b77d5b framework/config: fix deserialization
- RebootPolicy: correctly handle being passed another instance of
  RebootPolicy on creation; this a requirement for it to be usable as a
  ConfigurationPoint kind.
- RebootPolicy: move static method to above __init__ (consistency).
- RunConfiguration: handle deserialization of 'device_config' entry.
- RunConfiguration: move static method to above __init__ (consistency).
2018-02-16 13:56:03 +00:00
Sergei Trofimov
1e21bd2ca8 framework/output: save classifiers in Result
Save classifiers at Result as well as Metric level. Reason: when
processing output, one might want to filter complete results, as well as
individual metrics. While it is in theory possible to get the
classifiers for a job by simply extracting the common classifiers
between all metrics, this fails when there are no metrics generated for
a job (note that one might still want to process the output in this
case, e.g. for the artifacts).
2018-02-16 13:56:03 +00:00
Marc Bonnici
4b6297e7ea configuration/plugin_cache: Fix incorrect parmeter name 2018-02-15 13:42:48 +00:00
Marc Bonnici
ed75764445 configuration/plugin_cache: Add target names as allowed plugin configs
Allow setting of device configuration by specifying target name.
2018-02-15 13:42:48 +00:00
Marc Bonnici
52dca17fef target/descriptor: Fix generate target default config
Was previously expecting a dictionary of parameter attributes however the
actual type is a list.
2018-02-15 13:42:48 +00:00
Marc Bonnici
4703dc616a framework/agenda: Remove unused code 2018-02-14 17:03:21 +00:00
Marc Bonnici
ad5fd0076c configuration/core: Add missing parameter alias for workload_parmeters 2018-02-14 17:03:21 +00:00
Sergei Trofimov
b1b379982c framework/output: fix job status
After loading (or attempting to load) job output, update the status from
the state, as that will be more accurate.
2018-02-14 11:13:05 +00:00
Sergei Trofimov
c87d016025 framework/output: handle missing/corrupt result files.
Do not explode if a result file for a job is missing when loading a
RunOutput. Specify job status as "UNKNOWN" and add the exception from
attempting to load the file to the events.
2018-02-14 11:13:05 +00:00
Marc Bonnici
0543982f29 framework/host: Generate default config.yaml upon first init 2018-02-14 09:13:04 +00:00
Marc Bonnici
dfce5ca7ba configuration/default: Update to use augmentation terminology 2018-02-14 09:13:04 +00:00
Marc Bonnici
73416d40c2 configuration/core: Remove unused RTParam code 2018-02-14 09:13:04 +00:00
Marc Bonnici
1ec1bd14a5 configuration/core: Remove unnecessary config point
`Augmentations` configuration point should be used instead of `output_processors`
entry which is already specified elsewhere.
2018-02-14 09:13:04 +00:00
Marc Bonnici
965f8e2218 configuration/core: Make generic_android default device 2018-02-14 09:13:04 +00:00
Marc Bonnici
d7f28da71e configuration/core: Add missing description to doc string 2018-02-14 09:13:04 +00:00
Sergei Trofimov
b33defbfea framework/workload: fix "no matching package" error
Fix an issue introduced by commit 42fb3eb

	framework/workload: make "no matching package" message more useful

PackageHandler was incorrectly passing self.name into the error message
instead of self.owner.name.
2018-02-12 11:45:03 +00:00
Sergei Trofimov
42fb3eb148 framework/workload: make "no matching package" message more useful
Make the error message reported when no matching Android app package
could be found more useful by including the workload name, and, if
applicable, sought version.
2018-02-09 17:45:04 +00:00
Marc Bonnici
22a2ccf7d6 target/logcatpoller: Make capitalisation consistent 2018-02-07 10:01:12 +00:00
Marc Bonnici
728057dbba target/androidassistant: Fix Logcat poller creation
Threads cannot be restarted therfore we need to create a new polling
thread for each time the poller is started.
2018-02-07 10:01:12 +00:00
Marc Bonnici
07cd770288 framework/plugin_cache: Fix missing assistant parameters 2018-02-07 10:01:12 +00:00
Marc Bonnici
36309a4cf2 target/assistant: Fix logcat poller
Rename the `start` method to `run` as this is what is what is called
by the threading module's `start` method, otherwise this causes the
polling to be done in the main thread blocking execution.
2018-02-07 10:01:12 +00:00
Sergei Trofimov
c5df74eb56 framework/config: load plugins from extra packages
Add support for loading plugins from packages that register themselves
with WA by writing their names into $WA_USER_DIRECTORY/packages.

This is functionality that existed in WA2 and was omitted in WA3 until
now.
2018-02-06 17:30:49 +00:00
Sergei Trofimov
58c4ae609c framework/output_processor: fix get_output_processor()
Output processor names are converted to identifiers when they are
loaded. Ensure the same thing happens when looking up installed output
processors with get_output_processor().
2018-02-06 09:49:58 +00:00
Marc Bonnici
9a556721b6 Augmentations: Allow configuring of augmentations per workload
Add support for enabling and disabling of augmentations (instruments and
output processors) on a per workload basis.
2018-02-01 14:26:08 +00:00
Marc Bonnici
557d62ce86 framework/configuration: Fix disabling of augmentations
Previously disabling of augmentaions via using the `--disable`
flag or by using the "~" notation in agendas was ignored.
2018-02-01 14:26:08 +00:00