-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
8
-
False
-
None
-
False
-
-
-
GitOps Scarlet - Sprint 3260, GitOps Scarlet - Sprint 3261
As part of post-GA work for Rollouts I have been going through the Rollouts operator codebase and looking at whether we have sufficient unit tests written for the most important logic in our code.
In this JIRA item, I have identified a number of unit tests that would be beneficial to add to test the functions in 'controllers/utils.go'
General guidelines:
- You should not need to create (any new) mocks for these unit tests.
- Consider using 'DescribeTable' in cases where it is possible, in order to avoid duplicating code
Criteria:
- There are a number of functions that have important logic which we don't have individual unit tests for:
- Add unit test for 'validateRolloutScope'
- Add unit test for 'checkForExistingRolloutManager'
- Add unit test for 'setAdditionalRolloutsLabelsAndAnnotationsToObject' to ensure labels/annotations are set correctly
- Add unit test for 'envMerge'
- Add unit test for 'combineImageTag'
- Add unit test for 'isMergeable'
- Add unit test for 'insertOrUpdateConditionsInSlice'
- createCondition: Ensure an error is returned when len(reason) > 1