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

Split test wrappers into a different package from testutils #296

Open
Edwinhr716 opened this issue Dec 30, 2024 · 0 comments
Open

Split test wrappers into a different package from testutils #296

Edwinhr716 opened this issue Dec 30, 2024 · 0 comments
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@Edwinhr716
Copy link
Contributor

Edwinhr716 commented Dec 30, 2024

What would you like to be cleaned:
We should create a new package for the wrapper functions https://github.com/kubernetes-sigs/lws/blob/main/test/testutils/wrappers.go

Why is this needed:
testutils wrappers are used outside of the testutils package. This can cause a dependency cycle. For instance, validators.go https://github.com/kubernetes-sigs/lws/blob/main/test/testutils/validators.go#L153 and util.go https://github.com/kubernetes-sigs/lws/blob/main/test/testutils/util.go#L60 use revision functions. This means that the revision package cannot import the testutils package to use the wrapper functions since it creates a dependency cycle (testutils -> revision -> testutils), forcing us to have duplicate functions in unit tests https://github.com/kubernetes-sigs/lws/blob/main/pkg/utils/revision/revision_utils_test.go#L80.

Splitting it into its own package allows us to avoid this cycle.

Further context: https://github.com/kubernetes-sigs/lws/pull/277/files#r1898155596

@Edwinhr716 Edwinhr716 added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

1 participant