| 81 | namespace tests { |
| 82 | |
| 83 | static SlaveInfo createSlaveInfo(const SlaveID& slaveId) |
| 84 | { |
| 85 | // Using a static local variable to avoid the cost of re-parsing. |
| 86 | static const Resources resources = |
| 87 | Resources::parse("cpus:20;mem:10240").get(); |
| 88 | |
| 89 | SlaveInfo slaveInfo; |
| 90 | *(slaveInfo.mutable_resources()) = resources; |
| 91 | *(slaveInfo.mutable_id()) = slaveId; |
| 92 | *(slaveInfo.mutable_hostname()) = slaveId.value(); // Simulate the hostname. |
| 93 | |
| 94 | return slaveInfo; |
| 95 | } |
| 96 | |
| 97 | |
| 98 | static FrameworkInfo createFrameworkInfo(const FrameworkID& frameworkId) |
no test coverage detected