defradb
defradb copied to clipboard
Improve `getNodes` in test utils to return the correct indexes with the relevant nodes
We can improve the following function in test/integration/utils.go
:
func getNodes(nodeID immutable.Option[int], nodes []clients.Client) []clients.Client {
if !nodeID.HasValue() {
return nodes
}
return []clients.Client{nodes[nodeID.Value()]}
}
To return a list of correct node indexes and remove the getNodeCollections
as suggested in #3069
So:
getNodes
would return -> [ListOfIntsCorrespondingToTheNodeIndex] and [ListOfCorrespondingNodes]
This would solve the extra duplicate code logic introduced in #3068 while fixing #3065