cluster-api-provider-azure icon indicating copy to clipboard operation
cluster-api-provider-azure copied to clipboard

De-duplicate and simplify code in the controllers unit tests

Open willie-yao opened this issue 1 year ago • 7 comments

/kind cleanup

What needs cleanup: Currently, the unit tests in the controllers package contains lots of duplicated code, mostly in the form of test objects. Many of these objects are re-defined in each test file with very little change in between them.

For example, this test cluster object is re-defined 10 times in the controllers package.

Describe the solution you'd like We should create a file that stores all of the common helper functions and objects that are used for unit tests in the controllers package.

Files to change:

  • All unit test files in the controllers package

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

willie-yao avatar Dec 18 '23 21:12 willie-yao