And to clarify, I don't think we need to migrate all ToT board overlays. poppy+fizz+coral should give us enough coverage of all form factors and ODM requests.
So when Poppy factory branch is created, I'd prefer to remove all ToT factory-board ebuilds that does not use JSON test list, instead of migrating them.
Meanwhile I think we should do some refactoring to current test list modules.
We currently have
- cros.factory.test.factory # FactoryTest and FactoryTestList here, with other test list related objects
- cros.factory.test.test_lists.test_lists # the builder of test lists
- cros.factory.test.test_lists.mananger # JSON loader
I think we should move test list related definition from test.factory into a new module with descriptive name. And probably not always saying "Goofy" instead. Ideally the test list thing should be a generic structure, not depending on Goofy, and instead can be used by any test harness that is compatible of the test list.
Calling that cros.factory.test.test_list may be fine, or we need a better name - describing "this is where we store the configuration of what tests should be executed and how (args)". test_list is usually fine, except it may look weird if we do
raise test_list.FactoryTestFailure
But it's probably fine to see test_list.TestState.
I think the goal is to have
- cros.factory.test.test_list # for definition of test list objects
- cros.factory.test.test_lists.manager # for reading and loading test lists, including active test list control.
So functions in test_lists.test_lists:
- builders should be removed
- utilities for managing active test list should go manager
- other uselesss functions should be removed
Owner: hungte@chromium.org Status: Started (was: Untriaged)
I have few CLs doing some of the refactoring. Realized that it's hard to really remove 'factory.py' so far because it contains all FactoryTest and TestList stuff, where FactoryTest relies on TestState, which is also needed by FactoryTestFailure - and they are all inside factory.py as "common types".
For example, it's weird if we move FactoryTestFailure to module 'test_list' and use it there like "test_list.FactoryTestFailure".
So for how I'd do the refactoring that
- cros.factory.test.test_lists.test_lists should move utility functions to manager, and leaving it only python test list builder functions (so we can remove it anytime)
- clean factory.py to that it contains only types of objects derived from test list, plus the exception of FactoryTestFailure.
Per offline discussion:
- we want to move test list related stuff to 'test_objects.py'
- manager.py#Testlist should be merged to test_objects#TestList
- factory#TestState should be moved to cros.factory.test.state
- The FactoryState#test.state should be renamed to TestStateServer
- FactoryTestFailure should be eliminated (or TestFailure in test.state?)
Comment 1 by hungte@chromium.org
, Aug 23 2017