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

[test] Unit-tests for common/k8s_utils.go (part 1 of 3) #190

Merged
merged 13 commits into from
May 23, 2023

Conversation

art-tapin
Copy link
Contributor

@art-tapin art-tapin commented May 19, 2023

This pull request includes code refactorings and the addition of unit tests for multiple functions in common/k8s_utils.go. Comments and unit tests were added to functions:

  • IsObjectTaggedToDelete
  • TagObjectToDelete
  • ReadAnnotationsFromObject
  • ObjectInfo

Note: This is the part 1 of 3 of testing the k8s_utils.go. This pull request only partially closes issue #167, and there may be further updates needed in the future.

Coverage: 71.1%

@art-tapin art-tapin marked this pull request as ready for review May 19, 2023 20:07
@art-tapin art-tapin requested a review from a team as a code owner May 19, 2023 20:07
pkg/common/k8s_utils.go Outdated Show resolved Hide resolved
@eguzki
Copy link
Contributor

eguzki commented May 23, 2023

looking good. Left few comments

pkg/common/k8s_utils_test.go Outdated Show resolved Hide resolved
pkg/common/k8s_utils_test.go Outdated Show resolved Hide resolved
pkg/common/k8s_utils_test.go Outdated Show resolved Hide resolved
pkg/common/k8s_utils_test.go Outdated Show resolved Hide resolved
- Deleted redundant test-case (#190 (comment))

- Generalized the names of objects to 'Kubernetes object' in test-case names

kudos to @guicassolato!
Copy link
Member

@didierofrivia didierofrivia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍶

@art-tapin art-tapin merged commit 29fbaa9 into main May 23, 2023
@art-tapin art-tapin deleted the issue167/tests_for_k8s_utils-1 branch May 23, 2023 15:24
didierofrivia pushed a commit that referenced this pull request May 24, 2023
* test: Add unit-tests to ObjectInfo (#167)

* refactor: Add comment to ObjectInfo (#167)

* test: Add unit-test to ReadAnnotationsFromObject (#167)

* refactor: Add comment to ReadAnnotationsFromObject (#167)

* test: Add unit-test to TagObjectToDelete (#167)

* refactor: Add comment to TagObjectToDelete (#167)

* test: Add unit-tests to IsObjectTaggedToDelete (#167)

* refactor: Add comment to IsObjectTaggedToDelete (#167)

* refactor: run goimporst to pass the code-style check (#167)

* refactor: Rename 'Kind' fields according to CamelCase naming convention

* refactor: Simplify comment to ObjectInfo (#167)

* refactor: Compare maps with DeepEqual instead of looping in TestTagObjectToDelete (#167)

* refactor: Clean the tests for ObjectInfo (#167)

- Deleted redundant test-case (#190 (comment))

- Generalized the names of objects to 'Kubernetes object' in test-case names

kudos to @guicassolato!
didierofrivia pushed a commit that referenced this pull request May 25, 2023
* test: Add unit-tests to ObjectInfo (#167)

* refactor: Add comment to ObjectInfo (#167)

* test: Add unit-test to ReadAnnotationsFromObject (#167)

* refactor: Add comment to ReadAnnotationsFromObject (#167)

* test: Add unit-test to TagObjectToDelete (#167)

* refactor: Add comment to TagObjectToDelete (#167)

* test: Add unit-tests to IsObjectTaggedToDelete (#167)

* refactor: Add comment to IsObjectTaggedToDelete (#167)

* refactor: run goimporst to pass the code-style check (#167)

* refactor: Rename 'Kind' fields according to CamelCase naming convention

* refactor: Simplify comment to ObjectInfo (#167)

* refactor: Compare maps with DeepEqual instead of looping in TestTagObjectToDelete (#167)

* refactor: Clean the tests for ObjectInfo (#167)

- Deleted redundant test-case (#190 (comment))

- Generalized the names of objects to 'Kubernetes object' in test-case names

kudos to @guicassolato!
didierofrivia pushed a commit that referenced this pull request May 31, 2023
* test: Add unit-tests to ObjectInfo (#167)

* refactor: Add comment to ObjectInfo (#167)

* test: Add unit-test to ReadAnnotationsFromObject (#167)

* refactor: Add comment to ReadAnnotationsFromObject (#167)

* test: Add unit-test to TagObjectToDelete (#167)

* refactor: Add comment to TagObjectToDelete (#167)

* test: Add unit-tests to IsObjectTaggedToDelete (#167)

* refactor: Add comment to IsObjectTaggedToDelete (#167)

* refactor: run goimporst to pass the code-style check (#167)

* refactor: Rename 'Kind' fields according to CamelCase naming convention

* refactor: Simplify comment to ObjectInfo (#167)

* refactor: Compare maps with DeepEqual instead of looping in TestTagObjectToDelete (#167)

* refactor: Clean the tests for ObjectInfo (#167)

- Deleted redundant test-case (#190 (comment))

- Generalized the names of objects to 'Kubernetes object' in test-case names

kudos to @guicassolato!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants