1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00
Commit Graph

31 Commits

Author SHA1 Message Date
Marc Bonnici
4ddd610149 Migrate to Github Actions
Now Travis has stopped providing a free tier migrate initial
tests over to use Github Actions.
2020-12-16 09:51:09 +00:00
setrofim
a1bdb7de45 config/core: merge params from different files
Ensure that runtime and workload parameters specified across multiple
config files and the config section of the agenda are merged rather than
overwritten.
2020-10-30 12:05:30 +00:00
Jonathan Paynter
7bea3a69bb tests: Add tests to check job finalized
Adds tests to see if jobs are finalized after being skipped,
failed. Tests if jobs are labelled as skipped.
2020-09-10 15:52:20 +01:00
Jonathan Paynter
7cf5fbd8af framework, tests: Correct signal disconnection
While the Louie system operated on weakrefs for the callback
functions, the priority list wrapper did not. This difference led to
weakrefs to callback functions being compared to strong references in
list element operations within Louie's disconnect method, so that
handler methods were not disconnected from signals.

Converting the receiver to a weakref then allowed Louie to operate as
normal, which may include deleting and re-appending the handler method
to the receivers list. As ``append`` is a dummy method that allows the
priority list implementation, the handler method is then never added
back to the list of connected functions, so we must ``add`` it after
``connect`` is called.

Also included is a testcase to confirm the proper disconnection of
signals.
2020-07-14 17:31:38 +01:00
Jonathan Paynter
d4057367d8 tests: Add run state testbench
Need to test:
- whether the state files properly track the state of wa
runs
- the state of the jobs and whether they are correctly
updated

State file consistency tests implemented for scenarios:
	- job passes on first try
	- job requires a retry
	- job fails all retries

Job object state test implemented for:
	- Job status should reset on job retry (from FAILED or PARTIAL
	to PENDING)
2020-07-14 17:31:38 +01:00
Sergei Trofimov
5f00a94121 utils/types: fix toggle_set creation
Correctly handle the presence of both an element and its toggle in the
input, and handle them base on order, e.g.

toggle_set(['x', 'y', '~x']) --> {'y', '~x'}
toggle_set(['~x', 'y', 'x']) --> {'y', 'x'}
2020-02-19 17:02:58 +00:00
Sergei Trofimov
0f2de5f951 util/exec_control: add once_per_attribute_value
Add a decorator to run a method once for all instances that share the
value of the specified attribute.
2020-02-07 16:49:48 +00:00
Sergei Trofimov
cc1cc6f77f tests: fix pytest warnings
Fix warnings reported when running unit tests via pytest.

- Rename TestDevice to MockDevice, so that it is not interpreted as a
  test case.
- Fix collections abstract base class imports.
- Add an ini file to ignore the same from "past".
2019-12-03 14:03:18 +00:00
Marc Bonnici
4ce41407e9 tests/test_agenda_parser: Ensure anchors can be used as part of agenda
Ensure that yaml anchors and aliases can be used within a WA agenda.
2019-05-17 20:04:33 +01:00
Marc Bonnici
aa0564e8f3 tests/test_agenda_parser: Use custom yaml loader for test cases
Instead of using the default yaml loader make sure to use our customised
loader. Also move the loading stage into our test cases as this should
be part of the test case to ensure that it functions for the individual
test case.
2019-05-17 20:04:33 +01:00
Marc Bonnici
b4ea2798dd tests/test_agenda_parser: Remove attribute assignment
Do not try and assign the name attribute of the yaml loaded agenda as
this is not used.
2019-05-15 19:48:39 +01:00
Sergei Trofimov
8464c32808 tests: add unit test for includes 2018-07-23 16:47:10 +01:00
Sergei Trofimov
96dd100b70 utils/toggle_set: fix merge behavior
- Change how "source" and "dest" are handled inside merge() to be more
  sane and less confusing, ensuring that disabling toggles are merged
  correctly.
- Do not drop disabling values during merge, to ensure that merging
  is a transitive operation.
- Add unit tests for the above fixes.
2018-07-11 10:48:00 +01:00
Marc Bonnici
ad87a40e06 Travis: Run the idle workload as part of the tests. 2018-07-10 12:56:51 +01:00
Sergei Trofimov
4098c0623b tests: quieten signal logger
Set signal logger level to CRITICAL to prevent it from spewing out
log message on the console for expected errors during tests.
2018-07-05 10:36:57 +01:00
Sergei Trofimov
8878cc20d4 Update copyright headers.
- Add copyright headers to files that did not already have them
- Update the year to the last year the file was modified in files with
  existing headers.
2018-07-04 16:33:31 +01:00
Marc Bonnici
57ddf7845c tests: Update tests to work with python3 2018-07-04 11:54:17 +01:00
Marc Bonnici
107fdc203c tests/test_utils: Update behaviour of test
As part of commit #b3de85 porting to WA3, the behaviour of Enums changed
so that the attribute to be fetched is converted to lower case before
the lookup occurs. Due to the fact that 'names' is a predefined
attribute of the Enum class this clashes and will return the full list
of names instead of the individual entry. Update the test to use another
non reserved entry.
2018-07-04 11:54:17 +01:00
Sergei Trofimov
6ee40c2170 utils/types: implement __ne__ for level
This should have been handled by the @total_ordering decorator, but
isn't due to

        https://bugs.python.org/issue25732

(briefly, total_ordering is back-ported from Python 3, where the base
object provides the default implementation of __ne__ based on __eq__, so
total_ordering did not override it; this, however does not happen in
Python 2).

Also update unit tests to catch this edge case.
2018-06-14 15:04:56 +01:00
Sergei Trofimov
64f9cf79e4 utils/diff: fix diff_interrupt_files on Python 2
During Python 3 migration, the izip call inside diff_interrupt_files has
been replaced with a zip call (zip returning an iterator in Python 3).
Import zip from builtins to ensure that it also produces an iterator in
Python 2.

Also fix the associated unit test by importing the correct function.
2018-06-14 15:04:56 +01:00
Marc Bonnici
f73f502ecd tests/agenda_parser: Update agenda tests to the AgendaParser
The current test was designed to test the removed `Agenda` class, we now
use use an `AgendaParser` so update the tests to test its functionality
instead.
2018-05-24 11:49:10 +01:00
Marc Bonnici
2f02ee3b16 tests/test-agenda: Update to WA3 workloads
Update old WA2 only workloads to those present in WA3
2018-05-24 11:49:10 +01:00
Marc Bonnici
3efff81a5c utils/exec_control: Fix issue with once_per_instance decorator
Previously the `once_per_instance` used the output of `__repr__` to
identify the class of where the decorated method was called from. For
classes that override this method to produce the same output for
different instances of the same class this caused different instances to
be mistakenly treated as one. Now use the hash of the containing class
instead of the string representation and update the tests to catch this
error.
2018-05-22 17:18:40 +01:00
Marc Bonnici
041f4d93f7 tests/test_diff: Update instrumentation reference.
Update the import path for the test to use `instruments` instead of
`instrumentation`.
2018-05-21 10:26:28 +01:00
Marc Bonnici
707b5409e7 test/exec_control: Updated to test new @once functionality 2018-01-15 15:42:26 +00:00
Brendan Jackman
fd7ae4b95b tests: Update use of devlib cpufreq API
get_domain_cpus has been renamed get_related_cpus
2017-12-07 15:37:49 +00:00
Sergei Trofimov
a9959550af utils/types: better enum class member setting
- What used to be enum.values is now enum.levels.
- Add enum.names and enum.values that are lists of enum's levels' names
  and values respectively.
- Add a check on creation to make sure that provided level names do not
  conflict with the atomatically created members.
2017-08-09 15:59:20 +01:00
Sergei Trofimov
8d27b50a7c tests: add tests documenting enum behavior
Add tests that exercising various ways of creating and using WA enums.
2017-08-09 14:56:32 +01:00
Marc Bonnici
91c49d9e95 ExecControl: Fixes bug with inheritance
Previously there was no differentiation between the same method at different
inheritance levels, therefore using the once_per_instance_decorator with super call would
prevent the super call from executing as they were considered the same
instance.
2017-07-10 11:08:43 +01:00
Sergei Trofimov
5b3d7af62e types: make enum levels serializable
Add to/from_pod implementations to level, so that it may be serialized
properly. In order to make sure that serialization is a reversible
operation, ensure that the level value is numeric.
2017-06-26 09:13:30 +01:00
Sergei Trofimov
2bbe300dc2 tests: moved out of wa package
Tests now reside in the root of the repo, rather than in wa package.
This means they will no longer packaged and installed in user
deployments (they're only useful for developers).
2017-04-27 17:36:44 +01:00