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

[Feature] Redesign workload_resource_test function #2112

Open
kosstennbl opened this issue Jul 22, 2024 · 2 comments
Open

[Feature] Redesign workload_resource_test function #2112

kosstennbl opened this issue Jul 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@kosstennbl
Copy link
Collaborator

For most of the tests we use "workload_resource_test" function to iterate through resources and test required functionality.

Problem is that this function iterates for each container in each resource and sometimes it is not necessary. In some tests, "cnf_workload_resources" function is used for better efficiency, but i don't see that as a good final solution:

  • Resource formats provided by these two functions is different, which brings complications and extra adaptation code.
  • We don't have a "central point" for resource-related tests, which could bring confusion and instabilities for some changes.

I propose:

  • To make "workload_resource_test" an only function for iterations through resources in tests.
  • To optimize "workload_resource_test" functionality and usage, let it iterate only required amount of times depending on the test.
@kosstennbl kosstennbl added the enhancement New feature or request label Jul 22, 2024
@svteb
Copy link
Collaborator

svteb commented Jul 23, 2024

It might be better to check what the actual tests are intended to do and what resources they should iterate over instead. Some tests might suffice with access to containers through functions like ClusterTools.all_containers_by_resource?. The library tooling should be revised to give more targeted functions (with sensible names), i.e. get_all_resources, get_all_pods, get_all_containers and they should not be split across two different libraries.

@kosstennbl
Copy link
Collaborator Author

Possible solution would be having option to choose which resources are needed for "workload_resource_test" function, and all the logic behind getting these resources would be hidden from the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants