Skip to content

espi-service: Migrate from comms to direct-async, pass in relayable services at construction time #703

@williampMSFT

Description

@williampMSFT

Currently, the eSPI service talks to all the services it needs to relay messages to over the comms system. This is a problem for testing because the comms system requires that everything that talks over it have lifetime 'static, which means that you can't ever create more than one instance. This locks us out of writing tests that instantiate services that use the comms system.

Therefore, to enable testing, we're going to provide a non-comm-system path for services to be relayed over the eSPI service that does not impose this 'static lifetime requirement. As part of this, we'll need to modify the eSPI service to have storage provided by the caller rather than statically declared in the module, and we'll need to provide trait implementations and boilerplate to allow the eSPI service to relay an arbitrary set of relayable messages.

Once we have that, services should be able to independently migrate to using the new facility to communicate with the espi-service. Once all relayable services have migrated, the eSPI service can remove its usage of the comms system and itself become testable against mocks (may also depend on breaking dependencies on embassy-imxrt)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions