-
Notifications
You must be signed in to change notification settings - Fork 929
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
Tst:mock etcd and nacos in ut #1873
Conversation
comment for blank (apache#1755)
Codecov Report
@@ Coverage Diff @@
## 3.0 #1873 +/- ##
==========================================
- Coverage 46.80% 45.12% -1.69%
==========================================
Files 295 295
Lines 17178 17178
==========================================
- Hits 8041 7751 -290
- Misses 8285 8595 +310
+ Partials 852 832 -20
Continue to review full report at Codecov.
|
config_center/nacos/impl_test.go
Outdated
} | ||
type args struct { | ||
group string | ||
} |
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.
如上
config_center/nacos/impl_test.go
Outdated
client: tt.fields.client, | ||
keyListeners: tt.fields.keyListeners, | ||
parser: tt.fields.parser, | ||
} |
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.
如果 n 和 tt.fields 类型相同,则可以这么写:
n := &nacosDynamicConfiguration{}
*n = tt.fields
不行就封装一个函数出来,我看你别的地方也有类似的逻辑,写一个函数也好复用。
registry/etcdv3/registry_test.go
Outdated
listenerLock: tt.fields.listenerLock, | ||
listener: tt.fields.listener, | ||
dataListener: tt.fields.dataListener, | ||
configListener: tt.fields.configListener, |
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.
如上。
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.
LGTM
What this PR does:
mock etcd and nacos in ut
Which issue(s) this PR fixes:
Fixes #
You should pay attention to items below to ensure your pr passes our ci test
We do not merge pr with ci tests failed