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/11/09 11:45:28 UTC

[GitHub] [skywalking-swck] dashanji opened a new pull request #46: add e2e test

dashanji opened a new pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46


   The PR is to add e2e-test based on the [infra-e2e](https://github.com/apache/skywalking-infra-e2e) so that we can test swck locally.
   
   we can use `make e2e-test` to test the agent and oapserver.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-970081554


   @kezhenxu94 @wankai123 @wu-sheng Would you mention reviewing this once more


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750073927



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       This is now unused and show be removed

##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       This is now unused and should be removed




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r746243918



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30

Review comment:
       ok, I will try 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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750282587



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       OK, thanks a lot.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750078239



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       Take this as an example of how to install required tools in e2e, the idea is not to involve other tools (`make` in this case) as mush as possible when running an e2e case
   
   https://github.com/apache/skywalking/blob/b63008c61e1fcb1d69b25a8be7ce99f1d987a175/test/e2e-v2/cases/istio/als/e2e.yaml#L30-L36




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748793201



##########
File path: .github/workflows/go.yml
##########
@@ -80,9 +80,28 @@ jobs:
         run: ./hack/install-kubebuilder.sh
       - name: tests
         run: make test
+  e2e-tests:
+    name: e2e tests(oap+ui+agent)
+    runs-on: ubuntu-20.04

Review comment:
       ok




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r746242802



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30
+    - name: setup oapserver and ui
+      command: |
+        kubectl create -f config/operator/samples/default.yaml
+      wait:
+        - namespace: default
+          resource: OAPServer/default
+          for: condition=Available
+        - namespace: default
+          resource: UI/default
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace default swck-injection=enabled
+        sed 's/oapserver-clusterip/'$(kubectl get svc default-oap -o go-template --template='{{.spec.clusterIP}}')'/' test/e2e/demo.yaml | kubectl create -f -
+      wait:
+        - namespace: default
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: default
+        resource: service/demo 
+        port: 8085
+      - namespace: default
+        resource: service/default-oap
+        port: 12800
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:

Review comment:
       ok




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wu-sheng commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748861974



##########
File path: test/e2e/verify/endpoint.yaml
##########
@@ -0,0 +1,19 @@
+# Licensed to the 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.
+# The 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.
+
+{{- contains .}}
+- id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "{GET}/hello" }}
+  name: '{GET}/hello'

Review comment:
       Yes, it is better to use 8.8.0 agent. The format of endpoint name is not changed randomly, this is a big decision.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750139675



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       ok, get 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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r749042915



##########
File path: test/e2e/kind.yaml
##########
@@ -0,0 +1,41 @@
+# Licensed to the 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.
+# The 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.
+
+# this config file contains all config fields with comments
+# NOTE: this is not a particularly useful config file
+kind: Cluster

Review comment:
       What's the objective for this file?




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily merged pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily merged pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46


   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748852156



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config

Review comment:
       ok, get it

##########
File path: .github/workflows/go.yml
##########
@@ -80,9 +80,28 @@ jobs:
         run: ./hack/install-kubebuilder.sh
       - name: tests
         run: make test
+  e2e-tests:
+    name: e2e tests(oap+ui+agent)
+    runs-on: ubuntu-latest
+    steps:
+      - name: Install Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: 1.17
+        id: go
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v2
+      - name: Update dependencies
+        run: GOPROXY=https://proxy.golang.org go mod download
+      - name: Prepare E2E
+        run: make prepare-e2e-test
+      - name: Run E2E Test
+        uses: apache/skywalking-infra-e2e@main      # always prefer to use a revision instead of `main`.

Review comment:
       ok




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r749064934



##########
File path: test/e2e/kind.yaml
##########
@@ -0,0 +1,41 @@
+# Licensed to the 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.
+# The 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.
+
+# this config file contains all config fields with comments
+# NOTE: this is not a particularly useful config file
+kind: Cluster

Review comment:
       The file is the configuration of the `kind` cluster, we can specify the proper image version of `kind`.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r745608218



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       This should be in `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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r747540143



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30
+    - name: setup oapserver and ui
+      command: |
+        kubectl create -f config/operator/samples/default.yaml
+      wait:
+        - namespace: default
+          resource: OAPServer/default
+          for: condition=Available
+        - namespace: default
+          resource: UI/default
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace default swck-injection=enabled
+        sed 's/oapserver-clusterip/'$(kubectl get svc default-oap -o go-template --template='{{.spec.clusterIP}}')'/' test/e2e/demo.yaml | kubectl create -f -

Review comment:
       get, thanks.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wankai123 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
wankai123 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748855804



##########
File path: test/e2e/verify/endpoint.yaml
##########
@@ -0,0 +1,19 @@
+# Licensed to the 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.
+# The 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.
+
+{{- contains .}}
+- id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "{GET}/hello" }}
+  name: '{GET}/hello'

Review comment:
       I‘m curious about the endpoint is `{GET}/hello`, not `GET:/hello`, we have changed spring endpoint name to `METHOD:URI` since java-agent 8.8.0




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964222360


   > You could make a PR in WIP status to avoid this case.
   
   Ok, I learned it, thanks a lot.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r745624244



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       ok




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964173654


   > > > It seems not add to Github action workflow?
   > > 
   > > 
   > > Yes, thanks for the reminder, after the storage component test is completed, I will add it together.
   > 
   > What do you mean by this? Is this PR going to merge or just be WIP?
   
   yes, this PR is WIP, the storage component has not been tested yet, I will add it later.


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748852226



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        bash hack/wait-webhook.sh
+    - name: setup oapserver and ui
+      command: |
+        kubectl create namespace skywalking-system
+        kubectl apply -f test/e2e/skywalking-components.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: OAPServer/skywalking-system
+          for: condition=Available
+        - namespace: skywalking-system
+          resource: UI/skywalking-system
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace skywalking-system swck-injection=enabled
+        kubectl apply -f test/e2e/demo.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: skywalking-system
+        resource: service/demo 
+        port: 8085
+      - namespace: skywalking-system
+        resource: service/skywalking-system-oap
+        port: 12800
+      - namespace: skywalking-system
+        resource: service/skywalking-system-ui
+        port: 80
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql service ls
+      expected: verify/service.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName
+      expected: verify/endpoint.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name {GET}/hello --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: 'curl -s \
+            --request POST \
+            --header "Content-Type: application/json;charset=UTF-8" \
+            --data ''{"query":"query queryEndpoints($serviceId: ID!, $keyword: String!) {\n    getEndpoints: searchEndpoint(serviceId: $serviceId, keyword: $keyword, limit: 100) {\n      key: id\n      label: name\n    }\n}","variables":{serviceId: "WW91cl9BcHBsaWNhdGlvbk5hbWU=.1", keyword: ""}}'' \
+            http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80} 2>&1 | yq e ".data.getEndpoints" -P -'

Review comment:
       I want to simulate the UI request to test whether the UI is normal.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748851072



##########
File path: .github/workflows/go.yml
##########
@@ -80,9 +80,28 @@ jobs:
         run: ./hack/install-kubebuilder.sh
       - name: tests
         run: make test
+  e2e-tests:
+    name: e2e tests(oap+ui+agent)
+    runs-on: ubuntu-latest
+    steps:
+      - name: Install Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: 1.17
+        id: go
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v2
+      - name: Update dependencies
+        run: GOPROXY=https://proxy.golang.org go mod download
+      - name: Prepare E2E
+        run: make prepare-e2e-test
+      - name: Run E2E Test
+        uses: apache/skywalking-infra-e2e@main      # always prefer to use a revision instead of `main`.

Review comment:
       ### always prefer to use a revision instead of `main`.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r749063661



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4

Review comment:
       ok, get 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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r745608829



##########
File path: hack/prepare-e2e.sh
##########
@@ -0,0 +1,108 @@
+
+#!/usr/bin/env bash
+
+#
+# Licensed to the 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.
+# The 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.
+
+OS=$(go env GOOS)
+ARCH=$(go env GOHOSTARCH)
+
+INSTALL_DIR=/usr/local/bin
+IMAGE_FILE=test/e2e/e2e.yaml
+
+prepare_ok=true
+# install e2e
+function install_e2e()
+{
+    if ! command -v e2e &> /dev/null; then
+      echo "please refer https://github.com/apache/skywalking-infra-e2e/blob/main/docs/en/contribution/Compiling-Guidance.md to install e2e!"
+      $prepare_ok=false
+    fi
+}

Review comment:
       This is no needed if https://github.com/apache/skywalking-swck/pull/46/files#r745608218

##########
File path: hack/prepare-e2e.sh
##########
@@ -0,0 +1,108 @@
+
+#!/usr/bin/env bash
+
+#
+# Licensed to the 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.
+# The 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.
+
+OS=$(go env GOOS)
+ARCH=$(go env GOHOSTARCH)
+
+INSTALL_DIR=/usr/local/bin
+IMAGE_FILE=test/e2e/e2e.yaml
+
+prepare_ok=true
+# install e2e
+function install_e2e()
+{
+    if ! command -v e2e &> /dev/null; then
+      echo "please refer https://github.com/apache/skywalking-infra-e2e/blob/main/docs/en/contribution/Compiling-Guidance.md to install e2e!"
+      $prepare_ok=false
+    fi
+}
+# install docker
+function install_docker()
+{
+    if ! command -v docker &> /dev/null; then
+      echo "please refer https://docs.docker.com/get-docker/ to install docker!"
+      $prepare_ok=false
+    fi 
+}
+# install kind
+function install_kind()
+{
+    if ! command -v kind &> /dev/null; then
+      echo "please refer https://kind.sigs.k8s.io/docs/user/quick-start to install kind!"
+      $prepare_ok=false
+    fi
+}

Review comment:
       This is not needed




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748862279



##########
File path: test/e2e/verify/endpoint.yaml
##########
@@ -0,0 +1,19 @@
+# Licensed to the 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.
+# The 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.
+
+{{- contains .}}
+- id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "{GET}/hello" }}
+  name: '{GET}/hello'

Review comment:
       ok, I will change 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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750073927



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       This target `e2e-test` is now unused and should be removed




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750067987



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       @kezhenxu94 Would you pls recheck this? 




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wu-sheng commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750274845



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       This looks like some DNS or network issue about docker pull :) I used to face one on local KinD due to accidentally set up proxy for the terminal of running KinD.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r746146320



##########
File path: hack/prepare-e2e.sh
##########
@@ -0,0 +1,82 @@
+
+#!/usr/bin/env bash
+
+#
+# Licensed to the 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.
+# The 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.
+
+OS=$(go env GOOS)
+ARCH=$(go env GOHOSTARCH)
+
+INSTALL_DIR=/usr/local/bin
+IMAGE_FILE=test/e2e/e2e.yaml
+
+prepare_ok=true
+# install kubectl
+function install_kubectl()
+{
+    if ! command -v kubectl &> /dev/null; then
+      echo "please refer https://kubernetes.io/docs/tasks/tools/#install-kubectl to install kubectl!"
+      $prepare_ok=false
+    fi
+}
+# install swctl
+function install_swctl()
+{
+    if ! command -v swctl &> /dev/null; then
+      echo "please refer https://github.com/apache/skywalking-cli to install swctl!"

Review comment:
       We can install it by `go install`, and specify the version as well.

##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30

Review comment:
       How about applying CR in a loop to check webhook is ready? A simple waiting will cause the test to flaky. The Github action task might be very slower than our expectation due to the cloud environment. 
   
   

##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30
+    - name: setup oapserver and ui
+      command: |
+        kubectl create -f config/operator/samples/default.yaml
+      wait:
+        - namespace: default
+          resource: OAPServer/default
+          for: condition=Available
+        - namespace: default
+          resource: UI/default
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace default swck-injection=enabled
+        sed 's/oapserver-clusterip/'$(kubectl get svc default-oap -o go-template --template='{{.spec.clusterIP}}')'/' test/e2e/demo.yaml | kubectl create -f -

Review comment:
       Please deploy skywalking components to another namespace instead of `default`.
   
   For example, `skywalking-system`. If that, pls to use`skywalking-system-oap.skywalking-system:11800` to set up the backend address of the injected agent. 

##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30
+    - name: setup oapserver and ui
+      command: |
+        kubectl create -f config/operator/samples/default.yaml
+      wait:
+        - namespace: default
+          resource: OAPServer/default
+          for: condition=Available
+        - namespace: default
+          resource: UI/default
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace default swck-injection=enabled
+        sed 's/oapserver-clusterip/'$(kubectl get svc default-oap -o go-template --template='{{.spec.clusterIP}}')'/' test/e2e/demo.yaml | kubectl create -f -
+      wait:
+        - namespace: default
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: default
+        resource: service/demo 
+        port: 8085
+      - namespace: default
+        resource: service/default-oap
+        port: 12800
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:

Review comment:
       Would you pls add more cases to verify `UI` server? I don't intend to verify how the UI renders the page, but to touch the `ui_host`:`ui_port`/graphql, which would help us know whether the UI server works. 




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r746156829



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,106 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        sleep 30

Review comment:
       Another path is to drop this step. Add the loop to the next instead. If the `kubectl create` failed, rerun it repeatedly until timeout.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750076865



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       Can you put `hack/prepare-e2e.sh` into `e2e.yaml` `steps` section and remove this target in makefile, so that we can directly issue command `e2e run -c test/e2e/e2e.yaml` instead of wrapping it in `make e2e-test`




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r749039833



##########
File path: hack/wait-webhook.sh
##########
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the 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.
+# The 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.
+
+TIMEOUT=60
+
+MANIFEST=$(mktemp)
+
+cat <<EOF > $MANIFEST
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: OAPServer
+metadata:
+  name: dummy
+spec:
+  version: 8.8.1
+  instances: 1
+  image: apache/skywalking-oap-server:8.8.1
+EOF
+
+timeout $TIMEOUT bash -c -- "\
+    while ! kubectl create -f $MANIFEST 2> /dev/null; \
+    do \
+      sleep 0.1; \
+    done"
+
+# make sure the dummy OAPServer will be deleted
+trap "kubectl delete OAPServer dummy; rm $MANIFEST" 0 2 3 15   

Review comment:
       It's nice to clean up resources here.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748861008



##########
File path: test/e2e/verify/endpoint.yaml
##########
@@ -0,0 +1,19 @@
+# Licensed to the 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.
+# The 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.
+
+{{- contains .}}
+- id: {{ b64enc "Your_ApplicationName" }}.1_{{ b64enc "{GET}/hello" }}
+  name: '{GET}/hello'

Review comment:
       the java agent injected is `java-agent 8.7.0`, should we change it into `java-agent 8.8.0`?




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750078239



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       Take this as an example of how to install required tools in e2e, the idea is not to involve other tools (`make` in this case) as mush as possible
   
   https://github.com/apache/skywalking/blob/b63008c61e1fcb1d69b25a8be7ce99f1d987a175/test/e2e-v2/cases/istio/als/e2e.yaml#L30-L36




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750253654



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       I have a small question here, I think we need to pull the required images firstly as `(install_images function) in hack/prepare-e2e.sh`, this is why `hack/prepare-e2e.sh` is executed before `e2e run -c test/e2e/e2e.yaml`. For other tools, I think we can add them in the `steps`  section.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750279407



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       >  I don’t know if my environment settings cause the e2e to fail.
   
   I tend to believe that that's your local env issue. Let's ensure e2e is working, then I will help you fix that.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748854152



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        bash hack/wait-webhook.sh
+    - name: setup oapserver and ui
+      command: |
+        kubectl create namespace skywalking-system
+        kubectl apply -f test/e2e/skywalking-components.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: OAPServer/skywalking-system
+          for: condition=Available
+        - namespace: skywalking-system
+          resource: UI/skywalking-system
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace skywalking-system swck-injection=enabled
+        kubectl apply -f test/e2e/demo.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: skywalking-system
+        resource: service/demo 
+        port: 8085
+      - namespace: skywalking-system
+        resource: service/skywalking-system-oap
+        port: 12800
+      - namespace: skywalking-system
+        resource: service/skywalking-system-ui
+        port: 80
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql service ls
+      expected: verify/service.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName
+      expected: verify/endpoint.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name {GET}/hello --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: 'curl -s \
+            --request POST \
+            --header "Content-Type: application/json;charset=UTF-8" \
+            --data ''{"query":"query queryEndpoints($serviceId: ID!, $keyword: String!) {\n    getEndpoints: searchEndpoint(serviceId: $serviceId, keyword: $keyword, limit: 100) {\n      key: id\n      label: name\n    }\n}","variables":{serviceId: "WW91cl9BcHBsaWNhdGlvbk5hbWU=.1", keyword: ""}}'' \
+            http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80} 2>&1 | yq e ".data.getEndpoints" -P -'

Review comment:
       Make sense to me, thanks a lot.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r749041145



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4

Review comment:
       We don't have to specify the tag in case that this is for the latest code.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wu-sheng commented on pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964209242


   You could make a PR in WIP status to avoid this case. 


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] hanahmily commented on pull request #46: [WIP]add e2e test

Posted by GitBox <gi...@apache.org>.
hanahmily commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964656531


   @dashanji 
   
   Could you introduce the GitHub action workflow in this? I noticed you mentioned that the `Storage` case should be part of this. But I prefer to split it into two workflows:
    - OAP+UI, which is a quick start for most new users. I would like to introduce it in this.
    - OAP+UI+Storage, which is a comprehensive version. Let's add it in the following-up PRs.
   
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r747865227



##########
File path: .github/workflows/go.yml
##########
@@ -80,9 +80,28 @@ jobs:
         run: ./hack/install-kubebuilder.sh
       - name: tests
         run: make test
+  e2e-tests:
+    name: e2e tests(oap+ui+agent)
+    runs-on: ubuntu-20.04

Review comment:
       Let’s use `ubuntu-latest`




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748851679



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        bash hack/wait-webhook.sh
+    - name: setup oapserver and ui
+      command: |
+        kubectl create namespace skywalking-system
+        kubectl apply -f test/e2e/skywalking-components.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: OAPServer/skywalking-system
+          for: condition=Available
+        - namespace: skywalking-system
+          resource: UI/skywalking-system
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace skywalking-system swck-injection=enabled
+        kubectl apply -f test/e2e/demo.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: skywalking-system
+        resource: service/demo 
+        port: 8085
+      - namespace: skywalking-system
+        resource: service/skywalking-system-oap
+        port: 12800
+      - namespace: skywalking-system
+        resource: service/skywalking-system-ui
+        port: 80
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql service ls
+      expected: verify/service.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName
+      expected: verify/endpoint.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name {GET}/hello --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: 'curl -s \
+            --request POST \
+            --header "Content-Type: application/json;charset=UTF-8" \
+            --data ''{"query":"query queryEndpoints($serviceId: ID!, $keyword: String!) {\n    getEndpoints: searchEndpoint(serviceId: $serviceId, keyword: $keyword, limit: 100) {\n      key: id\n      label: name\n    }\n}","variables":{serviceId: "WW91cl9BcHBsaWNhdGlvbk5hbWU=.1", keyword: ""}}'' \
+            http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80} 2>&1 | yq e ".data.getEndpoints" -P -'

Review comment:
       Why do you use a raw `curl` to query, doesn't `swctl endpoint list ......` help?

##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config

Review comment:
       It's better not to override the users' Kubernetes config file, just set the config context via env var or in command line option




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750073927



##########
File path: Makefile
##########
@@ -50,6 +50,13 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:
+	@echo "Prepare e2e..."
+	-hack/prepare-e2e.sh

Review comment:
       This is not unused and show be removed




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] kezhenxu94 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750269483



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       > I have a small question here, I think we need to pull the required images firstly as `(install_images function) in hack/prepare-e2e.sh`, this is why `hack/prepare-e2e.sh` is executed before `e2e run -c test/e2e/e2e.yaml`. For other tools, I think we can add them in the `steps` section.
   
   ```
          - quay.io/jetstack/cert-manager-cainjector:v1.3.1
          - quay.io/jetstack/cert-manager-controller:v1.3.1
          - quay.io/jetstack/cert-manager-webhook:v1.3.1
          - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
          - docker.io/apache/skywalking-oap-server:8.8.1
          - docker.io/apache/skywalking-ui:8.8.1
          - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
          - docker.io/apache/skywalking-java-agent:8.8.0-java8
   ```
   
   These are all public images, right?
   
   For public Docker images, they can be pulled inside KinD when needed, so you don't have to pull firstly




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wankai123 commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
wankai123 commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r748853544



##########
File path: test/e2e/e2e.yaml
##########
@@ -0,0 +1,117 @@
+# Licensed to the 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.
+# The 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.
+
+setup:
+  env: kind
+  file: kind.yaml
+  steps:
+    - name: install cert-manager
+      command: |
+        # kind k8s cluster is in $TMPDIR
+        mkdir -p ~/.kube
+        cp $TMPDIR/e2e-k8s.config ~/.kube/config
+        kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
+      wait:
+        - namespace: cert-manager
+          resource: pod
+          for: condition=Ready
+    - name: install operator
+      command: |
+        export OPERATOR_IMG=controller:v0.4
+        make operator-docker-build   
+        kind load docker-image controller:v0.4
+        make operator-install
+        make operator-deploy
+      wait:
+        - namespace: skywalking-swck-system
+          resource: pod
+          for: condition=Ready
+    - name: wait webhook installing
+      command: |
+        bash hack/wait-webhook.sh
+    - name: setup oapserver and ui
+      command: |
+        kubectl create namespace skywalking-system
+        kubectl apply -f test/e2e/skywalking-components.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: OAPServer/skywalking-system
+          for: condition=Available
+        - namespace: skywalking-system
+          resource: UI/skywalking-system
+          for: condition=Available
+    - name: setup java agent demo
+      command: |
+        kubectl label namespace skywalking-system swck-injection=enabled
+        kubectl apply -f test/e2e/demo.yaml
+      wait:
+        - namespace: skywalking-system
+          resource: deployment/demo
+          for: condition=Available 
+  kind:
+    import-images:
+      - quay.io/jetstack/cert-manager-cainjector:v1.3.1
+      - quay.io/jetstack/cert-manager-controller:v1.3.1
+      - quay.io/jetstack/cert-manager-webhook:v1.3.1
+      - docker.io/kubesphere/kube-rbac-proxy:v0.4.1
+      - docker.io/apache/skywalking-oap-server:8.8.1
+      - docker.io/apache/skywalking-ui:8.8.1
+      - ghcr.io/apache/skywalking-swck-spring-demo:v0.0.1
+      - docker.io/apache/skywalking-java-agent:8.7.0-jdk8
+    expose-ports:
+      - namespace: skywalking-system
+        resource: service/demo 
+        port: 8085
+      - namespace: skywalking-system
+        resource: service/skywalking-system-oap
+        port: 12800
+      - namespace: skywalking-system
+        resource: service/skywalking-system-ui
+        port: 80
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+trigger:
+  action: http
+  interval: 30s
+  times: 5
+  url: http://${service_demo_host}:${service_demo_8085}/hello
+  method: GET
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 10
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 10s
+  cases:
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql service ls
+      expected: verify/service.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name service_cpm --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName
+      expected: verify/endpoint.yaml
+    - query: swctl --display yaml --base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name {GET}/hello --service-name Your_ApplicationName | yq e 'to_entries' -
+      expected: verify/metrics.yaml
+    - query: 'curl -s \
+            --request POST \
+            --header "Content-Type: application/json;charset=UTF-8" \
+            --data ''{"query":"query queryEndpoints($serviceId: ID!, $keyword: String!) {\n    getEndpoints: searchEndpoint(serviceId: $serviceId, keyword: $keyword, limit: 100) {\n      key: id\n      label: name\n    }\n}","variables":{serviceId: "WW91cl9BcHBsaWNhdGlvbk5hbWU=.1", keyword: ""}}'' \
+            http://${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80} 2>&1 | yq e ".data.getEndpoints" -P -'

Review comment:
       you can use `swctl endpoint list` query `${service_skywalking_system_ui_host}:${service_skywalking_system_ui_80}` directly.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] wu-sheng commented on pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964170108


   > > It seems not add to Github action workflow?
   > 
   > Yes, thanks for the reminder, after the storage component test is completed, I will add it together.
   
   What do you mean by this? Is this PR going to merge or just be WIP?


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#issuecomment-964168787


   > It seems not add to Github action workflow?
   
   Yes, thanks for the reminder, after the storage component test is completed, I will add it together.
   
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r745627100



##########
File path: hack/prepare-e2e.sh
##########
@@ -0,0 +1,108 @@
+
+#!/usr/bin/env bash
+
+#
+# Licensed to the 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.
+# The 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.
+
+OS=$(go env GOOS)
+ARCH=$(go env GOHOSTARCH)
+
+INSTALL_DIR=/usr/local/bin
+IMAGE_FILE=test/e2e/e2e.yaml
+
+prepare_ok=true
+# install e2e
+function install_e2e()
+{
+    if ! command -v e2e &> /dev/null; then
+      echo "please refer https://github.com/apache/skywalking-infra-e2e/blob/main/docs/en/contribution/Compiling-Guidance.md to install e2e!"
+      $prepare_ok=false
+    fi
+}
+# install docker
+function install_docker()
+{
+    if ! command -v docker &> /dev/null; then
+      echo "please refer https://docs.docker.com/get-docker/ to install docker!"
+      $prepare_ok=false
+    fi 
+}
+# install kind
+function install_kind()
+{
+    if ! command -v kind &> /dev/null; then
+      echo "please refer https://kind.sigs.k8s.io/docs/user/quick-start to install kind!"
+      $prepare_ok=false
+    fi
+}

Review comment:
       ok, I will delete the function `install_e2e` 、`install_docker ` and `install_kind `, thanks a lot.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-swck] dashanji commented on a change in pull request #46: add e2e test[OAP+UI+Agent]

Posted by GitBox <gi...@apache.org>.
dashanji commented on a change in pull request #46:
URL: https://github.com/apache/skywalking-swck/pull/46#discussion_r750272959



##########
File path: Makefile
##########
@@ -50,6 +50,18 @@ clean:
 test: generate operator-manifests
 	go test ./... -coverprofile cover.out
 
+# Run e2e-test
+e2e-test:

Review comment:
       Yes, these are public images. But I have tested the `e2e` in the local machine and in the github action. In the local machine, we need to pull the image and load the images to kind, then the `e2e` can work, If we don't do so, the `e2e` may not work. In the github action, it can work whether we load the images to kind. I don’t know if my environment settings cause the `e2e` to fail.




-- 
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: notifications-unsubscribe@skywalking.apache.org

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