[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-28 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r775790164



##
File path: eventbase/datasource/etcd/task/task_dao_test.go
##
@@ -46,29 +43,29 @@ func init() {
 func TestTask(t *testing.T) {

Review comment:
   UT应该提交到更上层,不要依赖具体实现,比如etcd,而是针对接口做测试,UT里控制具体实现




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-28 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r775787781



##
File path: eventbase/service/tombstone/tombstone_svc.go
##
@@ -23,18 +23,18 @@ import (
"github.com/go-chassis/cari/sync"
 
"github.com/apache/servicecomb-service-center/eventbase/datasource"
-   "github.com/apache/servicecomb-service-center/eventbase/request"
+   "github.com/apache/servicecomb-service-center/eventbase/domain"

Review comment:
   叫model吧,保持风格一致




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-23 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r774892026



##
File path: eventbase/datasource/tlsutil/tlsutil_test.go
##
@@ -29,7 +29,7 @@ import (

"github.com/apache/servicecomb-service-center/eventbase/datasource/tlsutil"
 )
 
-const sslRoot = "./../../../examples/service_center/ssl/"
+const sslRoot = "./../../test/ssl/"

Review comment:
   请不要再上传任何测试文件,go的test pkg现在提供临时目录特性,google下




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-23 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r774891751



##
File path: eventbase/README.md
##
@@ -0,0 +1,15 @@
+# eventbase
+
+eventbase provides the crud interface of task and tombstone.
+
+### package
+
+**bootstrap**:used to start initial loading.
+
+**datasource**: realize the dao operation of etcd and mongo on task and 
tombstone.
+
+**request**: task and tombstone request.

Review comment:
   request是否没必要专门提供一个pkg,直接放到service




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-23 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r774891244



##
File path: eventbase/datasource/etcd/task/task_dao_test.go
##
@@ -141,6 +138,13 @@ func TestTask(t *testing.T) {
t.Run("delete tasks should pass", func(t *testing.T) {
err := ds.TaskDao().Delete(context.Background(), 
[]*sync.Task{, , }...)
assert.NoError(t, err)
+   opts := []datasource.TaskFindOption{
+   datasource.WithDomain("default"),

Review comment:
   
这里没错,不要被我上一个comment引导错误,因为domain和project不该提供默认值,我认为2个都是不该有默认值的,所以的确应该指明参数来查询




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-23 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r774890406



##
File path: eventbase/datasource/mongo/tombstone/tombstone_dao_test.go
##
@@ -87,10 +89,10 @@ func TestTombstone(t *testing.T) {
})
 
t.Run("list tombstone", func(t *testing.T) {
-   t.Run("list tombstone with ResourceType and BeforeTimestamp 
should pass", func(t *testing.T) {
+   t.Run("list tombstone with Domain, Project ,ResourceType and 
BeforeTimestamp should pass", func(t *testing.T) {
opts := []datasource.TombstoneFindOption{
datasource.WithTombstoneDomain("default"),
-   datasource.WithTombstoneProject("default"),
+   datasource.WithTombstoneDomain("default"),

Review comment:
   作为默认就不该让调用方自己填默认值




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1185: [feat] add task and tombstone ut in eventbase

2021-12-23 Thread GitBox


tianxiaoliang commented on a change in pull request #1185:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1185#discussion_r774890191



##
File path: eventbase/test/ssl/cert_pwd
##
@@ -0,0 +1 @@
+Changeme_123

Review comment:
   不必考虑paasphase了,已经被证实有漏洞了




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org