-
Notifications
You must be signed in to change notification settings - Fork 33
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] Optimizations, improvements, and unit tests for common/common.go (part 1 of 3) #176
Merged
didierofrivia
merged 10 commits into
main
from
issue167/test-improvement-for-common-common.go-1
May 8, 2023
Merged
[test] Optimizations, improvements, and unit tests for common/common.go (part 1 of 3) #176
didierofrivia
merged 10 commits into
main
from
issue167/test-improvement-for-common-common.go-1
May 8, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eguzki
reviewed
May 2, 2023
eguzki
reviewed
May 2, 2023
didierofrivia
requested changes
May 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! a few bits to change and others to decide if we want to address them in this PR or not
+ "sigs.k8s.io/controller-runtime/pkg/client" added as an import
…rformance (#167) Refactored the NamespacedNameToObjectKey function to improve its performance by switching from using the strings.Split() function to using the strings.IndexRune() function. This new implementation is approximately 12-13 times faster for large datasets than the previous implementation.
art-tapin
force-pushed
the
issue167/test-improvement-for-common-common.go-1
branch
from
May 3, 2023 12:49
3ba80e6
to
09331da
Compare
- empty environment variable name is not expected - one of the cases was a duplication of an existing one
art-tapin
changed the title
[test] Optimizations, improvements, and unit tests for common/common.go (part 1 of 4)
[test] Optimizations, improvements, and unit tests for common/common.go (part 1 of 3)
May 5, 2023
eguzki
requested changes
May 5, 2023
eguzki
approved these changes
May 5, 2023
didierofrivia
approved these changes
May 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎖️ and extra 🌮 for documenting the functions!
didierofrivia
pushed a commit
that referenced
this pull request
May 17, 2023
…go (part 1 of 3) (#176) * test: Add unit-tests for FetchEnv (#167) * refactor: Add comment for FetchEnv() (#167) * refactor: Add unit-tests for GetDefaultIfNil (#167) * refactor: Add comment for GetDefaultIfNil (#167) * test: Add unit-tests for GetEmptySliceIfNil (#167) * refactor: Add comment for GetEmptySliceIfNil (#167) * test: Add unit-tests for NamespacedNameToObjectKey (#167) + "sigs.k8s.io/controller-runtime/pkg/client" added as an import * refactor: optimize NamespacedNameToObjectKey function for improved performance (#167) Refactored the NamespacedNameToObjectKey function to improve its performance by switching from using the strings.Split() function to using the strings.IndexRune() function. This new implementation is approximately 12-13 times faster for large datasets than the previous implementation. * refactor: delete three meaningless test cases for FetchEnv (#167) - empty environment variable name is not expected - one of the cases was a duplication of an existing one * refactor: get rid two test-cases because of redundancy
didierofrivia
pushed a commit
that referenced
this pull request
May 24, 2023
…go (part 1 of 3) (#176) * test: Add unit-tests for FetchEnv (#167) * refactor: Add comment for FetchEnv() (#167) * refactor: Add unit-tests for GetDefaultIfNil (#167) * refactor: Add comment for GetDefaultIfNil (#167) * test: Add unit-tests for GetEmptySliceIfNil (#167) * refactor: Add comment for GetEmptySliceIfNil (#167) * test: Add unit-tests for NamespacedNameToObjectKey (#167) + "sigs.k8s.io/controller-runtime/pkg/client" added as an import * refactor: optimize NamespacedNameToObjectKey function for improved performance (#167) Refactored the NamespacedNameToObjectKey function to improve its performance by switching from using the strings.Split() function to using the strings.IndexRune() function. This new implementation is approximately 12-13 times faster for large datasets than the previous implementation. * refactor: delete three meaningless test cases for FetchEnv (#167) - empty environment variable name is not expected - one of the cases was a duplication of an existing one * refactor: get rid two test-cases because of redundancy
didierofrivia
pushed a commit
that referenced
this pull request
May 31, 2023
…go (part 1 of 3) (#176) * test: Add unit-tests for FetchEnv (#167) * refactor: Add comment for FetchEnv() (#167) * refactor: Add unit-tests for GetDefaultIfNil (#167) * refactor: Add comment for GetDefaultIfNil (#167) * test: Add unit-tests for GetEmptySliceIfNil (#167) * refactor: Add comment for GetEmptySliceIfNil (#167) * test: Add unit-tests for NamespacedNameToObjectKey (#167) + "sigs.k8s.io/controller-runtime/pkg/client" added as an import * refactor: optimize NamespacedNameToObjectKey function for improved performance (#167) Refactored the NamespacedNameToObjectKey function to improve its performance by switching from using the strings.Split() function to using the strings.IndexRune() function. This new implementation is approximately 12-13 times faster for large datasets than the previous implementation. * refactor: delete three meaningless test cases for FetchEnv (#167) - empty environment variable name is not expected - one of the cases was a duplication of an existing one * refactor: get rid two test-cases because of redundancy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request contains optimizations, improvements, and unit-tests for several functions in the common/common.go file. The changes made are as follows:
Note that this is only the first of three pull requests, and we have only tested 1/3 of the untested functions in the common/common.go file, so there is more work to be done.
This pull request partly closes issue #167.
Coverage: 59.2% of statements