You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Role starter APIs on Integration Test framework is starting to slip into some fragmented patterns, which is resulting in a suboptimal user experience while writing tests.
I noticed this while doing the experimentation described here: #1226 (comment)
Given that #1226 hasn't yet been merged, I believe it can be used to address start_jdc and start_jds.
But start_sniffer, start_pool and start_template_provider probably deserve a separate PR (ideally in sync with #1226).
Here's a detailed description of each fragmented pattern:
arg types
All starter functions take parameters with Socket Address information.
However, each role is following a different standard:
start_sniffer takes SocketAddr
start_pool takes Option<SocketAddr>
start_template_provider takes u16 (representing a port)
To be honest, I feel it makes more sense to always call common::get_available_address() inside the function bodies and simply abstract that away from the user (potentially even making common::get_available_address() into a private function under common).
In other words, I think the direction start_jdc and start_jds are taking is better than the other starters.
return types
Starter functions are returning types under different patterns:
plebhash
changed the title
Need to fix fragmented patterns on Integration Test APIs
Need to fix fragmented patterns on Integration Test starter APIs
Oct 25, 2024
Role starter APIs on Integration Test framework is starting to slip into some fragmented patterns, which is resulting in a suboptimal user experience while writing tests.
I noticed this while doing the experimentation described here: #1226 (comment)
Given that #1226 hasn't yet been merged, I believe it can be used to address
start_jdc
andstart_jds
.But
start_sniffer
,start_pool
andstart_template_provider
probably deserve a separate PR (ideally in sync with #1226).Here's a detailed description of each fragmented pattern:
arg types
All starter functions take parameters with Socket Address information.
However, each role is following a different standard:
start_sniffer
takesSocketAddr
start_pool
takesOption<SocketAddr>
start_template_provider
takesu16
(representing a port)start_jdc
takesSocketAddr
(not yet merged, WIP under Add JDC/S initializers in integration tests #1226)start_jds
takesSocketAddr
(not yet merged, WIP under Add JDC/S initializers in integration tests #1226)assumptions on roles socket addresses
Not all starter functions are taking Socket Address information for the actual role.
start_sniffer
assumessniffer_addr
will be provided by the userstart_pool
assumespool_addr
will be provided by the userstart_template_provider
assumestp_addr
will be provided by the userstart_jdc
assumes nothing is provided, but callscommon::get_available_address()
inside the function body (not yet merged, WIP under Add JDC/S initializers in integration tests #1226)start_jds
assumes nothing is provided, but callscommon::get_available_address()
inside the function body (not yet merged, WIP under Add JDC/S initializers in integration tests #1226)To be honest, I feel it makes more sense to always call
common::get_available_address()
inside the function bodies and simply abstract that away from the user (potentially even makingcommon::get_available_address()
into a private function undercommon
).In other words, I think the direction
start_jdc
andstart_jds
are taking is better than the other starters.return types
Starter functions are returning types under different patterns:
start_sniffer
returnsSniffer
start_pool
returnsPoolSv2
start_template_provider
returnsTemplateProvider
start_jdc
returnsSocketAddr
(not yet merged, WIP under Add JDC/S initializers in integration tests #1226)start_jds
returnsSocketAddr
(not yet merged, WIP under Add JDC/S initializers in integration tests #1226)The text was updated successfully, but these errors were encountered: