Currently most partner-specific shopfloor interaction was done by the call_shopfloor test, with args re-evaluated that accepts lambda execution.
There are pros and cons. One advantage is that this prevents writing lots of small pytests, making it easier to limit the board-specific code only living in board overlay; and the disadvantage is that these code lives in test list, hard to debug and maintain, and not friendly for our static test list in future.
I think we want to find a solution that
- Invocation to shopfloor can still use one single, extensible pytest.
- Parameters should be in static form, at least not lambda.
- Find a way so we can still allow flexibility for what to be sent as parameter for shopfloor.
For example, having all logic defined in one py module file, and then:
pytest_name='call_shopfloor',
dargs={
'module': 'cros.factory.board.call_shopfloor',
'method': 'RemoteMethod',
'args': ''LocalMethod'
}
would be interpreted by
from cros.factory.board import call_shopfloor
shopfloor.RemoteMethod(call_shopfloor.LocalMethod())
Well, this is just one idea. Open for suggestion.
Usually what we'd like to send into Shopfloor are serial number, op_id, or other device-specific stuff, so another approach is to define few keywords like the verify_value does:
- evaluate args starting with 'dut' as calls to device_utils.CreateDUTInterface()....
We can create more keywords like
- tar/zip: Tar/zip given path and upload the blob, for example 'tar:/var/factory'
- device_data: Evaluate the device data dict
- station_data: For things like OP ID?
Comment 1 by hungte@chromium.org
, Jan 25 2017