Skip to content

v3: refactoring on test_helpers/pool_helper.go#576

Merged
oleg-jukovec merged 7 commits intomasterfrom
laines-it/gh-485-test-helpers-improve
Apr 24, 2026
Merged

v3: refactoring on test_helpers/pool_helper.go#576
oleg-jukovec merged 7 commits intomasterfrom
laines-it/gh-485-test-helpers-improve

Conversation

@laines-it
Copy link
Copy Markdown
Collaborator

Improvements:

  • typed args instead of any in pool_helper
  • add reusable helper test_helpers.ExecuteOnAll
  • replace custom Retry with assert.Eventually
  • custom comparing func instead DeepEqual
  • use typed decoding (GetTyped)
  • switch instead chained if/else

Closes #485

@laines-it laines-it requested a review from bigbes April 16, 2026 13:58
@oleg-jukovec oleg-jukovec force-pushed the laines-it/gh-485-test-helpers-improve branch from cf0146e to 0f34d40 Compare April 24, 2026 22:06
laines-it and others added 7 commits April 25, 2026 01:07
Using switch over chained if/else for grouped validations.
Using errors.New and fmt.Errorf with %w for proper error wrapping

Part of #485
Used GetTyped(&data) instead Get() for expected type.

Part of #485
Added comparePortMaps for deep comparing map[string]bool.
Used in ProcessListenOnInstance.

Part of #485
New pattern look like this:
```
assert.Eventually(t, func() bool {
	err = f(args)
	return err == nil
}, defaultTimeoutRetry, defaultTickRetry)
```

Part of #485
InsertOnInstances and SetClusterRO use ExecuteOnAll
to execute on all instances in parallel.

Minor changes:
* checkRole in SetInstanceRO returns error instead string.
* structured box API instead of raw CallRequest used in checkRole.

Part of #485
Changed signature of
ProcessListenOnInstance and ListenOnInstanceArgs
using ListenOnInstanceArgs and CheckStatusesArgs
instead of interface{}.

Closes #485
@oleg-jukovec oleg-jukovec force-pushed the laines-it/gh-485-test-helpers-improve branch from 0f34d40 to 19c1e8e Compare April 24, 2026 22:08
@oleg-jukovec oleg-jukovec merged commit 2a04fc9 into master Apr 24, 2026
27 checks passed
@oleg-jukovec oleg-jukovec deleted the laines-it/gh-485-test-helpers-improve branch April 24, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3: multiple improvements on test_helpers package [pool_helper.go]

2 participants