Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shahzadlone opened this issue Sep 26, 2024 · 0 comments · Fixed by #3162
Closed
Assignees
Labels
area/testing Related to any test or testing suite code quality Related to improving code quality
Milestone

Comments

@shahzadlone
Copy link
Member

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 shahzadlone added area/testing Related to any test or testing suite code quality Related to improving code quality labels Sep 26, 2024
@shahzadlone shahzadlone added this to the DefraDB v0.14 milestone Sep 26, 2024
@shahzadlone shahzadlone self-assigned this Sep 26, 2024
shahzadlone added a commit that referenced this issue Oct 21, 2024
## Relevant issue(s)
Resolves #3076 

## Description
- Fix the `getNodes` bug
- Fix the temporary duplications in some actions
- Remove the `getNodesCollection`
ChrisBQu pushed a commit to ChrisBQu/defradb that referenced this issue Feb 21, 2025
## Relevant issue(s)
Resolves sourcenetwork#3076 

## Description
- Fix the `getNodes` bug
- Fix the temporary duplications in some actions
- Remove the `getNodesCollection`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Related to any test or testing suite code quality Related to improving code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant