You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/06 13:04:24 UTC
[GitHub] [skywalking-infra-e2e] fgksgf opened a new pull request #7: Implement the verification of the actual data file
fgksgf opened a new pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7
- [ ] move the precheck to setup
- [ ] Implement the provided template functions
- [ ] Implement the verification of the actual data file
Because it's a bit complicated, the implementation of actions (in the `third-party` dir) will be in the next PR.
You can ignore the files in `third-parth` dir at this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] fgksgf commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
fgksgf commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571519505
##########
File path: commands/setup/setup.go
##########
@@ -21,19 +21,30 @@ package setup
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/setup"
"github.com/apache/skywalking-infra-e2e/internal/config"
-
"github.com/apache/skywalking-infra-e2e/internal/constant"
+ "github.com/apache/skywalking-infra-e2e/internal/logger"
+ "github.com/apache/skywalking-infra-e2e/internal/util"
"github.com/spf13/cobra"
-
- "github.com/apache/skywalking-infra-e2e/internal/components/setup"
- "github.com/apache/skywalking-infra-e2e/internal/logger"
)
var Setup = &cobra.Command{
Use: "setup",
Short: "",
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+ err := util.CheckDockerDaemon()
+ if err != nil {
+ return err
+ }
+
+ err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
Review comment:
If we put `config.ReadGlobalConfigFile(constant.E2EDefaultFile)` in root command, we will not be able to verify with flags when there is no config file.
Maybe we should define an error type, like `CfgFileNotExistError`? If the returned error is that, then just log the information.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] Humbertzhang commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
Humbertzhang commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571553670
##########
File path: commands/setup/setup.go
##########
@@ -21,19 +21,30 @@ package setup
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/setup"
"github.com/apache/skywalking-infra-e2e/internal/config"
-
"github.com/apache/skywalking-infra-e2e/internal/constant"
+ "github.com/apache/skywalking-infra-e2e/internal/logger"
+ "github.com/apache/skywalking-infra-e2e/internal/util"
"github.com/spf13/cobra"
-
- "github.com/apache/skywalking-infra-e2e/internal/components/setup"
- "github.com/apache/skywalking-infra-e2e/internal/logger"
)
var Setup = &cobra.Command{
Use: "setup",
Short: "",
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+ err := util.CheckDockerDaemon()
+ if err != nil {
+ return err
+ }
+
+ err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
Review comment:
I think change `GlobalE2EConfig.Ready` to `GlobalE2EConfig.Error` and check it before use it is appropriate. It can meet the needs of a variety of situations.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] fgksgf commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
fgksgf commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571520080
##########
File path: commands/verify/verify.go
##########
@@ -15,18 +14,36 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
+
package verify
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/verifier"
+
"github.com/spf13/cobra"
)
+var (
+ query string
+ actual string
+ expected string
+)
+
+func init() {
+ Verify.Flags().StringVarP(&query, "query", "q", "", "the query to get the actual data, the result of the query should in YAML format")
+ Verify.Flags().StringVarP(&actual, "actual", "a", "", "the actual data file, only YAML file format is supported")
+ Verify.Flags().StringVarP(&expected, "expected", "e", "", "the expected data file, only YAML file format is supported")
+}
+
var Verify = &cobra.Command{
Use: "verify",
- Short: "",
+ Short: "verify if the actual data match the expected data",
RunE: func(cmd *cobra.Command, args []string) error {
+ if actual != "" && expected != "" {
+ return verifier.VerifyDataFile(actual, expected)
+ }
fmt.Println("Not implemented.")
return nil
Review comment:
Because I only implemented the scenario that `--actual` and `--expected` are given in this PR. So I kept it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571521879
##########
File path: LICENSE
##########
@@ -235,3 +235,12 @@ The following components are provided under the MIT license. See project link fo
The text of each license is also included at licenses/LICENSE-[project].txt.
logrus 1.7.0: https://github.com/sirupsen/logrus MIT
+
+========================================================================
+BSD licenses
+========================================================================
+
+The following components are provided under a BSD license. See project link for details.
+The text of each license is also included at licenses/LICENSE-[project].txt.
+
+ third-party/template files from golang/go: https://github.com/golang/go/tree/master/src/text/template BSD
Review comment:
> OK. Do I also need add a file `LICENSE-golang.txt` ?
Yes, can you please also check that whether the exact license is `BSD-3-Clause`? BSD license has several variations
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] wu-sheng merged pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571518977
##########
File path: LICENSE
##########
@@ -235,3 +235,12 @@ The following components are provided under the MIT license. See project link fo
The text of each license is also included at licenses/LICENSE-[project].txt.
logrus 1.7.0: https://github.com/sirupsen/logrus MIT
+
+========================================================================
+BSD licenses
+========================================================================
+
+The following components are provided under a BSD license. See project link for details.
+The text of each license is also included at licenses/LICENSE-[project].txt.
+
+ third-party/template files from golang/go: https://github.com/golang/go/tree/master/src/text/template BSD
Review comment:
This should be also included in `dist/LICENSE` file, please
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] fgksgf commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
fgksgf commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571519937
##########
File path: LICENSE
##########
@@ -235,3 +235,12 @@ The following components are provided under the MIT license. See project link fo
The text of each license is also included at licenses/LICENSE-[project].txt.
logrus 1.7.0: https://github.com/sirupsen/logrus MIT
+
+========================================================================
+BSD licenses
+========================================================================
+
+The following components are provided under a BSD license. See project link for details.
+The text of each license is also included at licenses/LICENSE-[project].txt.
+
+ third-party files from golang/go: https://github.com/golang/go BSD
Review comment:
How about the `third-party/internal` files ? They are also from golang/go
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#issuecomment-774475073
We need to add source dependency license in the root LICENSE file, refer to https://github.com/apache/skywalking/blob/5445b7d53f1b22b88c5770130f3c97b8855bf17e/LICENSE#L215-L226
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] fgksgf commented on pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
fgksgf commented on pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#issuecomment-774477183
> We need to add source dependency license in the root LICENSE file, refer to https://github.com/apache/skywalking/blob/5445b7d53f1b22b88c5770130f3c97b8855bf17e/LICENSE#L215-L226
OK. Why the license-eye does not comment on the PR ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571522468
##########
File path: commands/setup/setup.go
##########
@@ -21,19 +21,30 @@ package setup
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/setup"
"github.com/apache/skywalking-infra-e2e/internal/config"
-
"github.com/apache/skywalking-infra-e2e/internal/constant"
+ "github.com/apache/skywalking-infra-e2e/internal/logger"
+ "github.com/apache/skywalking-infra-e2e/internal/util"
"github.com/spf13/cobra"
-
- "github.com/apache/skywalking-infra-e2e/internal/components/setup"
- "github.com/apache/skywalking-infra-e2e/internal/logger"
)
var Setup = &cobra.Command{
Use: "setup",
Short: "",
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+ err := util.CheckDockerDaemon()
+ if err != nil {
+ return err
+ }
+
+ err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
Review comment:
> If we put `config.ReadGlobalConfigFile(constant.E2EDefaultFile)` in root command, we will not be able to verify with flags when there is no config file.
>
> Maybe we should define an error type, like `CfgFileNotExistError`? If the returned error is that, then just log the information.
This is feasible.
I'm also thinking whether we could simply change `GlobalE2EConfig.Ready` to `GlobalE2EConfig.Exist` or `GlobalE2EConfig.Error`, because if we load it from root command, it's guaranteed that it must be loaded / ready if it exists, so commands that really need the config can check this and use it, or return the error when `GlobalE2EConfig.Error` is non nil.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] fgksgf commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
fgksgf commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571520846
##########
File path: LICENSE
##########
@@ -235,3 +235,12 @@ The following components are provided under the MIT license. See project link fo
The text of each license is also included at licenses/LICENSE-[project].txt.
logrus 1.7.0: https://github.com/sirupsen/logrus MIT
+
+========================================================================
+BSD licenses
+========================================================================
+
+The following components are provided under a BSD license. See project link for details.
+The text of each license is also included at licenses/LICENSE-[project].txt.
+
+ third-party/template files from golang/go: https://github.com/golang/go/tree/master/src/text/template BSD
Review comment:
OK. Do I also need add a file `LICENSE-golang.txt` ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] Humbertzhang commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
Humbertzhang commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571450363
##########
File path: commands/setup/setup.go
##########
@@ -21,19 +21,30 @@ package setup
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/setup"
"github.com/apache/skywalking-infra-e2e/internal/config"
-
"github.com/apache/skywalking-infra-e2e/internal/constant"
+ "github.com/apache/skywalking-infra-e2e/internal/logger"
+ "github.com/apache/skywalking-infra-e2e/internal/util"
"github.com/spf13/cobra"
-
- "github.com/apache/skywalking-infra-e2e/internal/components/setup"
- "github.com/apache/skywalking-infra-e2e/internal/logger"
)
var Setup = &cobra.Command{
Use: "setup",
Short: "",
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+ err := util.CheckDockerDaemon()
+ if err != nil {
+ return err
+ }
+
+ err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
Review comment:
The `config.ReadGlobalConfigFile(constant.E2EDefaultFile)` should in root command? Because other command such as `e2e cleanup` `e2e run` `e2e verify` ... may also need to read the `e2e.yaml`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#issuecomment-774477854
@fgksgf we had a bug in license-eye, https://github.com/apache/skywalking-infra-e2e/pull/8
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] github-actions[bot] commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571436347
##########
File path: internal/components/verifier/verifier.go
##########
@@ -0,0 +1,88 @@
+package verifier
Review comment:
```suggestion
//
// Licensed to Apache Software Foundation (ASF) under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Apache Software Foundation (ASF) licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package verifier
```
<!-- license-eye hidden identification -->
##########
File path: internal/components/verifier/funcs.go
##########
@@ -0,0 +1,54 @@
+package verifier
Review comment:
```suggestion
//
// Licensed to Apache Software Foundation (ASF) under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Apache Software Foundation (ASF) licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package verifier
```
<!-- license-eye hidden identification -->
##########
File path: test/verify/1.actual.yaml
##########
@@ -0,0 +1,24 @@
+nodes:
Review comment:
```suggestion
#
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
nodes:
```
<!-- license-eye hidden identification -->
##########
File path: test/verify/1.expected.yaml
##########
@@ -0,0 +1,24 @@
+nodes:
Review comment:
```suggestion
#
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
nodes:
```
<!-- license-eye hidden identification -->
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a change in pull request #7: Implement the verification of the actual data file
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571445514
##########
File path: LICENSE
##########
@@ -235,3 +235,12 @@ The following components are provided under the MIT license. See project link fo
The text of each license is also included at licenses/LICENSE-[project].txt.
logrus 1.7.0: https://github.com/sirupsen/logrus MIT
+
+========================================================================
+BSD licenses
+========================================================================
+
+The following components are provided under a BSD license. See project link for details.
+The text of each license is also included at licenses/LICENSE-[project].txt.
+
+ third-party files from golang/go: https://github.com/golang/go BSD
Review comment:
```suggestion
third-party/template files from golang/go: https://github.com/golang/go/tree/master/src/text/template BSD
```
##########
File path: commands/verify/verify.go
##########
@@ -15,18 +14,36 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
+
package verify
import (
"fmt"
+ "github.com/apache/skywalking-infra-e2e/internal/components/verifier"
+
"github.com/spf13/cobra"
)
+var (
+ query string
+ actual string
+ expected string
+)
+
+func init() {
+ Verify.Flags().StringVarP(&query, "query", "q", "", "the query to get the actual data, the result of the query should in YAML format")
+ Verify.Flags().StringVarP(&actual, "actual", "a", "", "the actual data file, only YAML file format is supported")
+ Verify.Flags().StringVarP(&expected, "expected", "e", "", "the expected data file, only YAML file format is supported")
+}
+
var Verify = &cobra.Command{
Use: "verify",
- Short: "",
+ Short: "verify if the actual data match the expected data",
RunE: func(cmd *cobra.Command, args []string) error {
+ if actual != "" && expected != "" {
+ return verifier.VerifyDataFile(actual, expected)
+ }
fmt.Println("Not implemented.")
return nil
Review comment:
Since we have an implementation, let's reword this and return an error
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org