[ https://issues.apache.org/jira/browse/MESOS-9914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924139#comment-16924139 ]
Andrei Budnik commented on MESOS-9914: -------------------------------------- {code:java} commit 6c2a94ca0eca90e6d3517e4400f4529ddce0b84c Author: Andrei Budnik abud...@apache.org Date: Mon Sep 2 17:15:52 2019 +0200 Added `SlaveOptions` for wrapping all parameters of `StartSlave`. This patch introduces a `SlaveOptions` struct which holds optional parameters accepted by `cluster::Slave::create`. Added an overload of `StartSlave` that accepts `SlaveOptions`. It's a preferred way of creating and starting an instance of `cluster::Slave` in tests, since underlying `cluster::Slave::create` accepts a long list of optional arguments, which might be extended in the future. Review: https://reviews.apache.org/r/71424 {code} > Refactor `MesosTest::StartSlave` in favour of builder style interface > --------------------------------------------------------------------- > > Key: MESOS-9914 > URL: https://issues.apache.org/jira/browse/MESOS-9914 > Project: Mesos > Issue Type: Improvement > Components: test > Reporter: Andrei Budnik > Assignee: Andrei Budnik > Priority: Major > > Every overload of `MesosTest::StartSlave` method depend on > `cluster::Slave::create` method, which accepts several arguments. In fact, > each overload of `MesosTest::StartSlave` accepts a subset of combination of > arguments that `cluster::Slave::create` accept. Given that the latter accepts > 11 arguments at the moment, and there are already 13 overloads of the > `MesosTest::StartSlave`, introducing a builder-style interface is very > desirable. It'd allow adding more arguments to the `cluster::Slave::create` > without the necessity to update all existing overloads. It would be a local > change as it won't affect existing tests. > See [this > comment|https://github.com/apache/mesos/blob/00bb0b6d6abe7700a5adab0bdaf7e91767a2db19/src/tests/mesos.hpp#L160-L177]. -- This message was sent by Atlassian Jira (v8.3.2#803003)