Age | Commit message (Collapse) | Author |
|
This provides a generic way to mark the sequential relationship of test result records.
The intention is to make it easier for downstream parsers to process test result records for repeat and retry cases.
The `retry_parent` field is now deprecated in test result record.
|
|
* Switch to Pyink for formatting
---------
Co-authored-by: Nitin Prasad <nkprasad@google.com>
|
|
|
|
|
|
|
|
Although it is deprecated, we need to keep it working until the complete removal.
|
|
Users have identified more legit use cases where operations before `setup_class` are needed. The `setup_generated_tests` stage is essentially the stage before `setup_class`. Hence we are renaming it more properly.
|
|
When generating tests, if the `test_logic` function is decorated with
either `retry()` or `repeat()` decorators, apply the settings to the
generated test methods.
|
|
1. unittest.mock is added in Python 3.3, Mobly works on 3.6+ so we can replace mock with unittest.mock
2. Fix bad import order according to Google Python style guide: https://google.github.io/styleguide/pyguide.html#313-imports-formatting
3. Cleanup unused import
4. Remove `from builtins import str`
|
|
|
|
|
|
|
|
* Provides decorators for users to mark test cases for repeat and retry.
* Adds new attributes to the TestResultRecord for associating retry test records.
* Refactors existing code to support the repeat/retry behavior.
|
|
In Python 3, only new-style classes exist.
No need to inherit from class object.
Reference:
https://stackoverflow.com/questions/4015417/python-class-inherits-object
|
|
|
|
In code that must support python2,
super must be called as super(MyClass, self),
but in python3-only code this is unnecessary and not recommended.
|
|
|
|
* Add a config file for yapf
* Clarify the pre-submit steps in CONTRIBUTION.
|
|
Pure shortening of the indentation length, no actual code change.
|
|
* Add a new level of output directoy specific to test classes.
* Direct `log_path` to class-specific.
* Add a `root_output_path` pointing to the test run path
(what `log_path` used to point to)
|
|
|
|
Without this try/finally statement, a raised error within the context
causes the ending log line to not be logged.
|
|
|
|
|
|
|
|
|
|
|
|
Also fix a bug where setup_class record is not written to file correctly.
|
|
|
|
Moving existing controller management logic to a dedicated manager class.
This improves code quality and reduces maintain cost.
Base class uses calls APIs in the new controller manager instead of holding all the controller states itself directly.
|
|
|
|
* Support multiple groups of controller info in test result record.
* Record controller info at the end instead of the beginning of a test class run.
* Introduce a proper data class for controller info.
* Add the new module needed for the new unit tests.
|
|
So the controller objects of a class is encapsulatd within the test
class itself. This makes the structure cleaner and gets rid of the
awkward passing of a partial function from test runner to each test
class.
|
|
* Clarify each execution stage in DEBUG log.
* Fix behavior for `setup_generated_test` failure and add a unit test for it.
|
|
|
|
* Also fix a problem where `_` prefix is exposed in error record.
|
|
* `abort_all` should skip remaining tests in a class just like `abort_class`.
* A record for `setup_class` should exist if `setup_class` failed and
`abort_all` is called in `on_fail`
* Handle the case of calling `abort_all` in `teardown_class`.
|
|
So `BaseTestClass.current_test_info` can be used more consistently
throughout the test class.
|
|
* Support adding arbitrary info in test summary.
|
|
* Fixed missing stacktrace for py2 for setup_test failure
|
|
|
|
|
|
* Add new module `mobly.expects` with expectation APIs.
* Modify base_test to utilize the new module.
|
|
Add a `RuntimeTestInfo` type to expose more runtime info of the test.
This way we don't have to keep adding more attributes to base class.
|
|
Add a base type for both abort signals.
|
|
* If `setup_test` fails with TestFailure, it should be tallied with ERROR status.
* Add a test case for skipping in setup_test.
|
|
|
|
* Include exception objects in record for tests' procedure functions to consume
* Introduce a wrapper class for storing exception objects in record, including info like stacktrace.
* Introduce an alias for the main exception.
* Mark failed tests as fail despite subsequent errors..
|
|
Instead of arbitrary fields, now pass all the info of the test execution
so procedure functions can be more useful.
|
|
* Fix a bug where timestamps are set on tests that didn't even start.
* More unit test conditions for when test is skipped from within.
|