diff --git a/.github/workflows/e2e.so11y.yaml b/.github/workflows/e2e.so11y.yaml index cb3b945190d22419e622a639f1f2915e35cb4fff..437dff0069b31b24555e78fa9ffa6c6c37dc26e1 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: - test_class: org.apache.skywalking.e2e.SO11yE2E + config-file: so11y/e2e.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index ede7f108f2400ef7f938cdacd56c63083cc00b4e..15f6188c0ad3e119d35a17cc7eb2e99823365091 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 fc3d4e0a9056898f65298e188b620dd42497dea8..bacd0d501280b46ab702b5c6cec20a7e39e4906b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +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. * Upgrade Armeria to 1.12, upgrade OpenSearch test version to 1.1.0. #### UI diff --git a/test/e2e-v2/cases/lua/Dockerfile.nginx b/test/e2e-v2/cases/lua/Dockerfile.nginx new file mode 100644 index 0000000000000000000000000000000000000000..2a24f7830483e5eb5baf418bd888a980981d5e5e --- /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 + +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 ${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz --strip 1 + +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 new file mode 100644 index 0000000000000000000000000000000000000000..7a460138aa021130724706382325ebf8c7263ba5 --- /dev/null +++ b/test/e2e-v2/cases/lua/docker-compose.yml @@ -0,0 +1,70 @@ +# 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 + args: + - SW_AGENT_NGINX_LUA_COMMIT=${SW_AGENT_NGINX_LUA_COMMIT} + 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 0000000000000000000000000000000000000000..14404d453d0af879d7a46c3e17555ee9c6d4d999 --- /dev/null +++ b/test/e2e-v2/cases/lua/e2e.yaml @@ -0,0 +1,106 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# 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 + +trigger: + action: http + interval: 3s + 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: 3s + 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-nginx.yml + # service endpoint + - 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 --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 --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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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 new file mode 100644 index 0000000000000000000000000000000000000000..2a3ffecb7847bafe363d3a778b6ef17a429b60b2 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/dependency-instance.yml @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nodes: +{{- 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 +- 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 }} +calls: +{{- contains .calls }} +- 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 }} 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 0000000000000000000000000000000000000000..65f904899f06217dc2394d12f94cb8f4559033f9 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/dependency-services.yml @@ -0,0 +1,49 @@ +# 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: +{{- contains .nodes }} +- id: {{ b64enc "e2e-service-entry-provider" }}.1 + name: e2e-service-entry-provider + type: Tomcat + isreal: true +- id: {{ b64enc "e2e-service-end-provider"}}.1 + name: e2e-service-end-provider + type: Tomcat + isreal: true +- id: {{ b64enc "User_Service_Name"}}.1 + name: User_Service_Name + type: Nginx + isreal: true +{{- end }} +calls: +{{- contains .calls }} +- 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 +- 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 }} 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 0000000000000000000000000000000000000000..d9c49854c96325df8278c97887b260d2c303c306 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/metrics-has-value.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 . }} +- 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 0000000000000000000000000000000000000000..0c9c04d617ef18bbf648cb0b437388fcc4e71b8b --- /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-entry.yml b/test/e2e-v2/cases/lua/expected/service-endpoint-entry.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f161000150e4b73743bed494154ba440f14973e --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-endpoint-entry.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-entry-provider" }}.1_{{ b64enc "POST:/nginx/entry/info" }} + name: POST:/nginx/entry/info +{{- 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 0000000000000000000000000000000000000000..e93e88af0019813015da888aa9fdafc0b7f07c4e --- /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 0000000000000000000000000000000000000000..c7b910ec66e8e6a97588b1c9db0b030e61b02ba5 --- /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 new file mode 100644 index 0000000000000000000000000000000000000000..bdc121e0db8be3d09473b6bf29d2847d33b99456 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service-instance.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 "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} + name: provider1 + 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: {{ notEmpty .value }} + {{- end}} + language: JAVA + instanceuuid: {{ b64enc "e2e-service-entry-provider" }}.1_{{ b64enc "provider1" }} +{{- 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 0000000000000000000000000000000000000000..32f9baccd6d2291e7a84a41e452d2d0a7da996a2 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/service.yml @@ -0,0 +1,26 @@ +# 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-entry-provider" }}.1 + name: e2e-service-entry-provider + group: "" +- id: {{ b64enc "User_Service_Name" }}.1 + name: User_Service_Name + group: "" +- id: {{ b64enc "e2e-service-end-provider" }}.1 + name: e2e-service-end-provider + group: "" +{{- 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 0000000000000000000000000000000000000000..60a610ca8f2ae53f9cccb7a67740045268281b45 --- /dev/null +++ b/test/e2e-v2/cases/lua/expected/traces-list.yml @@ -0,0 +1,27 @@ +# 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: +{{- contains .traces }} +- segmentid: {{ notEmpty .segmentid }} + endpointnames: + - POST:/nginx/entry/info + 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 0000000000000000000000000000000000000000..09d12f1210c1f24df4bb41b2fd41712a4ab5afe2 --- /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/satellite/native-protocols/e2e.yaml b/test/e2e-v2/cases/satellite/native-protocols/e2e.yaml index 57ce2bdd873076be2034ca27fb823f1c4b1db3a3..c245b73cc78a8056b7ee3636b37782b2915ad291 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 3a620c5341559da4154400581f23f0caf97416d9..b50769888d24ad81ef64b13867915db2afd1729e 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,27 +41,32 @@ 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 # 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-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-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 --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 --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 expected: ../expected/traces-list.yml @@ -74,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/expected/dependency-endpoint.yml b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml new file mode 100644 index 0000000000000000000000000000000000000000..3835336b8b9e537e547892a1bfc32f6eeed47771 --- /dev/null +++ b/test/e2e-v2/cases/simple/expected/dependency-endpoint.yml @@ -0,0 +1,40 @@ +# 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: +{{- 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 +- 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 }} +calls: +{{- contains .calls }} +- source: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "POST:/users" }} + sourcecomponents: [] + target: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} + targetcomponents: [] + id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "POST:/users" }}-{{ b64enc "e2e-service-provider" }}.1-{{ b64enc "POST:/users" }} + detectpoints: + - SERVER +{{- 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 0000000000000000000000000000000000000000..d3b9547c60ccf98824222bab2191f7a02fd6cd4f --- /dev/null +++ b/test/e2e-v2/cases/simple/expected/dependency-instance.yml @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nodes: +{{- 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 +- 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 }} +calls: +{{- contains .calls }} +- 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 }} diff --git a/test/e2e-v2/cases/simple/expected/metrics-has-value.yml b/test/e2e-v2/cases/simple/expected/metrics-has-value.yml index 5359e6d315d730c68f269fa0f2638a630d2e87f2..d9c49854c96325df8278c97887b260d2c303c306 100644 --- a/test/e2e-v2/cases/simple/expected/metrics-has-value.yml +++ b/test/e2e-v2/cases/simple/expected/metrics-has-value.yml @@ -16,4 +16,4 @@ {{- contains . }} - key: {{ notEmpty .key }} value: {{ ge .value 1 }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/simple/expected/service-endpoint.yml b/test/e2e-v2/cases/simple/expected/service-endpoint.yml index 629cd4f291ae3cbb270b809721dfeaa582bf18ad..0303f5179028f435fefcc7298b83406457848ddc 100644 --- a/test/e2e-v2/cases/simple/expected/service-endpoint.yml +++ b/test/e2e-v2/cases/simple/expected/service-endpoint.yml @@ -16,4 +16,4 @@ {{- contains . }} - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} name: POST:/users -{{- end}} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/simple/expected/service-instance.yml b/test/e2e-v2/cases/simple/expected/service-instance.yml index e5252050a32fd79c00bb32978c3abda44f8e7f88..f9296e43bba0d764880bd6214de8f1f794fd679d 100644 --- a/test/e2e-v2/cases/simple/expected/service-instance.yml +++ b/test/e2e-v2/cases/simple/expected/service-instance.yml @@ -37,4 +37,4 @@ {{- end}} language: JAVA instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} -{{- end}} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/simple/jdk/e2e.yaml b/test/e2e-v2/cases/simple/jdk/e2e.yaml index 52fb0cd963d06dd252578bdbd4a043f18508d87f..b50769888d24ad81ef64b13867915db2afd1729e 100644 --- a/test/e2e-v2/cases/simple/jdk/e2e.yaml +++ b/test/e2e-v2/cases/simple/jdk/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 @@ -49,22 +46,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-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 # 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-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-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 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 --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 --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 expected: ../expected/traces-list.yml @@ -74,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/mtls/e2e.yaml b/test/e2e-v2/cases/simple/mtls/e2e.yaml index 2bd06a196e3712d3f1b2ab0ca006ebc8b7f76fa9..b50769888d24ad81ef64b13867915db2afd1729e 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 @@ -49,22 +46,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-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 # 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-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-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 --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 --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 expected: ../expected/traces-list.yml @@ -74,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 2bd06a196e3712d3f1b2ab0ca006ebc8b7f76fa9..b50769888d24ad81ef64b13867915db2afd1729e 100644 --- a/test/e2e-v2/cases/simple/ssl/e2e.yaml +++ b/test/e2e-v2/cases/simple/ssl/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 @@ -49,22 +46,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-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 # 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-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-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 --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 --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 expected: ../expected/traces-list.yml @@ -74,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/so11y/docker-compose.yml b/test/e2e-v2/cases/so11y/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..dfcbb49d2e309c69b108bcf0041b9e2c20b8dc56 --- /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 0000000000000000000000000000000000000000..6f19a556b67e62344ebdbda2b595c8fbd274b2a3 --- /dev/null +++ b/test/e2e-v2/cases/so11y/e2e.yaml @@ -0,0 +1,73 @@ +# 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 + +trigger: + action: http + interval: 3s + times: 10 + url: http://${consumer_host}:${consumer_9092}/users + method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" + +verify: + retry: + count: 20 + interval: 3s + 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-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 + - 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-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-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-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-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-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-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-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 new file mode 100644 index 0000000000000000000000000000000000000000..b922f84b394b56ee4ea8bcdc95536dc84d8a2ec5 --- /dev/null +++ b/test/e2e-v2/cases/so11y/expected/metrics-has-value.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 . }} +- 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 0000000000000000000000000000000000000000..4c1ff1b87657a673be2c69f580a3b46af1c33687 --- /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. + +{{- contains .}} +- 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 0000000000000000000000000000000000000000..b1ec136a9b00174fb9d3ab4793fbfa652c8ebd99 --- /dev/null +++ b/test/e2e-v2/cases/so11y/expected/service.yml @@ -0,0 +1,26 @@ +# 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-provider" }}.1 + name: e2e-service-provider + group: "" +- id: {{ b64enc "e2e-service-consumer" }}.1 + name: e2e-service-consumer + group: "" +- id: {{ b64enc "oap::oap-server" }}.1 + name: oap::oap-server + group: "" +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 2c6d375533ab9c2951037fd7b0ce0354d86b5580..a7cabcc69e69cf1915d746ed2ce50105b61b0466 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -15,4 +15,6 @@ SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756 SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07 -SW_CTL_COMMIT=76f9f848b3142d14c6ab6fa7910d408b92bced64 +SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa + +SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e \ No newline at end of file