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

Use Fake / More integration for integration unit tests #4001

Open
mimowo opened this issue Jan 17, 2025 · 1 comment
Open

Use Fake / More integration for integration unit tests #4001

mimowo opened this issue Jan 17, 2025 · 1 comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@mimowo
Copy link
Contributor

mimowo commented Jan 17, 2025

What would you like to be cleaned:

We have the following unit tests recently added in , like this:

"change in replicas (scale up with AppWrapper ownerReference while the previous scaling operation is still in progress)": {
integrations: []string{appwrapper.FrameworkName},
oldObj: testingstatefulset.MakeStatefulSet("test-sts", "test-ns").
Queue("test-queue").
Replicas(0).
StatusReplicas(3).
Obj(),
newObj: testingstatefulset.MakeStatefulSet("test-sts", "test-ns").
WithOwnerReference(metav1.OwnerReference{
APIVersion: awv1beta2.GroupVersion.String(),
Kind: "AppWrapper",
Controller: ptr.To(true),
}).
Queue("test-queue").
Replicas(3).
StatusReplicas(1).
Obj(),
},
.

In this test we want to check the behavior when the CRD is owned by another CRD managed by Kueue.

For now we used AppWrapper as the owner integration, but it would be better to use a fake one.

Why is this needed:

The use of AppWrapper integration in the unit tests is not ideal, because:

  • it makes unnecessary coupling between the integrations to AppWrapper
  • the tests could not be cherry-picked to 0.10
@mimowo mimowo added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 17, 2025
@mimowo
Copy link
Contributor Author

mimowo commented Jan 17, 2025

/cc @mbobrovskyi

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