This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 774
test: add unit test case for func GetAllPeerIDs #1194
Merged
Merged
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
allencloud
suggested changes
Feb 13, 2020
|
||
// get all peer ids | ||
ids := manager.GetAllPeerIDs(context.Background()) | ||
c.Check(ids, check.DeepEquals, []string{id, id2}) |
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.
CI fails here:
----------------------------------------------------------------------
FAIL: manager_test.go:130: PeerMgrTestSuite.TestGetAllPeerIDs
manager_test.go:157:
c.Check(ids, check.DeepEquals, []string{id, id2})
... obtained []string = []string{"bar-192.168.10.11-1579514426165976773", "foo-192.168.10.11-1579514426165782207"}
... expected []string = []string{"foo-192.168.10.11-1579514426165782207", "bar-192.168.10.11-1579514426165976773"}
OOPS: 3 passed, 1 FAILED
--- FAIL: Test (0.01s)
FAIL
coverage: 86.2% of statements
FAIL github.com/dragonflyoss/Dragonfly/supernode/daemon/mgr/peer 0.400s
make: *** [Makefile:109: unit-test] Error 1
Maybe you can change the code to sort the slice.
Any update? @fenggw-fnst |
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
Codecov Report
@@ Coverage Diff @@
## master #1194 +/- ##
==========================================
+ Coverage 47.72% 47.73% +0.01%
==========================================
Files 115 115
Lines 7254 7254
==========================================
+ Hits 3462 3463 +1
+ Misses 3513 3511 -2
- Partials 279 280 +1
Continue to review full report at Codecov.
|
Sorry for late reply. Done. |
LGTM |
sungjunyoung
pushed a commit
to sungjunyoung/Dragonfly
that referenced
this pull request
May 8, 2022
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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.
Signed-off-by: Guangwen Feng fenggw-fnst@cn.fujitsu.com
Ⅰ. Describe what this PR did
Add unit test case for func GetAllPeerIDs
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
go test github.com/dragonflyoss/Dragonfly/supernode/daemon/mgr/peer -run Test -v
Ⅴ. Special notes for reviews