From b40f53766d8bfd2e6658eb92effe8b73c099da1e Mon Sep 17 00:00:00 2001 From: wankai123 Date: Thu, 30 Sep 2021 16:37:00 +0800 Subject: [PATCH 1/6] Replace e2e cases to e2e-v2: Lua Nginx/SelfObservability. --- .github/workflows/e2e.so11y.yaml | 2 +- .github/workflows/e2e.yaml | 4 +- CHANGES.md | 2 +- test/e2e-v2/cases/lua/Dockerfile.nginx | 29 +++++ test/e2e-v2/cases/lua/docker-compose.yml | 68 +++++++++++ test/e2e-v2/cases/lua/e2e.yaml | 109 ++++++++++++++++++ .../lua/expected/dependency-instance.yml | 47 ++++++++ .../lua/expected/dependency-services.yml | 59 ++++++++++ .../cases/lua/expected/metrics-has-value.yml | 21 ++++ .../cases/lua/expected/service-endpoint.yml | 29 +++++ .../cases/lua/expected/service-instance.yml | 93 +++++++++++++++ test/e2e-v2/cases/lua/expected/service.yml | 32 +++++ .../e2e-v2/cases/lua/expected/traces-list.yml | 44 +++++++ test/e2e-v2/cases/lua/nginx.conf | 64 ++++++++++ .../cases/simple/auth/docker-compose.yml | 1 + test/e2e-v2/cases/simple/auth/e2e.yaml | 21 ++-- .../simple/expected/dependency-endpoint.yml | 46 ++++++++ .../simple/expected/dependency-instance.yml | 47 ++++++++ .../cases/simple/expected/traces-list.yml | 3 + .../cases/simple/jdk/docker-compose.yml | 1 + test/e2e-v2/cases/simple/jdk/e2e.yaml | 21 ++-- test/e2e-v2/cases/simple/mtls/e2e.yaml | 21 ++-- test/e2e-v2/cases/simple/ssl/e2e.yaml | 21 ++-- test/e2e-v2/cases/so11y/docker-compose.yml | 50 ++++++++ test/e2e-v2/cases/so11y/e2e.yaml | 76 ++++++++++++ .../so11y/expected/metrics-has-value.yml | 21 ++++ .../cases/so11y/expected/service-instance.yml | 24 ++++ test/e2e-v2/cases/so11y/expected/service.yml | 32 +++++ test/e2e-v2/script/env | 2 +- 29 files changed, 949 insertions(+), 41 deletions(-) create mode 100644 test/e2e-v2/cases/lua/Dockerfile.nginx create mode 100644 test/e2e-v2/cases/lua/docker-compose.yml create mode 100644 test/e2e-v2/cases/lua/e2e.yaml create mode 100644 test/e2e-v2/cases/lua/expected/dependency-instance.yml create mode 100644 test/e2e-v2/cases/lua/expected/dependency-services.yml create mode 100644 test/e2e-v2/cases/lua/expected/metrics-has-value.yml create mode 100644 test/e2e-v2/cases/lua/expected/service-endpoint.yml create mode 100644 test/e2e-v2/cases/lua/expected/service-instance.yml create mode 100644 test/e2e-v2/cases/lua/expected/service.yml create mode 100644 test/e2e-v2/cases/lua/expected/traces-list.yml create mode 100644 test/e2e-v2/cases/lua/nginx.conf create mode 100644 test/e2e-v2/cases/simple/expected/dependency-endpoint.yml create mode 100644 test/e2e-v2/cases/simple/expected/dependency-instance.yml create mode 100644 test/e2e-v2/cases/so11y/docker-compose.yml create mode 100644 test/e2e-v2/cases/so11y/e2e.yaml create mode 100644 test/e2e-v2/cases/so11y/expected/metrics-has-value.yml create mode 100644 test/e2e-v2/cases/so11y/expected/service-instance.yml create mode 100644 test/e2e-v2/cases/so11y/expected/service.yml diff --git a/.github/workflows/e2e.so11y.yaml b/.github/workflows/e2e.so11y.yaml index cb3b945190d2..2ea098db5e05 100644 --- a/.github/workflows/e2e.so11y.yaml +++ b/.github/workflows/e2e.so11y.yaml @@ -47,4 +47,4 @@ jobs: if: env.SKIP_CI != 'true' uses: ./.github/actions/e2e-test with: - test_class: org.apache.skywalking.e2e.SO11yE2E + config-file: so11y/jdk/e2e.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index ede7f108f240..15f6188c0ad3 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -47,6 +47,8 @@ jobs: config-file: simple/ssl/e2e.yaml - name: mTLS config-file: simple/mtls/e2e.yaml + - name: Lua Nginx + config-file: lua/e2e.yaml steps: - uses: actions/checkout@v2 with: @@ -67,8 +69,6 @@ jobs: strategy: matrix: case: - - name: Lua Nginx - class: org.apache.skywalking.e2e.LuaE2E - name: Gateway class: org.apache.skywalking.e2e.GatewayE2E - name: Meter diff --git a/CHANGES.md b/CHANGES.md index 59fdffca86cc..c67c065d1191 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ Release Notes. #### OAP Server * Add component definition for `Jackson`. * Fix that zipkin-receiver plugin is not packaged into dist. - +* Replace e2e cases to e2e-v2: Lua Nginx/SelfObservability. #### UI #### Documentation diff --git a/test/e2e-v2/cases/lua/Dockerfile.nginx b/test/e2e-v2/cases/lua/Dockerfile.nginx new file mode 100644 index 000000000000..78b49aa77673 --- /dev/null +++ b/test/e2e-v2/cases/lua/Dockerfile.nginx @@ -0,0 +1,29 @@ +# 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. + +FROM openresty/openresty:1.17.8.2-5-alpine-fat + +ENV COMMIT_HASH=c3cee4841798a147d83b96a10914d4ac0e11d0aa + +WORKDIR /usr/share/skywalking-nginx-lua + +ADD https://github.com/apache/skywalking-nginx-lua/archive/${COMMIT_HASH}.tar.gz . + +RUN tar -xf ${COMMIT_HASH}.tar.gz --strip 1 + +RUN rm ${COMMIT_HASH}.tar.gz + +RUN luarocks make rockspec/skywalking-nginx-lua-master-0.rockspec + diff --git a/test/e2e-v2/cases/lua/docker-compose.yml b/test/e2e-v2/cases/lua/docker-compose.yml new file mode 100644 index 000000000000..a8bbb4951b2a --- /dev/null +++ b/test/e2e-v2/cases/lua/docker-compose.yml @@ -0,0 +1,68 @@ +# 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. + +version: '2.1' + +services: + oap: + extends: + file: ../../script/docker-compose/base-compose.yml + service: oap + ports: + - 12800 + + provider-entry: + extends: + file: ../../script/docker-compose/base-compose.yml + service: provider + environment: + SW_AGENT_NAME: e2e-service-entry-provider + depends_on: + oap: + condition: service_healthy + ports: + - 9090 + + provider-end: + extends: + file: ../../script/docker-compose/base-compose.yml + service: provider + environment: + SW_AGENT_NAME: e2e-service-end-provider + depends_on: + oap: + condition: service_healthy + + nginx: + build: + context: .. + dockerfile: lua/Dockerfile.nginx + networks: + - e2e + expose: + - 8080 + depends_on: + oap: + condition: service_healthy + provider-entry: + condition: service_healthy + provider-end: + condition: service_healthy + volumes: + - ../lua/nginx.conf:/var/nginx/conf.d/nginx.conf + entrypoint: ['bash', '-c', 'sleep 5 && openresty -c /var/nginx/conf.d/nginx.conf'] + +networks: + e2e: diff --git a/test/e2e-v2/cases/lua/e2e.yaml b/test/e2e-v2/cases/lua/e2e.yaml new file mode 100644 index 000000000000..bbcaace2942b --- /dev/null +++ b/test/e2e-v2/cases/lua/e2e.yaml @@ -0,0 +1,109 @@ +# 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 file is used to show how to write configuration files and can be used to test. + +setup: + env: compose + file: docker-compose.yml + timeout: 1200 + init-system-environment: ../../script/env + steps: + - name: install yq + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq + - name: install swctl + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl + - name: install etcdctl + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl + +cleanup: + on: always + +trigger: + action: http + interval: 10s + times: 10 + url: http://${provider-entry_host}:${provider-entry_9090}/nginx/entry/info + method: POST + +verify: + # verify with retry strategy + retry: + # max retry count + count: 20 + # the interval between two retries, in millisecond. + interval: 10000 + cases: + # service list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls + expected: expected/service.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + expected: expected/service-instance.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=User_Service_Name + expected: expected/service-instance.yml + # service endpoint + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=VXNlcl9TZXJ2aWNlX05hbWU=.1 + expected: expected/service-endpoint.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1 + expected: expected/service-endpoint.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1 + expected: expected/service-endpoint.yml + # trace segment list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls + expected: expected/traces-list.yml + # dependency service + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service VXNlcl9TZXJ2aWNlX05hbWU=.1 + expected: expected/dependency-services.yml + # dependency instance + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1 VXNlcl9TZXJ2aWNlX05hbWU=.1 + expected: expected/dependency-instance.yml + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + # service instance metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + # service endpoint metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + # service relation metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service=e2e-service-entry-provider --destService=User_Service_Name|yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service=e2e-service-entry-provider --destService=User_Service_Name|yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service=User_Service_Name --destService=e2e-service-end-provider|yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service=User_Service_Name --destService=e2e-service-end-provider|yq e 'to_entries' - + expected: expected/metrics-has-value.yml + # service instance relation metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm --instance=provider1 --service=e2e-service-entry-provider --destInstance=User_Service_Instance_Name --destService=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_server_cpm --instance=provider1 --service=e2e-service-entry-provider --destInstance=User_Service_Instance_Name --destService=User_Service_Name |yq e 'to_entries' - + expected: expected/metrics-has-value.yml diff --git a/test/e2e-v2/cases/lua/expected/dependency-instance.yml b/test/e2e-v2/cases/lua/expected/dependency-instance.yml new file mode 100644 index 000000000000..26d292d1064a --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/dependency-instance.yml @@ -0,0 +1,47 @@ +# 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. + +nodes: +{{- range .nodes }} +{{- if eq .name "User_Service_Instance_Name" }} +- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} + name: User_Service_Instance_Name + serviceid: {{ b64enc "User_Service_Name" }}.1 + servicename: User_Service_Name + type: Nginx + isreal: true +{{- end }} +{{- if eq .name "provider1" }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} + name: provider1 + serviceid: {{ b64enc "e2e-service-entry-provider" }}.1 + servicename: e2e-service-entry-provider + type: "" + isreal: true +{{- end }} +{{- end }} +calls: +{{- range .calls }} +{{- if eq .source "ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1_cHJvdmlkZXIx" }} +- source: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} + sourcecomponents: [] + target: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} + targetcomponents: [] + id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }}-{{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} + detectpoints: + - CLIENT + - SERVER +{{- end }} +{{- end }} diff --git a/test/e2e-v2/cases/lua/expected/dependency-services.yml b/test/e2e-v2/cases/lua/expected/dependency-services.yml new file mode 100644 index 000000000000..38949f2f864b --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/dependency-services.yml @@ -0,0 +1,59 @@ +# 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. + +nodes: +{{- range .nodes }} +{{- if eq .name "e2e-service-entry-provider" }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1 + name: e2e-service-entry-provider + type: Tomcat + isreal: true +{{- end }} +{{- if eq .name "e2e-service-end-provider" }} +- id: {{ b64enc "e2e-service-end-provider"}}.1 + name: e2e-service-end-provider + type: Tomcat + isreal: true +{{- end }} +{{- if eq .name "User_Service_Name" }} +- id: {{ b64enc "User_Service_Name"}}.1 + name: User_Service_Name + type: Nginx + isreal: true +{{- end }} +{{- end }} +calls: +{{- range .calls }} +{{- if eq .source "ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1" }} +- source: {{ b64enc "e2e-service-entry-provider"}}.1 + sourcecomponents: [] + target: {{ b64enc "User_Service_Name"}}.1 + targetcomponents: [] + id: {{ b64enc "e2e-service-entry-provider"}}.1-{{ b64enc "User_Service_Name"}}.1 + detectpoints: + - CLIENT + - SERVER +{{- end }} +{{- if eq .source "VXNlcl9TZXJ2aWNlX05hbWU=.1" }} +- source: {{ b64enc "User_Service_Name" }}.1 + sourcecomponents: [] + target: {{ b64enc "e2e-service-end-provider"}}.1 + targetcomponents: [] + id: {{ b64enc "User_Service_Name" }}.1-{{ b64enc "e2e-service-end-provider"}}.1 + detectpoints: + - CLIENT + - SERVER +{{- end }} +{{- end }} diff --git a/test/e2e-v2/cases/lua/expected/metrics-has-value.yml b/test/e2e-v2/cases/lua/expected/metrics-has-value.yml new file mode 100644 index 000000000000..27ae47c8ffdc --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/metrics-has-value.yml @@ -0,0 +1,21 @@ +# 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 . }} +- key: {{ notEmpty .key }} + value: {{ ge .value 0 }} +- key: {{ notEmpty .key }} + value: {{ ge .value 1 }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-endpoint.yml b/test/e2e-v2/cases/lua/expected/service-endpoint.yml new file mode 100644 index 000000000000..71ea4bb40d0c --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-endpoint.yml @@ -0,0 +1,29 @@ +# 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. + +{{- range .}} +{{- if eq .name "POST:/nginx/entry/info" }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "POST:/nginx/entry/info" }} + name: POST:/nginx/entry/info +{{- end}} +{{- if eq .name "POST:/nginx/end/info" }} +- id: {{ b64enc "e2e-service-end-provider" }}.1_{{ b64enc "POST:/nginx/end/info" }} + name: POST:/nginx/end/info +{{- end}} +{{- if eq .name "/nginx/info" }} +- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "/nginx/info" }} + name: /nginx/info +{{- end}} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-instance.yml b/test/e2e-v2/cases/lua/expected/service-instance.yml new file mode 100644 index 000000000000..cd7384b464f8 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-instance.yml @@ -0,0 +1,93 @@ +# Licensed to Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Apache Software Foundation (ASF) licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +{{- range .}} +{{- if eq .name "provider1" }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} + name: provider1 + attributes: + {{- range .attributes }} + {{- if eq .name "OS Name" }} + - name: OS Name + value: Linux + {{- end }} + {{- if eq .name "hostname" }} + - name: hostname + value: {{ notEmpty .value }} + {{- end }} + {{- if eq .name "Process No." }} + - name: Process No. + value: "1" + {{- end }} + {{- if eq .name "Start Time" }} + - name: Start Time + value: {{ notEmpty .value }} + {{- end }} + {{- if eq .name "JVM Arguments" }} + - name: JVM Arguments + value: '{{ notEmpty .value }}' + {{- end }} + {{- if eq .name "Jar Dependencies" }} + - name: Jar Dependencies + value: '{{ notEmpty .value }}' + {{- end }} + {{- if eq .name "ipv4s" }} + - name: ipv4s + value: {{ notEmpty .value }} + {{- end }} + {{- end}} + language: JAVA + instanceuuid: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} +{{- end}} +{{- if eq .name "User_Service_Instance_Name" }} +- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} + name: User_Service_Instance_Name + attributes: + {{- range .attributes }} + {{- if eq .name "OS Name" }} + - name: OS Name + value: Linux + {{- end }} + {{- if eq .name "hostname" }} + - name: hostname + value: {{ notEmpty .value }} + {{- end }} + {{- if eq .name "Process No." }} + - name: Process No. + value: "1" + {{- end }} + {{- if eq .name "Start Time" }} + - name: Start Time + value: {{ notEmpty .value }} + {{- end }} + {{- if eq .name "JVM Arguments" }} + - name: JVM Arguments + value: '{{ notEmpty .value }}' + {{- end }} + {{- if eq .name "Jar Dependencies" }} + - name: Jar Dependencies + value: '{{ notEmpty .value }}' + {{- end }} + {{- if eq .name "ipv4s" }} + - name: ipv4s + value: "" + {{- end }} + {{- end}} + language: LUA + instanceuuid: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} +{{- end}} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service.yml b/test/e2e-v2/cases/lua/expected/service.yml new file mode 100644 index 000000000000..8dbf8c6cff34 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service.yml @@ -0,0 +1,32 @@ +# 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. + +{{- range . }} +{{- if eq .name "e2e-service-entry-provider" }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1 + name: e2e-service-entry-provider + group: "" +{{- end }} +{{- if eq .name "User_Service_Name" }} +- id: {{ b64enc "User_Service_Name" }}.1 + name: User_Service_Name + group: "" +{{- end }} +{{- if eq .name "e2e-service-end-provider" }} +- id: {{ b64enc "e2e-service-end-provider" }}.1 + name: e2e-service-end-provider + group: "" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/traces-list.yml b/test/e2e-v2/cases/lua/expected/traces-list.yml new file mode 100644 index 000000000000..70cfed85e0c1 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/traces-list.yml @@ -0,0 +1,44 @@ +# 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. + +traces: +{{- range .traces }} +- segmentid: {{ notEmpty .segmentid }} + endpointnames: + {{- if eq (index .endpointnames 0) "HikariCP/Connection/getConnection" }} + - HikariCP/Connection/getConnection + {{- end}} + {{- if eq (index .endpointnames 0) "H2/JDBI/Statement/executeQuery" }} + - H2/JDBI/Statement/executeQuery + {{- end}} + {{- if eq (index .endpointnames 0) "H2/JDBI/PreparedStatement/executeQuery" }} + - H2/JDBI/PreparedStatement/executeQuery + {{- end }} + {{- if eq (index .endpointnames 0) "POST:/nginx/entry/info" }} + - POST:/nginx/entry/info + {{- end }} + {{- if eq (index .endpointnames 0) "POST:/nginx/end/info" }} + - POST:/nginx/end/info + {{- end }} + {{- if eq (index .endpointnames 0) "/nginx/info" }} + - /nginx/info + {{- end }} + duration: {{ ge .duration 0 }} + start: "{{ notEmpty .start}}" + iserror: false + traceids: + - {{ (index .traceids 0) }} +{{- end }} +total: {{ gt .total 0 }} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/nginx.conf b/test/e2e-v2/cases/lua/nginx.conf new file mode 100644 index 000000000000..09d12f1210c1 --- /dev/null +++ b/test/e2e-v2/cases/lua/nginx.conf @@ -0,0 +1,64 @@ +# 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. + +worker_processes 1; +daemon off; +error_log /dev/stdout error; + +events { + worker_connections 1024; +} + +http { + resolver local=on ipv6=off; + # lua_package_path "/usr/local/openresty/luajit/share/lua/5.1/skywalking/?.lua;;"; + # Buffer represents the register inform and the queue of the finished segment + lua_shared_dict tracing_buffer 100m; + + # Init is the timer setter and keeper + # Setup an infinite loop timer to do register and trace report. + init_worker_by_lua_block { + local metadata_buffer = ngx.shared.tracing_buffer + + metadata_buffer:set('serviceName', 'User_Service_Name') + -- Instance means the number of Nginx deployment, does not mean the worker instances + metadata_buffer:set('serviceInstanceName', 'User_Service_Instance_Name') + + require("skywalking.client"):startBackendTimer("http://oap:12800") + } + + log_format sw_trace escape=json "$uri $request_body"; + + server { + listen 8080; + + location /nginx/info { + + rewrite_by_lua_block { + require("skywalking.tracer"):start("User_Service_Name", {nginx = "nginx_value"}) + } + + proxy_pass http://provider-end:9090/nginx/end/info; + + body_filter_by_lua_block { + require("skywalking.tracer"):finish() + } + + log_by_lua_block { + require("skywalking.tracer"):prepareForReport() + } + } + } +} diff --git a/test/e2e-v2/cases/simple/auth/docker-compose.yml b/test/e2e-v2/cases/simple/auth/docker-compose.yml index 54ada05cbda6..086393aa5376 100644 --- a/test/e2e-v2/cases/simple/auth/docker-compose.yml +++ b/test/e2e-v2/cases/simple/auth/docker-compose.yml @@ -24,6 +24,7 @@ services: SW_AUTHENTICATION: test-token ports: - 12800 + provider: extends: file: ../../../script/docker-compose/base-compose.yml diff --git a/test/e2e-v2/cases/simple/auth/e2e.yaml b/test/e2e-v2/cases/simple/auth/e2e.yaml index e8473d3ce853..3d8378739313 100644 --- a/test/e2e-v2/cases/simple/auth/e2e.yaml +++ b/test/e2e-v2/cases/simple/auth/e2e.yaml @@ -49,24 +49,27 @@ verify: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/service-instance.yml # service endpoint - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/service-endpoint.yml + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/dependency-services.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider - expected: ../expected/service-instance.yml - # dependency instance - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + expected: ../expected/dependency-instance.yml + # dependency endpoint + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls expected: ../expected/traces-list.yml diff --git a/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml new file mode 100644 index 000000000000..4d83f916f0c0 --- /dev/null +++ b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml @@ -0,0 +1,46 @@ +# 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. + +nodes: +{{- range .nodes }} +{{- if eq .servicename "e2e-service-consumer" }} +- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/info" }} + name: POST:/info + serviceid: {{ b64enc "e2e-service-consumer" }}.1 + servicename: e2e-service-consumer + type: "" + isreal: true +{{- end }} +{{- if eq .servicename "e2e-service-provider" }} +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} + name: POST:/info + serviceid: {{ b64enc "e2e-service-provider" }}.1 + servicename: e2e-service-provider + type: "" + isreal: true +{{- end }} +{{- end }} +calls: +{{- range .calls }} +{{- if eq .source "ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1_UE9TVDovaW5mbw==" }} +- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/info" }} + sourcecomponents: [] + target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} + targetcomponents: [] + id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "POST:/info" }}-{{ b64enc "e2e-service-provider" }}.1-{{ b64enc "POST:/info" }} + detectpoints: + - SERVER +{{- end }} +{{- end }} diff --git a/test/e2e-v2/cases/simple/expected/dependency-instance.yml b/test/e2e-v2/cases/simple/expected/dependency-instance.yml new file mode 100644 index 000000000000..960838779d16 --- /dev/null +++ b/test/e2e-v2/cases/simple/expected/dependency-instance.yml @@ -0,0 +1,47 @@ +# 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. + +nodes: +{{- range .nodes }} +{{- if eq .name "consumer1" }} +- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }} + name: consumer1 + serviceid: {{ b64enc "e2e-service-consumer" }}.1 + servicename: e2e-service-consumer + type: "" + isreal: true +{{- end }} +{{- if eq .name "provider1" }} +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} + name: provider1 + serviceid: {{ b64enc "e2e-service-provider" }}.1 + servicename: e2e-service-provider + type: "Tomcat" + isreal: true +{{- end }} +{{- end }} +calls: +{{- range .calls }} +{{- if eq .source "ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1_Y29uc3VtZXIx" }} +- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }} + sourcecomponents: [] + target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} + targetcomponents: [] + id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}-{{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} + detectpoints: + - CLIENT + - SERVER +{{- end }} +{{- end }} diff --git a/test/e2e-v2/cases/simple/expected/traces-list.yml b/test/e2e-v2/cases/simple/expected/traces-list.yml index 0bbf661a0dcd..52bb0f4fa458 100644 --- a/test/e2e-v2/cases/simple/expected/traces-list.yml +++ b/test/e2e-v2/cases/simple/expected/traces-list.yml @@ -17,6 +17,9 @@ traces: {{- range .traces }} - segmentid: {{ notEmpty .segmentid }} endpointnames: + {{- if eq (index .endpointnames 0) "HikariCP/Connection/getConnection" }} + - HikariCP/Connection/getConnection + {{- end }} {{- if eq (index .endpointnames 0) "H2/JDBI/Statement/execute" }} - H2/JDBI/Statement/execute {{- end}} diff --git a/test/e2e-v2/cases/simple/jdk/docker-compose.yml b/test/e2e-v2/cases/simple/jdk/docker-compose.yml index 879eae6261de..5daf0a46dfee 100644 --- a/test/e2e-v2/cases/simple/jdk/docker-compose.yml +++ b/test/e2e-v2/cases/simple/jdk/docker-compose.yml @@ -22,6 +22,7 @@ services: service: oap ports: - 12800 + provider: extends: file: ../../../script/docker-compose/base-compose.yml diff --git a/test/e2e-v2/cases/simple/jdk/e2e.yaml b/test/e2e-v2/cases/simple/jdk/e2e.yaml index e8473d3ce853..3d8378739313 100644 --- a/test/e2e-v2/cases/simple/jdk/e2e.yaml +++ b/test/e2e-v2/cases/simple/jdk/e2e.yaml @@ -49,24 +49,27 @@ verify: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/service-instance.yml # service endpoint - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/service-endpoint.yml + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/dependency-services.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider - expected: ../expected/service-instance.yml - # dependency instance - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + expected: ../expected/dependency-instance.yml + # dependency endpoint + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls expected: ../expected/traces-list.yml diff --git a/test/e2e-v2/cases/simple/mtls/e2e.yaml b/test/e2e-v2/cases/simple/mtls/e2e.yaml index e8473d3ce853..3d8378739313 100644 --- a/test/e2e-v2/cases/simple/mtls/e2e.yaml +++ b/test/e2e-v2/cases/simple/mtls/e2e.yaml @@ -49,24 +49,27 @@ verify: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/service-instance.yml # service endpoint - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/service-endpoint.yml + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/dependency-services.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider - expected: ../expected/service-instance.yml - # dependency instance - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + expected: ../expected/dependency-instance.yml + # dependency endpoint + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls expected: ../expected/traces-list.yml diff --git a/test/e2e-v2/cases/simple/ssl/e2e.yaml b/test/e2e-v2/cases/simple/ssl/e2e.yaml index e8473d3ce853..3d8378739313 100644 --- a/test/e2e-v2/cases/simple/ssl/e2e.yaml +++ b/test/e2e-v2/cases/simple/ssl/e2e.yaml @@ -49,24 +49,27 @@ verify: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service=e2e-service-provider |yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/service-instance.yml # service endpoint - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=$(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/service-endpoint.yml + # service metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service $(swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls|grep -B 1 'provider'|yq e '.[0].id' -) expected: ../expected/dependency-services.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider - expected: ../expected/service-instance.yml - # dependency instance - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + expected: ../expected/dependency-instance.yml + # dependency endpoint + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls expected: ../expected/traces-list.yml diff --git a/test/e2e-v2/cases/so11y/docker-compose.yml b/test/e2e-v2/cases/so11y/docker-compose.yml new file mode 100644 index 000000000000..dfcbb49d2e30 --- /dev/null +++ b/test/e2e-v2/cases/so11y/docker-compose.yml @@ -0,0 +1,50 @@ +# 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. + +version: '2.1' + +services: + oap: + extends: + file: ../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_PROMETHEUS_FETCHER: "default" + SW_TELEMETRY: prometheus + ports: + - 12800 + + provider: + extends: + file: ../../script/docker-compose/base-compose.yml + service: provider + ports: + - 9090 + depends_on: + oap: + condition: service_healthy + + consumer: + extends: + file: ../../script/docker-compose/base-compose.yml + service: consumer + ports: + - 9092 + depends_on: + provider: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/so11y/e2e.yaml b/test/e2e-v2/cases/so11y/e2e.yaml new file mode 100644 index 000000000000..1c5038a74ef4 --- /dev/null +++ b/test/e2e-v2/cases/so11y/e2e.yaml @@ -0,0 +1,76 @@ +# 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 file is used to show how to write configuration files and can be used to test. + +setup: + env: compose + file: docker-compose.yml + timeout: 1200 + init-system-environment: ../../script/env + steps: + - name: install yq + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq + - name: install swctl + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl + - name: install etcdctl + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl + +cleanup: + on: always + +trigger: + action: http + interval: 10s + times: 10 + url: http://${consumer_host}:${consumer_9092}/info + method: POST + +verify: + # verify with retry strategy + retry: + # max retry count + count: 20 + # the interval between two retries, in millisecond. + interval: 10000 + cases: + # service list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls + expected: expected/service.yml + # service instance list + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=oap::oap-server + expected: expected/service-instance.yml + # service instance metrics + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_cpu_percentage --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + # wait infra e2e fix- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_oap_instance_jvm_memory_bytes_used --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + # expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_trace_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_metrics_first_aggregation --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_prepare_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_execute_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_live_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_runnable_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_loaded_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_total_loaded_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + diff --git a/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml b/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml new file mode 100644 index 000000000000..27ae47c8ffdc --- /dev/null +++ b/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml @@ -0,0 +1,21 @@ +# 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 . }} +- key: {{ notEmpty .key }} + value: {{ ge .value 0 }} +- key: {{ notEmpty .key }} + value: {{ ge .value 1 }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/so11y/expected/service-instance.yml b/test/e2e-v2/cases/so11y/expected/service-instance.yml new file mode 100644 index 000000000000..4583732d61ee --- /dev/null +++ b/test/e2e-v2/cases/so11y/expected/service-instance.yml @@ -0,0 +1,24 @@ +# Licensed to Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Apache Software Foundation (ASF) licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +{{- range .}} +- id: {{ b64enc "oap::oap-server" }}.1_{{ b64enc "http://localhost:1234" }} + name: http://localhost:1234 + attributes: [] + language: UNKNOWN + instanceuuid: {{ b64enc "oap::oap-server" }}.1_{{ b64enc "http://localhost:1234" }} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/so11y/expected/service.yml b/test/e2e-v2/cases/so11y/expected/service.yml new file mode 100644 index 000000000000..584e6f3e4a11 --- /dev/null +++ b/test/e2e-v2/cases/so11y/expected/service.yml @@ -0,0 +1,32 @@ +# 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. + +{{- range . }} +{{- if eq .name "e2e-service-provider" }} +- id: {{ b64enc "e2e-service-provider" }}.1 + name: e2e-service-provider + group: "" +{{- end }} +{{- if eq .name "e2e-service-consumer" }} +- id: {{ b64enc "e2e-service-consumer" }}.1 + name: e2e-service-consumer + group: "" +{{- end }} +{{- if eq .name "oap::oap-server" }} +- id: {{ b64enc "oap::oap-server" }}.1 + name: oap::oap-server + group: "" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index b91bdea682ee..3e8064cf01d8 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -15,4 +15,4 @@ SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756 SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07 -SW_CTL_COMMIT=401e0e5671a3fb49de1d1e1e89f5b693b2062867 \ No newline at end of file +SW_CTL_COMMIT=a575f65eb50d4199a77f1688f9733a0d20be6de3 \ No newline at end of file From a31e955c1d28b82c39b2b734ab477adaedd2e146 Mon Sep 17 00:00:00 2001 From: wankai123 Date: Thu, 30 Sep 2021 16:56:35 +0800 Subject: [PATCH 2/6] fix so11y workflow --- .github/workflows/e2e.so11y.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.so11y.yaml b/.github/workflows/e2e.so11y.yaml index 2ea098db5e05..7934068220e9 100644 --- a/.github/workflows/e2e.so11y.yaml +++ b/.github/workflows/e2e.so11y.yaml @@ -47,4 +47,4 @@ jobs: if: env.SKIP_CI != 'true' uses: ./.github/actions/e2e-test with: - config-file: so11y/jdk/e2e.yaml + config-file: so11y/e2e.yaml From 327275c51f73d6345acf8a6036415db1b1d34636 Mon Sep 17 00:00:00 2001 From: wankai123 Date: Thu, 30 Sep 2021 17:07:02 +0800 Subject: [PATCH 3/6] fix so11y workflow --- .github/workflows/e2e.so11y.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.so11y.yaml b/.github/workflows/e2e.so11y.yaml index 7934068220e9..437dff0069b3 100644 --- a/.github/workflows/e2e.so11y.yaml +++ b/.github/workflows/e2e.so11y.yaml @@ -45,6 +45,6 @@ jobs: uses: ./.github/actions/skip - name: Run E2E Test if: env.SKIP_CI != 'true' - uses: ./.github/actions/e2e-test + uses: ./.github/actions/infra-e2e-test with: config-file: so11y/e2e.yaml From d66ddacce896c6c1f1056057a354cdb2062d2e4a Mon Sep 17 00:00:00 2001 From: wankai123 Date: Thu, 30 Sep 2021 19:27:17 +0800 Subject: [PATCH 4/6] mv agent-lua commit id to env. --- test/e2e-v2/cases/lua/Dockerfile.nginx | 4 +--- test/e2e-v2/script/env | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e-v2/cases/lua/Dockerfile.nginx b/test/e2e-v2/cases/lua/Dockerfile.nginx index 78b49aa77673..b85c9ebf31b5 100644 --- a/test/e2e-v2/cases/lua/Dockerfile.nginx +++ b/test/e2e-v2/cases/lua/Dockerfile.nginx @@ -15,11 +15,9 @@ FROM openresty/openresty:1.17.8.2-5-alpine-fat -ENV COMMIT_HASH=c3cee4841798a147d83b96a10914d4ac0e11d0aa - WORKDIR /usr/share/skywalking-nginx-lua -ADD https://github.com/apache/skywalking-nginx-lua/archive/${COMMIT_HASH}.tar.gz . +ADD https://github.com/apache/skywalking-nginx-lua/archive/${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz . RUN tar -xf ${COMMIT_HASH}.tar.gz --strip 1 diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 3e8064cf01d8..55bcd6080035 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -15,4 +15,5 @@ SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756 SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07 +SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa SW_CTL_COMMIT=a575f65eb50d4199a77f1688f9733a0d20be6de3 \ No newline at end of file From 8637ccb2d3dded1294f5e63e70f3b5d9366d9cf6 Mon Sep 17 00:00:00 2001 From: wankai123 Date: Thu, 30 Sep 2021 20:31:28 +0800 Subject: [PATCH 5/6] fix dockerfile --- test/e2e-v2/cases/lua/Dockerfile.nginx | 6 ++++-- test/e2e-v2/cases/lua/docker-compose.yml | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e-v2/cases/lua/Dockerfile.nginx b/test/e2e-v2/cases/lua/Dockerfile.nginx index b85c9ebf31b5..2a24f7830483 100644 --- a/test/e2e-v2/cases/lua/Dockerfile.nginx +++ b/test/e2e-v2/cases/lua/Dockerfile.nginx @@ -15,13 +15,15 @@ FROM openresty/openresty:1.17.8.2-5-alpine-fat +ARG SW_AGENT_NGINX_LUA_COMMIT + WORKDIR /usr/share/skywalking-nginx-lua ADD https://github.com/apache/skywalking-nginx-lua/archive/${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz . -RUN tar -xf ${COMMIT_HASH}.tar.gz --strip 1 +RUN tar -xf ${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz --strip 1 -RUN rm ${COMMIT_HASH}.tar.gz +RUN rm ${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz RUN luarocks make rockspec/skywalking-nginx-lua-master-0.rockspec diff --git a/test/e2e-v2/cases/lua/docker-compose.yml b/test/e2e-v2/cases/lua/docker-compose.yml index a8bbb4951b2a..7a460138aa02 100644 --- a/test/e2e-v2/cases/lua/docker-compose.yml +++ b/test/e2e-v2/cases/lua/docker-compose.yml @@ -49,6 +49,8 @@ services: build: context: .. dockerfile: lua/Dockerfile.nginx + args: + - SW_AGENT_NGINX_LUA_COMMIT=${SW_AGENT_NGINX_LUA_COMMIT} networks: - e2e expose: From f28a181ed9d5586bb59780e1d3185578eeb9d32b Mon Sep 17 00:00:00 2001 From: wankai123 Date: Mon, 11 Oct 2021 08:53:48 +0800 Subject: [PATCH 6/6] fix wrong rules --- test/e2e-v2/cases/lua/e2e.yaml | 57 +++++++++---------- .../lua/expected/dependency-instance.yml | 10 +--- .../lua/expected/dependency-services.yml | 14 +---- .../cases/lua/expected/metrics-has-value.yml | 2 - .../lua/expected/service-endpoint-end.yml | 19 +++++++ ...ndpoint.yml => service-endpoint-entry.yml} | 12 +--- .../lua/expected/service-endpoint-nginx.yml | 19 +++++++ .../lua/expected/service-instance-nginx.yml | 40 +++++++++++++ .../cases/lua/expected/service-instance.yml | 57 +------------------ test/e2e-v2/cases/lua/expected/service.yml | 8 +-- .../e2e-v2/cases/lua/expected/traces-list.yml | 19 +------ .../cases/satellite/native-protocols/e2e.yaml | 3 - test/e2e-v2/cases/simple/auth/e2e.yaml | 21 +++---- .../simple/expected/dependency-endpoint.yml | 24 +++----- .../simple/expected/dependency-instance.yml | 10 +--- test/e2e-v2/cases/simple/jdk/e2e.yaml | 21 +++---- test/e2e-v2/cases/simple/mtls/e2e.yaml | 23 ++------ test/e2e-v2/cases/simple/ssl/e2e.yaml | 21 +++---- test/e2e-v2/cases/so11y/e2e.yaml | 37 ++++++------ .../so11y/expected/metrics-has-value.yml | 6 +- .../cases/so11y/expected/service-instance.yml | 2 +- test/e2e-v2/cases/so11y/expected/service.yml | 8 +-- test/e2e-v2/script/env | 2 +- 23 files changed, 174 insertions(+), 261 deletions(-) create mode 100644 test/e2e-v2/cases/lua/expected/service-endpoint-end.yml rename test/e2e-v2/cases/lua/expected/{service-endpoint.yml => service-endpoint-entry.yml} (71%) create mode 100644 test/e2e-v2/cases/lua/expected/service-endpoint-nginx.yml create mode 100644 test/e2e-v2/cases/lua/expected/service-instance-nginx.yml diff --git a/test/e2e-v2/cases/lua/e2e.yaml b/test/e2e-v2/cases/lua/e2e.yaml index bbcaace2942b..14404d453d0a 100644 --- a/test/e2e-v2/cases/lua/e2e.yaml +++ b/test/e2e-v2/cases/lua/e2e.yaml @@ -28,12 +28,9 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http - interval: 10s + interval: 3s times: 10 url: http://${provider-entry_host}:${provider-entry_9090}/nginx/entry/info method: POST @@ -44,7 +41,7 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 3s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls @@ -53,57 +50,57 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider expected: expected/service-instance.yml - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=User_Service_Name - expected: expected/service-instance.yml + expected: expected/service-instance-nginx.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=VXNlcl9TZXJ2aWNlX05hbWU=.1 - expected: expected/service-endpoint.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1 - expected: expected/service-endpoint.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-id=ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1 - expected: expected/service-endpoint.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=User_Service_Name + expected: expected/service-endpoint-nginx.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-entry-provider + expected: expected/service-endpoint-entry.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-end-provider + expected: expected/service-endpoint-end.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls expected: expected/traces-list.yml # dependency service - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service VXNlcl9TZXJ2aWNlX05hbWU=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=User_Service_Name expected: expected/dependency-services.yml # dependency instance - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1 VXNlcl9TZXJ2aWNlX05hbWU=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=e2e-service-entry-provider --dest-service-name=User_Service_Name expected: expected/dependency-instance.yml # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml # service instance metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance-name=User_Service_Instance_Name --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance-name=User_Service_Instance_Name --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance=User_Service_Instance_Name --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance-name=User_Service_Instance_Name --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=/nginx/info --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint-name=/nginx/info --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint=/nginx/info --service=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint-name=/nginx/info --service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml # service relation metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service=e2e-service-entry-provider --destService=User_Service_Name|yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service-name=e2e-service-entry-provider --dest-service-name=User_Service_Name|yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service=e2e-service-entry-provider --destService=User_Service_Name|yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service-name=e2e-service-entry-provider --dest-service-name=User_Service_Name|yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service=User_Service_Name --destService=e2e-service-end-provider|yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm --service-name=User_Service_Name --dest-service-name=e2e-service-end-provider|yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service=User_Service_Name --destService=e2e-service-end-provider|yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm --service-name=User_Service_Name --dest-service-name=e2e-service-end-provider|yq e 'to_entries' - expected: expected/metrics-has-value.yml # service instance relation metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm --instance=provider1 --service=e2e-service-entry-provider --destInstance=User_Service_Instance_Name --destService=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm --instance-name=provider1 --service-name=e2e-service-entry-provider --dest-instance-name=User_Service_Instance_Name --dest-service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_server_cpm --instance=provider1 --service=e2e-service-entry-provider --destInstance=User_Service_Instance_Name --destService=User_Service_Name |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_server_cpm --instance-name=provider1 --service-name=e2e-service-entry-provider --dest-instance-name=User_Service_Instance_Name --dest-service-name=User_Service_Name |yq e 'to_entries' - expected: expected/metrics-has-value.yml diff --git a/test/e2e-v2/cases/lua/expected/dependency-instance.yml b/test/e2e-v2/cases/lua/expected/dependency-instance.yml index 26d292d1064a..2a3ffecb7847 100644 --- a/test/e2e-v2/cases/lua/expected/dependency-instance.yml +++ b/test/e2e-v2/cases/lua/expected/dependency-instance.yml @@ -14,16 +14,13 @@ # limitations under the License. nodes: -{{- range .nodes }} -{{- if eq .name "User_Service_Instance_Name" }} +{{- contains .nodes }} - id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} name: User_Service_Instance_Name serviceid: {{ b64enc "User_Service_Name" }}.1 servicename: User_Service_Name type: Nginx isreal: true -{{- end }} -{{- if eq .name "provider1" }} - id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} name: provider1 serviceid: {{ b64enc "e2e-service-entry-provider" }}.1 @@ -31,10 +28,8 @@ nodes: type: "" isreal: true {{- end }} -{{- end }} calls: -{{- range .calls }} -{{- if eq .source "ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1_cHJvdmlkZXIx" }} +{{- contains .calls }} - source: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} sourcecomponents: [] target: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} @@ -44,4 +39,3 @@ calls: - CLIENT - SERVER {{- end }} -{{- end }} diff --git a/test/e2e-v2/cases/lua/expected/dependency-services.yml b/test/e2e-v2/cases/lua/expected/dependency-services.yml index 38949f2f864b..65f904899f06 100644 --- a/test/e2e-v2/cases/lua/expected/dependency-services.yml +++ b/test/e2e-v2/cases/lua/expected/dependency-services.yml @@ -14,29 +14,22 @@ # limitations under the License. nodes: -{{- range .nodes }} -{{- if eq .name "e2e-service-entry-provider" }} +{{- contains .nodes }} - id: {{ b64enc "e2e-service-entry-provider" }}.1 name: e2e-service-entry-provider type: Tomcat isreal: true -{{- end }} -{{- if eq .name "e2e-service-end-provider" }} - id: {{ b64enc "e2e-service-end-provider"}}.1 name: e2e-service-end-provider type: Tomcat isreal: true -{{- end }} -{{- if eq .name "User_Service_Name" }} - id: {{ b64enc "User_Service_Name"}}.1 name: User_Service_Name type: Nginx isreal: true {{- end }} -{{- end }} calls: -{{- range .calls }} -{{- if eq .source "ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1" }} +{{- contains .calls }} - source: {{ b64enc "e2e-service-entry-provider"}}.1 sourcecomponents: [] target: {{ b64enc "User_Service_Name"}}.1 @@ -45,8 +38,6 @@ calls: detectpoints: - CLIENT - SERVER -{{- end }} -{{- if eq .source "VXNlcl9TZXJ2aWNlX05hbWU=.1" }} - source: {{ b64enc "User_Service_Name" }}.1 sourcecomponents: [] target: {{ b64enc "e2e-service-end-provider"}}.1 @@ -56,4 +47,3 @@ calls: - CLIENT - SERVER {{- end }} -{{- end }} diff --git a/test/e2e-v2/cases/lua/expected/metrics-has-value.yml b/test/e2e-v2/cases/lua/expected/metrics-has-value.yml index 27ae47c8ffdc..d9c49854c963 100644 --- a/test/e2e-v2/cases/lua/expected/metrics-has-value.yml +++ b/test/e2e-v2/cases/lua/expected/metrics-has-value.yml @@ -14,8 +14,6 @@ # limitations under the License. {{- contains . }} -- key: {{ notEmpty .key }} - value: {{ ge .value 0 }} - key: {{ notEmpty .key }} value: {{ ge .value 1 }} {{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-endpoint-end.yml b/test/e2e-v2/cases/lua/expected/service-endpoint-end.yml new file mode 100644 index 000000000000..0c9c04d617ef --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-endpoint-end.yml @@ -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 "e2e-service-end-provider" }}.1_{{ b64enc "POST:/nginx/end/info" }} + name: POST:/nginx/end/info +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-endpoint.yml b/test/e2e-v2/cases/lua/expected/service-endpoint-entry.yml similarity index 71% rename from test/e2e-v2/cases/lua/expected/service-endpoint.yml rename to test/e2e-v2/cases/lua/expected/service-endpoint-entry.yml index 71ea4bb40d0c..6f161000150e 100644 --- a/test/e2e-v2/cases/lua/expected/service-endpoint.yml +++ b/test/e2e-v2/cases/lua/expected/service-endpoint-entry.yml @@ -13,17 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- range .}} -{{- if eq .name "POST:/nginx/entry/info" }} +{{- contains .}} - id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "POST:/nginx/entry/info" }} name: POST:/nginx/entry/info -{{- end}} -{{- if eq .name "POST:/nginx/end/info" }} -- id: {{ b64enc "e2e-service-end-provider" }}.1_{{ b64enc "POST:/nginx/end/info" }} - name: POST:/nginx/end/info -{{- end}} -{{- if eq .name "/nginx/info" }} -- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "/nginx/info" }} - name: /nginx/info -{{- end}} {{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-endpoint-nginx.yml b/test/e2e-v2/cases/lua/expected/service-endpoint-nginx.yml new file mode 100644 index 000000000000..e93e88af0019 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-endpoint-nginx.yml @@ -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 "User_Service_Name" }}.1_{{ b64enc "/nginx/info" }} + name: /nginx/info +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-instance-nginx.yml b/test/e2e-v2/cases/lua/expected/service-instance-nginx.yml new file mode 100644 index 000000000000..c7b910ec66e8 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-instance-nginx.yml @@ -0,0 +1,40 @@ +# Licensed to Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Apache Software Foundation (ASF) licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +{{- contains .}} +- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} + name: User_Service_Instance_Name + attributes: + {{- contains .attributes }} + - name: OS Name + value: Linux + - name: hostname + value: {{ notEmpty .value }} + - name: Process No. + value: "1" + - name: Start Time + value: {{ notEmpty .value }} + - name: JVM Arguments + value: '{{ notEmpty .value }}' + - name: Jar Dependencies + value: '{{ notEmpty .value }}' + - name: ipv4s + value: "" + {{- end}} + language: LUA + instanceuuid: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service-instance.yml b/test/e2e-v2/cases/lua/expected/service-instance.yml index cd7384b464f8..bdc121e0db8b 100644 --- a/test/e2e-v2/cases/lua/expected/service-instance.yml +++ b/test/e2e-v2/cases/lua/expected/service-instance.yml @@ -15,79 +15,26 @@ # specific language governing permissions and limitations # under the License. -{{- range .}} -{{- if eq .name "provider1" }} +{{- contains .}} - id: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} name: provider1 attributes: - {{- range .attributes }} - {{- if eq .name "OS Name" }} + {{- contains .attributes }} - name: OS Name value: Linux - {{- end }} - {{- if eq .name "hostname" }} - name: hostname value: {{ notEmpty .value }} - {{- end }} - {{- if eq .name "Process No." }} - name: Process No. value: "1" - {{- end }} - {{- if eq .name "Start Time" }} - name: Start Time value: {{ notEmpty .value }} - {{- end }} - {{- if eq .name "JVM Arguments" }} - name: JVM Arguments value: '{{ notEmpty .value }}' - {{- end }} - {{- if eq .name "Jar Dependencies" }} - name: Jar Dependencies value: '{{ notEmpty .value }}' - {{- end }} - {{- if eq .name "ipv4s" }} - name: ipv4s value: {{ notEmpty .value }} - {{- end }} {{- end}} language: JAVA instanceuuid: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} -{{- end}} -{{- if eq .name "User_Service_Instance_Name" }} -- id: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} - name: User_Service_Instance_Name - attributes: - {{- range .attributes }} - {{- if eq .name "OS Name" }} - - name: OS Name - value: Linux - {{- end }} - {{- if eq .name "hostname" }} - - name: hostname - value: {{ notEmpty .value }} - {{- end }} - {{- if eq .name "Process No." }} - - name: Process No. - value: "1" - {{- end }} - {{- if eq .name "Start Time" }} - - name: Start Time - value: {{ notEmpty .value }} - {{- end }} - {{- if eq .name "JVM Arguments" }} - - name: JVM Arguments - value: '{{ notEmpty .value }}' - {{- end }} - {{- if eq .name "Jar Dependencies" }} - - name: Jar Dependencies - value: '{{ notEmpty .value }}' - {{- end }} - {{- if eq .name "ipv4s" }} - - name: ipv4s - value: "" - {{- end }} - {{- end}} - language: LUA - instanceuuid: {{ b64enc "User_Service_Name" }}.1_{{ b64enc "User_Service_Instance_Name" }} -{{- end}} {{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/service.yml b/test/e2e-v2/cases/lua/expected/service.yml index 8dbf8c6cff34..32f9baccd6d2 100644 --- a/test/e2e-v2/cases/lua/expected/service.yml +++ b/test/e2e-v2/cases/lua/expected/service.yml @@ -13,20 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- range . }} -{{- if eq .name "e2e-service-entry-provider" }} +{{- contains . }} - id: {{ b64enc "e2e-service-entry-provider" }}.1 name: e2e-service-entry-provider group: "" -{{- end }} -{{- if eq .name "User_Service_Name" }} - id: {{ b64enc "User_Service_Name" }}.1 name: User_Service_Name group: "" -{{- end }} -{{- if eq .name "e2e-service-end-provider" }} - id: {{ b64enc "e2e-service-end-provider" }}.1 name: e2e-service-end-provider group: "" -{{- end }} {{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/lua/expected/traces-list.yml b/test/e2e-v2/cases/lua/expected/traces-list.yml index 70cfed85e0c1..60a610ca8f2a 100644 --- a/test/e2e-v2/cases/lua/expected/traces-list.yml +++ b/test/e2e-v2/cases/lua/expected/traces-list.yml @@ -14,27 +14,10 @@ # limitations under the License. traces: -{{- range .traces }} +{{- contains .traces }} - segmentid: {{ notEmpty .segmentid }} endpointnames: - {{- if eq (index .endpointnames 0) "HikariCP/Connection/getConnection" }} - - HikariCP/Connection/getConnection - {{- end}} - {{- if eq (index .endpointnames 0) "H2/JDBI/Statement/executeQuery" }} - - H2/JDBI/Statement/executeQuery - {{- end}} - {{- if eq (index .endpointnames 0) "H2/JDBI/PreparedStatement/executeQuery" }} - - H2/JDBI/PreparedStatement/executeQuery - {{- end }} - {{- if eq (index .endpointnames 0) "POST:/nginx/entry/info" }} - POST:/nginx/entry/info - {{- end }} - {{- if eq (index .endpointnames 0) "POST:/nginx/end/info" }} - - POST:/nginx/end/info - {{- end }} - {{- if eq (index .endpointnames 0) "/nginx/info" }} - - /nginx/info - {{- end }} duration: {{ ge .duration 0 }} start: "{{ notEmpty .start}}" iserror: false diff --git a/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml b/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml index 57ce2bdd8730..c245b73cc78a 100644 --- a/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml +++ b/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml @@ -28,9 +28,6 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: success - trigger: action: http interval: 3s diff --git a/test/e2e-v2/cases/simple/auth/e2e.yaml b/test/e2e-v2/cases/simple/auth/e2e.yaml index 917d2f088425..b50769888d24 100644 --- a/test/e2e-v2/cases/simple/auth/e2e.yaml +++ b/test/e2e-v2/cases/simple/auth/e2e.yaml @@ -28,12 +28,9 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http - interval: 10s + interval: 3s times: 10 url: http://${consumer_host}:${consumer_9092}/users method: POST @@ -44,14 +41,11 @@ trigger: verify: retry: count: 20 - interval: 10000 + interval: 3s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider | yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml # service instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml @@ -59,20 +53,19 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name e2e-service-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-provider expected: ../expected/dependency-services.yml # dependency instance - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider expected: ../expected/dependency-instance.yml # dependency endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint --service-name=e2e-service-provider --endpoint-name=POST:/users expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls diff --git a/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml index 4d83f916f0c0..3835336b8b9e 100644 --- a/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml +++ b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml @@ -14,33 +14,27 @@ # limitations under the License. nodes: -{{- range .nodes }} -{{- if eq .servicename "e2e-service-consumer" }} -- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/info" }} - name: POST:/info +{{- contains .nodes }} +- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }} + name: POST:/users serviceid: {{ b64enc "e2e-service-consumer" }}.1 servicename: e2e-service-consumer type: "" isreal: true -{{- end }} -{{- if eq .servicename "e2e-service-provider" }} -- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} - name: POST:/info +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} + name: POST:/users serviceid: {{ b64enc "e2e-service-provider" }}.1 servicename: e2e-service-provider type: "" isreal: true {{- end }} -{{- end }} calls: -{{- range .calls }} -{{- if eq .source "ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1_UE9TVDovaW5mbw==" }} -- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/info" }} +{{- contains .calls }} +- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }} sourcecomponents: [] - target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} + target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} targetcomponents: [] - id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "POST:/info" }}-{{ b64enc "e2e-service-provider" }}.1-{{ b64enc "POST:/info" }} + id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "POST:/users" }}-{{ b64enc "e2e-service-provider" }}.1-{{ b64enc "POST:/users" }} detectpoints: - SERVER {{- end }} -{{- end }} diff --git a/test/e2e-v2/cases/simple/expected/dependency-instance.yml b/test/e2e-v2/cases/simple/expected/dependency-instance.yml index 960838779d16..d3b9547c60cc 100644 --- a/test/e2e-v2/cases/simple/expected/dependency-instance.yml +++ b/test/e2e-v2/cases/simple/expected/dependency-instance.yml @@ -14,16 +14,13 @@ # limitations under the License. nodes: -{{- range .nodes }} -{{- if eq .name "consumer1" }} +{{- contains .nodes }} - id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }} name: consumer1 serviceid: {{ b64enc "e2e-service-consumer" }}.1 servicename: e2e-service-consumer type: "" isreal: true -{{- end }} -{{- if eq .name "provider1" }} - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} name: provider1 serviceid: {{ b64enc "e2e-service-provider" }}.1 @@ -31,10 +28,8 @@ nodes: type: "Tomcat" isreal: true {{- end }} -{{- end }} calls: -{{- range .calls }} -{{- if eq .source "ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1_Y29uc3VtZXIx" }} +{{- contains .calls }} - source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }} sourcecomponents: [] target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} @@ -44,4 +39,3 @@ calls: - CLIENT - SERVER {{- end }} -{{- end }} diff --git a/test/e2e-v2/cases/simple/jdk/e2e.yaml b/test/e2e-v2/cases/simple/jdk/e2e.yaml index 917d2f088425..b50769888d24 100644 --- a/test/e2e-v2/cases/simple/jdk/e2e.yaml +++ b/test/e2e-v2/cases/simple/jdk/e2e.yaml @@ -28,12 +28,9 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http - interval: 10s + interval: 3s times: 10 url: http://${consumer_host}:${consumer_9092}/users method: POST @@ -44,14 +41,11 @@ trigger: verify: retry: count: 20 - interval: 10000 + interval: 3s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider | yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml # service instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml @@ -59,20 +53,19 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name e2e-service-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-provider expected: ../expected/dependency-services.yml # dependency instance - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider expected: ../expected/dependency-instance.yml # dependency endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint --service-name=e2e-service-provider --endpoint-name=POST:/users expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls diff --git a/test/e2e-v2/cases/simple/mtls/e2e.yaml b/test/e2e-v2/cases/simple/mtls/e2e.yaml index 3abd1c0c3654..b50769888d24 100644 --- a/test/e2e-v2/cases/simple/mtls/e2e.yaml +++ b/test/e2e-v2/cases/simple/mtls/e2e.yaml @@ -28,9 +28,6 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http interval: 3s @@ -52,31 +49,23 @@ verify: # service instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider | yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml # service endpoint - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name e2e-service-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-provider expected: ../expected/dependency-services.yml - # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider - expected: ../expected/service-instance.yml - # dependency instance - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider expected: ../expected/dependency-instance.yml # dependency endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint --service-name=e2e-service-provider --endpoint-name=POST:/users expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls @@ -87,4 +76,4 @@ verify: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) - expected: ../expected/trace-users-detail.yml + expected: ../expected/trace-users-detail.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/simple/ssl/e2e.yaml b/test/e2e-v2/cases/simple/ssl/e2e.yaml index 917d2f088425..b50769888d24 100644 --- a/test/e2e-v2/cases/simple/ssl/e2e.yaml +++ b/test/e2e-v2/cases/simple/ssl/e2e.yaml @@ -28,12 +28,9 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http - interval: 10s + interval: 3s times: 10 url: http://${consumer_host}:${consumer_9092}/users method: POST @@ -44,14 +41,11 @@ trigger: verify: retry: count: 20 - interval: 10000 + interval: 3s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml - # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name service_sla --service-name=e2e-service-provider | yq e 'to_entries' - - expected: ../expected/metrics-has-value.yml # service instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml @@ -59,20 +53,19 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # service endpoint metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint=POST:/info --service=e2e-service-provider |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=POST:/users --service-name=e2e-service-provider | yq e 'to_entries' - expected: ../expected/metrics-has-value.yml # dependency service - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name e2e-service-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-provider expected: ../expected/dependency-services.yml # dependency instance - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=e2e-service-consumer --dest-service-name=e2e-service-provider expected: ../expected/dependency-instance.yml # dependency endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1_UE9TVDovaW5mbw== + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint --service-name=e2e-service-provider --endpoint-name=POST:/users expected: ../expected/dependency-endpoint.yml # trace segment list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls diff --git a/test/e2e-v2/cases/so11y/e2e.yaml b/test/e2e-v2/cases/so11y/e2e.yaml index 1c5038a74ef4..6f19a556b67e 100644 --- a/test/e2e-v2/cases/so11y/e2e.yaml +++ b/test/e2e-v2/cases/so11y/e2e.yaml @@ -28,23 +28,20 @@ setup: - name: install etcdctl command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl -cleanup: - on: always - trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${consumer_host}:${consumer_9092}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: - # verify with retry strategy retry: - # max retry count count: 20 - # the interval between two retries, in millisecond. - interval: 10000 + interval: 3s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls @@ -53,24 +50,24 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=oap::oap-server expected: expected/service-instance.yml # service instance metrics - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_cpu_percentage --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_cpu_percentage --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_oap_instance_jvm_memory_bytes_used --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - # wait infra e2e fix- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_oap_instance_jvm_memory_bytes_used --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - - # expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_trace_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_trace_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_metrics_first_aggregation --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_metrics_first_aggregation --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_prepare_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_prepare_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_execute_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_instance_persistence_execute_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_live_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_live_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_runnable_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_thread_runnable_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_loaded_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_loaded_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_total_loaded_count --instance=http://localhost:1234 --service=oap::oap-server |yq e 'to_entries' - + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_oap_jvm_class_total_loaded_count --instance-name=http://localhost:1234 --service-name=oap::oap-server |yq e 'to_entries' - expected: expected/metrics-has-value.yml diff --git a/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml b/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml index 27ae47c8ffdc..b922f84b394b 100644 --- a/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml +++ b/test/e2e-v2/cases/so11y/expected/metrics-has-value.yml @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- contains . }} -- key: {{ notEmpty .key }} - value: {{ ge .value 0 }} + {{- contains . }} - key: {{ notEmpty .key }} value: {{ ge .value 1 }} -{{- end }} \ No newline at end of file + {{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/so11y/expected/service-instance.yml b/test/e2e-v2/cases/so11y/expected/service-instance.yml index 4583732d61ee..4c1ff1b87657 100644 --- a/test/e2e-v2/cases/so11y/expected/service-instance.yml +++ b/test/e2e-v2/cases/so11y/expected/service-instance.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -{{- range .}} +{{- contains .}} - id: {{ b64enc "oap::oap-server" }}.1_{{ b64enc "http://localhost:1234" }} name: http://localhost:1234 attributes: [] diff --git a/test/e2e-v2/cases/so11y/expected/service.yml b/test/e2e-v2/cases/so11y/expected/service.yml index 584e6f3e4a11..b1ec136a9b00 100644 --- a/test/e2e-v2/cases/so11y/expected/service.yml +++ b/test/e2e-v2/cases/so11y/expected/service.yml @@ -13,20 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- range . }} -{{- if eq .name "e2e-service-provider" }} +{{- contains . }} - id: {{ b64enc "e2e-service-provider" }}.1 name: e2e-service-provider group: "" -{{- end }} -{{- if eq .name "e2e-service-consumer" }} - id: {{ b64enc "e2e-service-consumer" }}.1 name: e2e-service-consumer group: "" -{{- end }} -{{- if eq .name "oap::oap-server" }} - id: {{ b64enc "oap::oap-server" }}.1 name: oap::oap-server group: "" -{{- end }} {{- end }} \ No newline at end of file diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 116bbbb52a37..a7cabcc69e69 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -17,4 +17,4 @@ SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756 SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07 SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa -SW_CTL_COMMIT=76f9f848b3142d14c6ab6fa7910d408b92bced64 \ No newline at end of file +SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e \ No newline at end of file