-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Unit-tests for common/common.go (part 3 of 3) (#186)
* test: Add unit-tests for UnMarshallLimitNamespace (#167) * test: Add two FAILING unit-tests for UnMarshallLimitNamespace (#167) The two failing test cases include: - when namespace has no gateway name then return an error - when namespace has no domain name then return an error In these test-cases we leave the separator (either "/" or "#"), which causes the function to return an error when the gateway name or domain name is missing. In the last two test cases: - when namespace only has gateway name (missing 'namespace/') and domain then return an error - when namespace only has namespace name (missing '/gwName') and domain then return an error the separator (/) is missing along with the namespace or gateway names, causing the function to return the correct error message. * refactor: Add comment to UnMarshallLimitNamespace (#167) * test: Add unit-tests for MarshallNamespace (#167) * test: Add unit-tests for UnMarshallObjectKey (#167) * test: Add unit-tests for HostnamesToStrings (#167) * [test] Optimizations, improvements, and unit tests for common/common.go (part 2 of 3) (#182) * test: Add unit-tests for Contains (#167) * refactor: Add comment to Contains (#167) * test: Add unit-tests for Map (#167) * refactor: Add comment to Map (#167) * refactor: Add names to Map test cases (#167) * test: Add unit-tests for SliceCopy (#167) * refactor: Add comment to SliceCopy (#167) * test: Add unit-tests for ReverseSlice (#167) * refactor: Add comment to ReverseSlice (#167) * test: Add unit-tests for MergeMapStringString (#167) * refactor: Add missing import 'reflect' * fix: Ensure Istio gateways created in the tests are ready ('Programmed') by setting ClusterIP service type (#185) * changelog (#184) * test: Add two test-cases for UnMarshallObjectKey (#167) 1. when valid namespace and empty name (strKey ends with '/') then return valid ObjectKey with namespace only 2. when valid name and empty namespace (strKey starts with '/') then return valid ObjectKey with name only Changes were discussed here: #187 (comment) * test: Delete test case for UnMarshallLimitNamespace The test case "when namespace has no gateway name then return an error" has been removed from the test suite for UnMarshallLimitNamespace. This test case was tightly connected to the implementation of UnMarshallObjectKey, making it impossible to properly test the desired behavior in the context of UnMarshallLimitNamespace. * refactor: Add clarity to the test name Describing the '/' separator as a default one we show that it is a default constant value. --------- Co-authored-by: Guilherme Cassolato <[email protected]> Co-authored-by: Eguzki Astiz Lezaun <[email protected]>
- Loading branch information
1 parent
532cf2e
commit 5255cf7
Showing
2 changed files
with
245 additions
and
0 deletions.
There are no files selected for viewing
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
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