defradb icon indicating copy to clipboard operation
defradb copied to clipboard

Improve `getNodes` in test utils to return the correct indexes with the relevant nodes

Open shahzadlone opened this issue 4 months ago • 0 comments

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

shahzadlone avatar Sep 26 '24 13:09 shahzadlone