From 2322a5ef0d8ea82ad223766a40803685254aa810 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 08:52:55 +0800 Subject: [PATCH 01/23] replace e2e with infra e2e. --- .github/workflows/e2e.log.yaml | 19 ++++- .../cases/log/docker-compose.fluentbit.yml | 71 +++++++++++++++++++ test/e2e-v2/cases/log/es6/docker-compose.yml | 56 +++++++++++++++ test/e2e-v2/cases/log/es6/e2e.yaml | 60 ++++++++++++++++ .../cases/log/es7.14/docker-compose.yml | 56 +++++++++++++++ test/e2e-v2/cases/log/es7.14/e2e.yaml | 60 ++++++++++++++++ test/e2e-v2/cases/log/es7/docker-compose.yml | 56 +++++++++++++++ test/e2e-v2/cases/log/es7/e2e.yaml | 60 ++++++++++++++++ test/e2e-v2/cases/log/expected/logs.yml | 27 +++++++ .../cases/log/expected/service-endpoint.yml | 21 ++++++ .../cases/log/expected/service-instance.yml | 54 ++++++++++++++ test/e2e-v2/cases/log/expected/service.yml | 27 +++++++ .../log/fluent-bit/fluent-bit-parser.conf | 21 ++++++ .../log/fluent-bit/fluent-bit-script.lua | 23 ++++++ .../cases/log/fluent-bit/fluent-bit.conf | 40 +++++++++++ test/e2e-v2/cases/log/h2/docker-compose.yml | 58 +++++++++++++++ test/e2e-v2/cases/log/h2/e2e.yaml | 60 ++++++++++++++++ .../cases/log/influxdb/docker-compose.yml | 55 ++++++++++++++ test/e2e-v2/cases/log/influxdb/e2e.yaml | 60 ++++++++++++++++ test/e2e-v2/cases/log/lal.yaml | 34 +++++++++ test/e2e-v2/cases/log/log-mal.yaml | 36 ++++++++++ .../e2e-v2/cases/log/mysql/docker-compose.yml | 60 ++++++++++++++++ test/e2e-v2/cases/log/mysql/e2e.yaml | 60 ++++++++++++++++ .../script/dockerfiles/Dockerfile.consumer | 26 +++++++ test/e2e-v2/script/dockerfiles/Dockerfile.h2 | 24 +++++++ .../script/dockerfiles/Dockerfile.provider | 26 +++++++ .../script/dockerfiles/Dockerfile.satellite | 36 ++++++++++ 27 files changed, 1183 insertions(+), 3 deletions(-) create mode 100644 test/e2e-v2/cases/log/docker-compose.fluentbit.yml create mode 100644 test/e2e-v2/cases/log/es6/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/es6/e2e.yaml create mode 100644 test/e2e-v2/cases/log/es7.14/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/es7.14/e2e.yaml create mode 100644 test/e2e-v2/cases/log/es7/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/es7/e2e.yaml create mode 100644 test/e2e-v2/cases/log/expected/logs.yml create mode 100644 test/e2e-v2/cases/log/expected/service-endpoint.yml create mode 100644 test/e2e-v2/cases/log/expected/service-instance.yml create mode 100644 test/e2e-v2/cases/log/expected/service.yml create mode 100644 test/e2e-v2/cases/log/fluent-bit/fluent-bit-parser.conf create mode 100644 test/e2e-v2/cases/log/fluent-bit/fluent-bit-script.lua create mode 100644 test/e2e-v2/cases/log/fluent-bit/fluent-bit.conf create mode 100644 test/e2e-v2/cases/log/h2/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/h2/e2e.yaml create mode 100644 test/e2e-v2/cases/log/influxdb/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/influxdb/e2e.yaml create mode 100644 test/e2e-v2/cases/log/lal.yaml create mode 100644 test/e2e-v2/cases/log/log-mal.yaml create mode 100644 test/e2e-v2/cases/log/mysql/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/mysql/e2e.yaml create mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.consumer create mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.h2 create mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.provider create mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.satellite diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 46f4c9559a7e..6388becec962 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -39,7 +39,20 @@ jobs: timeout-minutes: 90 strategy: matrix: - storage: ['h2', 'mysql', 'es6', 'es7', 'es7.14', 'influxdb'] + storage: + - name: h2 + config-file: log/h2/e2e.yaml + - name: mysql + config-file: log/mysql/e2e.yaml + - name: es6 + config-file: log/es6/e2e.yaml + - name: es7 + config-file: log/es7/e2e.yaml + - name: es7.14 + config-file: log/es7.14/e2e.yaml + - name: influxdb + config-file: log/influxdb/e2e.yaml + env: SW_STORAGE: ${{ matrix.storage }} steps: @@ -50,9 +63,9 @@ 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.log.LogE2E + test_class: ${{ matrix.case.config-file }} LogFluentBit: if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule') diff --git a/test/e2e-v2/cases/log/docker-compose.fluentbit.yml b/test/e2e-v2/cases/log/docker-compose.fluentbit.yml new file mode 100644 index 000000000000..2fa84b3d5f49 --- /dev/null +++ b/test/e2e-v2/cases/log/docker-compose.fluentbit.yml @@ -0,0 +1,71 @@ +# 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: + es: + image: elastic/elasticsearch:6.3.2 + expose: + - 9200 + networks: + - e2e + environment: + - discovery.type=single-node + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../base-compose.yml + service: oap + environment: + SW_STORAGE: elasticsearch + depends_on: + es: + condition: service_healthy + networks: + - e2e + + provider: + extends: + file: ../base-compose.yml + service: provider + volumes: + - /tmp/skywalking-logs/:/tmp/skywalking-logs/ + networks: + - e2e + depends_on: + oap: + condition: service_healthy + + fluentbit: + image: fluent/fluent-bit:1.7 + volumes: + - /tmp/skywalking-logs:/tmp/skywalking-logs + - ./fluent-bit:/fluent-bit/etc + networks: + - e2e + depends_on: + oap: + condition: service_healthy + provider: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/es6/docker-compose.yml b/test/e2e-v2/cases/log/es6/docker-compose.yml new file mode 100644 index 000000000000..35dc028ea230 --- /dev/null +++ b/test/e2e-v2/cases/log/es6/docker-compose.yml @@ -0,0 +1,56 @@ +# 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: + es: + image: elastic/elasticsearch:6.3.2 + expose: + - 9200 + networks: + - e2e + environment: + - discovery.type=single-node + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: elasticsearch + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + es: + condition: service_healthy + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy +networks: + e2e: diff --git a/test/e2e-v2/cases/log/es6/e2e.yaml b/test/e2e-v2/cases/log/es6/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/es6/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7.14/docker-compose.yml b/test/e2e-v2/cases/log/es7.14/docker-compose.yml new file mode 100644 index 000000000000..553c0dddffcf --- /dev/null +++ b/test/e2e-v2/cases/log/es7.14/docker-compose.yml @@ -0,0 +1,56 @@ +# 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: + es: + image: elastic/elasticsearch:7.14.0 + expose: + - 9200 + networks: + - e2e + environment: + - discovery.type=single-node + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: elasticsearch + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + es: + condition: service_healthy + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy +networks: + e2e: diff --git a/test/e2e-v2/cases/log/es7.14/e2e.yaml b/test/e2e-v2/cases/log/es7.14/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/es7.14/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7/docker-compose.yml b/test/e2e-v2/cases/log/es7/docker-compose.yml new file mode 100644 index 000000000000..922ae23aee90 --- /dev/null +++ b/test/e2e-v2/cases/log/es7/docker-compose.yml @@ -0,0 +1,56 @@ +# 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: + es: + image: elastic/elasticsearch:7.4.2 + expose: + - 9200 + networks: + - e2e + environment: + - discovery.type=single-node + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: elasticsearch + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + es: + condition: service_healthy + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy +networks: + e2e: diff --git a/test/e2e-v2/cases/log/es7/e2e.yaml b/test/e2e-v2/cases/log/es7/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/es7/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/logs.yml b/test/e2e-v2/cases/log/expected/logs.yml new file mode 100644 index 000000000000..1c5c38a177cc --- /dev/null +++ b/test/e2e-v2/cases/log/expected/logs.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. + +logs: + - serviceName: not null + serviceId: not null + serviceInstanceName: not null + serviceInstanceId: not null + traceId: not null + timestamp: gt 0 + contentType: TEXT + content: not null + tags: + - key: level + value: INFO \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/service-endpoint.yml b/test/e2e-v2/cases/log/expected/service-endpoint.yml new file mode 100644 index 000000000000..30b1efb4c70c --- /dev/null +++ b/test/e2e-v2/cases/log/expected/service-endpoint.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. + +{{- range .}} +{{- if eq .name "POST:/info" }} +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} + name: POST:/info +{{- end}} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/service-instance.yml b/test/e2e-v2/cases/log/expected/service-instance.yml new file mode 100644 index 000000000000..ef74087afa9d --- /dev/null +++ b/test/e2e-v2/cases/log/expected/service-instance.yml @@ -0,0 +1,54 @@ +# 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 "e2e-service-provider" }}.1_{{ b64enc "provider1" }} + name: {{ notEmpty .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: {{ notEmpty .value }} + {{- end }} + {{- end}} + language: JAVA + instanceuuid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} +{{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/service.yml b/test/e2e-v2/cases/log/expected/service.yml new file mode 100644 index 000000000000..e299d8b97eca --- /dev/null +++ b/test/e2e-v2/cases/log/expected/service.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. + +{{- 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 }} +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/fluent-bit-parser.conf b/test/e2e-v2/cases/log/fluent-bit/fluent-bit-parser.conf new file mode 100644 index 000000000000..be298d631429 --- /dev/null +++ b/test/e2e-v2/cases/log/fluent-bit/fluent-bit-parser.conf @@ -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. + +[PARSER] + Name my-log-format + Format regex + Regex ^\[SW_CTX: ?\[(?[^,]+),(?[^,]+),(?[^,]+),(?[^,]+),(?[^\]]+)\]\] \[(?.+?)\] (?[^\]]*) \[(?[^ ]*)\] (?[^\]]*):(?[^\]]*) - (?[^\]]*)$ + Time_Key time + Time_Format %d/%b/%Y:%H:%M:%S %z diff --git a/test/e2e-v2/cases/log/fluent-bit/fluent-bit-script.lua b/test/e2e-v2/cases/log/fluent-bit/fluent-bit-script.lua new file mode 100644 index 000000000000..274d62e467eb --- /dev/null +++ b/test/e2e-v2/cases/log/fluent-bit/fluent-bit-script.lua @@ -0,0 +1,23 @@ +-- +-- 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. +-- + +function rewrite_body(tag, timestamp, record) + record["body"] = {text={text="fluentbit " .. record["body"]}} + record["tags"] = {data={{key="level", value="INFO"}}} + record["traceContext"] = {traceId=record["traceId"],traceSegmentId=record["traceSegmentId"],spanId=record["spanId"]} + return 1, timestamp, record +end diff --git a/test/e2e-v2/cases/log/fluent-bit/fluent-bit.conf b/test/e2e-v2/cases/log/fluent-bit/fluent-bit.conf new file mode 100644 index 000000000000..28d9554eef9b --- /dev/null +++ b/test/e2e-v2/cases/log/fluent-bit/fluent-bit.conf @@ -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. + +[SERVICE] + Flush 5 + Daemon Off + Log_Level warn + Parsers_File fluent-bit-parser.conf +[INPUT] + Name tail + Path /tmp/skywalking-logs/*/e2e-service-provider.log + Parser my-log-format +[FILTER] + Name lua + Match * + Script fluent-bit-script.lua + Call rewrite_body +[OUTPUT] + Name stdout + Match * + Format json +[OUTPUT] + Name http + Match * + Host oap + Port 12800 + URI /v3/logs + Format json diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml new file mode 100644 index 000000000000..3fbc95c09932 --- /dev/null +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -0,0 +1,58 @@ +# 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: + h2db: + build: + context: .. + dockerfile: ../../../script/dockerfiles/Dockerfile.h2 + networks: + - e2e + expose: + - 1521 + healthcheck: + test: [ "CMD", "sh", "-c", "nc -z 127.0.0.1 1521" ] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: h2 + SW_STORAGE_H2_URL: jdbc:h2:tcp://h2db:1521/skywalking-oap-db + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + h2db: + condition: service_healthy + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/influxdb/docker-compose.yml b/test/e2e-v2/cases/log/influxdb/docker-compose.yml new file mode 100644 index 000000000000..f9538c8485a9 --- /dev/null +++ b/test/e2e-v2/cases/log/influxdb/docker-compose.yml @@ -0,0 +1,55 @@ +# 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: + influxdb: + image: influxdb:1.7.9 + expose: + - 8086 + networks: + - e2e + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/8086"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: influxdb + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + influxdb: + condition: service_healthy + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/lal.yaml b/test/e2e-v2/cases/log/lal.yaml new file mode 100644 index 000000000000..bfd7a6105783 --- /dev/null +++ b/test/e2e-v2/cases/log/lal.yaml @@ -0,0 +1,34 @@ +# 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. + +rules: + - name: example + dsl: | + filter { + text { + abortOnFailure false // for test purpose, we want to persist all logs + regexp $/(?s)(?\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) \[TID:(?.+?)] \[(?.+?)] (?\w{4,}) (?.{1,36}) (?.+)/$ + } + extractor { + metrics { + timestamp log.timestamp as Long + labels level: parsed.level, service: log.service, instance: log.serviceInstance + name "log_count" + value 1 + } + } + sink { + } + } diff --git a/test/e2e-v2/cases/log/log-mal.yaml b/test/e2e-v2/cases/log/log-mal.yaml new file mode 100644 index 000000000000..5f7f5ebcaa7b --- /dev/null +++ b/test/e2e-v2/cases/log/log-mal.yaml @@ -0,0 +1,36 @@ +# 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 will parse a textual representation of a duration. The formats +# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS} +# with days considered to be exactly 24 hours. +#

+# Examples: +#

+#    "PT20.345S" -- parses as "20.345 seconds"
+#    "PT15M"     -- parses as "15 minutes" (where a minute is 60 seconds)
+#    "PT10H"     -- parses as "10 hours" (where an hour is 3600 seconds)
+#    "P2D"       -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
+#    "P2DT3H4M"  -- parses as "2 days, 3 hours and 4 minutes"
+#    "P-6H3M"    -- parses as "-6 hours and +3 minutes"
+#    "-P6H3M"    -- parses as "-6 hours and -3 minutes"
+#    "-P-6H+3M"  -- parses as "+6 hours and -3 minutes"
+# 
+ +expSuffix: instance(['service'], ['instance']) +metricPrefix: log +metricsRules: + - name: count_info + exp: log_count.tagEqual('level', 'INFO').sum(['service', 'instance']).downsampling(SUM) diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml new file mode 100644 index 000000000000..4f649682a501 --- /dev/null +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -0,0 +1,60 @@ +# 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: + mysql: + image: mysql/mysql-server:8.0.13 + networks: + - e2e + expose: + - 3306 + environment: + - MYSQL_ROOT_PASSWORD=root@1234 + - MYSQL_DATABASE=swtest + - MYSQL_ROOT_HOST=% + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: mysql + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test + volumes: + - ../lal.yaml:/skywalking/config/lal/test.yaml + - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + depends_on: + mysql: + condition: service_healthy + entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh'] + + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.consumer b/test/e2e-v2/script/dockerfiles/Dockerfile.consumer new file mode 100644 index 000000000000..84a7dbc4603c --- /dev/null +++ b/test/e2e-v2/script/dockerfiles/Dockerfile.consumer @@ -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. + +ARG SW_AGENT_JDK_VERSION=8 + +FROM ghcr.io/apache/skywalking-java/jdk-${SW_AGENT_JDK_VERSION}:2b519320559ba94131b098e1258bd5fe41d487e4 + +VOLUME /services + +ENV SW_LOGGING_OUTPUT=CONSOLE + +ADD e2e-service-consumer/target/e2e-service-consumer-1.0.0.jar /services/ + +CMD ["sh", "-c", "java -jar /services/e2e-service-consumer-1.0.0.jar"] diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.h2 b/test/e2e-v2/script/dockerfiles/Dockerfile.h2 new file mode 100644 index 000000000000..b77f407a55ff --- /dev/null +++ b/test/e2e-v2/script/dockerfiles/Dockerfile.h2 @@ -0,0 +1,24 @@ +# 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 adoptopenjdk/openjdk8:alpine + +WORKDIR /h2 + +VOLUME /h2/data + +ADD https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar /h2 + +CMD ["sh", "-c", "java -cp /h2/*.jar org.h2.tools.Server -tcp -tcpAllowOthers -tcpPort 1521 -ifNotExists -baseDir /h2/data"] \ No newline at end of file diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.provider b/test/e2e-v2/script/dockerfiles/Dockerfile.provider new file mode 100644 index 000000000000..525ad0346691 --- /dev/null +++ b/test/e2e-v2/script/dockerfiles/Dockerfile.provider @@ -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. + +ARG SW_AGENT_JDK_VERSION=8 + +FROM ghcr.io/apache/skywalking-java/jdk-${SW_AGENT_JDK_VERSION}:2b519320559ba94131b098e1258bd5fe41d487e4 + +VOLUME /services + +ENV SW_LOGGING_OUTPUT=CONSOLE + +ADD e2e-service-provider/target/e2e-service-provider-1.0.0.jar /services/ + +CMD ["sh", "-c", "java -jar /services/e2e-service-provider-1.0.0.jar"] diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.satellite b/test/e2e-v2/script/dockerfiles/Dockerfile.satellite new file mode 100644 index 000000000000..2e0a7a2f342e --- /dev/null +++ b/test/e2e-v2/script/dockerfiles/Dockerfile.satellite @@ -0,0 +1,36 @@ +# 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 golang:1.14 AS builder + +ARG COMMIT_HASH=827f3a45e44cb2a64f874ff17d9eb454a680d08f +ARG SATELLITE_CODE=${COMMIT_HASH}.tar.gz +ARG SATELLITE_CODE_URL=https://github.com/apache/skywalking-satellite/archive/${SATELLITE_CODE} + +ENV CGO_ENABLED=0 + +WORKDIR /skywalking-satellite + +ADD ${SATELLITE_CODE_URL} . +RUN tar -xf ${SATELLITE_CODE} --strip 1 +RUN rm ${SATELLITE_CODE} + +RUN make linux + +FROM alpine:3.10 + +COPY --from=builder /skywalking-satellite/bin/skywalking-satellite-latest-linux-amd64 /sw-satellite + +ENTRYPOINT ["/sw-satellite"] \ No newline at end of file From a01039c4b031aa40fdbee1fc81fcedb1e4d78bf7 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 10:03:01 +0800 Subject: [PATCH 02/23] update e2e --- .github/workflows/e2e.log.yaml | 25 ++------ .../cases/log/postgres/docker-compose.yml | 48 +++++++++++++++ test/e2e-v2/cases/log/postgres/e2e.yaml | 60 +++++++++++++++++++ 3 files changed, 112 insertions(+), 21 deletions(-) create mode 100644 test/e2e-v2/cases/log/postgres/docker-compose.yml create mode 100644 test/e2e-v2/cases/log/postgres/e2e.yaml diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 6388becec962..1bca941a9167 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -39,7 +39,7 @@ jobs: timeout-minutes: 90 strategy: matrix: - storage: + case: - name: h2 config-file: log/h2/e2e.yaml - name: mysql @@ -52,9 +52,8 @@ jobs: config-file: log/es7.14/e2e.yaml - name: influxdb config-file: log/influxdb/e2e.yaml - - env: - SW_STORAGE: ${{ matrix.storage }} + - name: postgres + config-file: log/postgres/e2e.yaml steps: - uses: actions/checkout@v2 with: @@ -65,20 +64,4 @@ jobs: if: env.SKIP_CI != 'true' uses: ./.github/actions/infra-e2e-test with: - test_class: ${{ matrix.case.config-file }} - - LogFluentBit: - if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule') - name: Log (FluentBit) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Set Skip Env Var - uses: ./.github/actions/skip - - name: Run E2E Test - if: env.SKIP_CI != 'true' - uses: ./.github/actions/e2e-test - with: - test_class: org.apache.skywalking.e2e.log.LogFluentBitE2E + config-file: ${{ matrix.case.config-file }} diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml new file mode 100644 index 000000000000..15bf2f68478b --- /dev/null +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -0,0 +1,48 @@ +# 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: + postgres: + image: postgres:13 + networks: + - e2e + expose: + - 5432 + environment: + - POSTGRES_PASSWORD=123456 + - POSTGRES_DB=skywalking + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5432"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: oap + environment: + SW_STORAGE: postgresql + SW_PROMETHEUS_FETCHER: "default" + SW_JDBC_URL: "jdbc:postgresql://postgres:5432/skywalking" + SW_TELEMETRY: prometheus + depends_on: + postgres: + condition: service_healthy + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml new file mode 100644 index 000000000000..ff8a8216c652 --- /dev/null +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -0,0 +1,60 @@ +# 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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file From 48e199e877a87941efefb0b47d1d5945080a9779 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 10:11:15 +0800 Subject: [PATCH 03/23] update e2e --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 59fdffca86cc..15aee0f54f8c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,9 @@ Release Notes. 8.9.0 ------------------ +#### Project + +* replace log e2e cases to e2e-v2. #### OAP Server * Add component definition for `Jackson`. From a7dc60bd60f142c8c99c4d63ab7538c943ab3d2c Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 10:44:02 +0800 Subject: [PATCH 04/23] fix fluentbit & es6 --- .github/workflows/e2e.log.yaml | 2 + test/e2e-v2/cases/log/es6/e2e.yaml | 18 ++++-- test/e2e-v2/cases/log/es7.14/e2e.yaml | 2 +- test/e2e-v2/cases/log/es7/e2e.yaml | 2 +- test/e2e-v2/cases/log/expected/logs.yml | 40 +++++++++---- .../docker-compose.yml} | 8 ++- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 60 +++++++++++++++++++ test/e2e-v2/cases/log/h2/e2e.yaml | 2 +- test/e2e-v2/cases/log/influxdb/e2e.yaml | 2 +- test/e2e-v2/cases/log/mysql/e2e.yaml | 2 +- test/e2e-v2/cases/log/postgres/e2e.yaml | 2 +- .../skywalking/e2e/log/FluentBitE2E.java | 2 +- 12 files changed, 117 insertions(+), 25 deletions(-) rename test/e2e-v2/cases/log/{docker-compose.fluentbit.yml => fluent-bit/docker-compose.yml} (87%) create mode 100644 test/e2e-v2/cases/log/fluent-bit/e2e.yaml diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 1bca941a9167..d7bb63e2c3e2 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -54,6 +54,8 @@ jobs: config-file: log/influxdb/e2e.yaml - name: postgres config-file: log/postgres/e2e.yaml + - name: fluent bit & es6 + config-file: log/fluent-bit/e2e.yaml steps: - uses: actions/checkout@v2 with: diff --git a/test/e2e-v2/cases/log/es6/e2e.yaml b/test/e2e-v2/cases/log/es6/e2e.yaml index ff8a8216c652..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/es6/e2e.yaml +++ b/test/e2e-v2/cases/log/es6/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7.14/e2e.yaml b/test/e2e-v2/cases/log/es7.14/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/es7.14/e2e.yaml +++ b/test/e2e-v2/cases/log/es7.14/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e-v2/cases/log/es7/e2e.yaml b/test/e2e-v2/cases/log/es7/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/es7/e2e.yaml +++ b/test/e2e-v2/cases/log/es7/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e-v2/cases/log/expected/logs.yml b/test/e2e-v2/cases/log/expected/logs.yml index 1c5c38a177cc..d21c60d835f4 100644 --- a/test/e2e-v2/cases/log/expected/logs.yml +++ b/test/e2e-v2/cases/log/expected/logs.yml @@ -14,14 +14,32 @@ # limitations under the License. logs: - - serviceName: not null - serviceId: not null - serviceInstanceName: not null - serviceInstanceId: not null - traceId: not null - timestamp: gt 0 - contentType: TEXT - content: not null - tags: - - key: level - value: INFO \ No newline at end of file + {{- range .logs }} +- servicename: e2e-service-provider + serviceid: {{ b64enc "e2e-service-provider" }}.1 + serviceinstancename: provider1 + serviceinstanceid: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} + endpointname: null + endpointid: null + traceid: {{ .traceid }} + timestamp: {{ gt .timestamp 0 }} + contenttype: TEXT + content: | + {{ notEmpty .content }} + tags: + {{- range .tags }} + {{- if eq .key "level"}} + - key: level + value: INFO + {{- end }} + {{- if eq .key "logger" }} + - key: logger + value: {{ notEmpty .value }} + {{- end }} + {{- if eq .key "thread" }} + - key: thread + value: {{ notEmpty .value }} + {{- end }} + {{- end }} + {{- end }} +total: {{ gt .total 0 }} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/docker-compose.fluentbit.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml similarity index 87% rename from test/e2e-v2/cases/log/docker-compose.fluentbit.yml rename to test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index 2fa84b3d5f49..c86429b074ff 100644 --- a/test/e2e-v2/cases/log/docker-compose.fluentbit.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -32,7 +32,7 @@ services: oap: extends: - file: ../base-compose.yml + file: ../../../script/docker-compose/base-compose.yml service: oap environment: SW_STORAGE: elasticsearch @@ -44,7 +44,7 @@ services: provider: extends: - file: ../base-compose.yml + file: ../../../script/docker-compose/base-compose.yml service: provider volumes: - /tmp/skywalking-logs/:/tmp/skywalking-logs/ @@ -58,7 +58,9 @@ services: image: fluent/fluent-bit:1.7 volumes: - /tmp/skywalking-logs:/tmp/skywalking-logs - - ./fluent-bit:/fluent-bit/etc + - ./fluent-bit.conf:/fluent-bit/etc + - ./fluent-bit-parser.conf:/fluent-bit/etc + - ./fluent-bit-script.lua:/fluent-bit/etc networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml new file mode 100644 index 000000000000..5d78426ff236 --- /dev/null +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -0,0 +1,60 @@ +# 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: success + +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 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 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 + # logs + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index ff8a8216c652..5d78426ff236 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -29,7 +29,7 @@ setup: command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl cleanup: - on: always + on: success trigger: action: http diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java index 75071661d849..c707f760fdba 100644 --- a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java +++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java @@ -31,7 +31,7 @@ public class FluentBitE2E extends LogE2E { @SuppressWarnings("unused") @DockerCompose({ - "docker/log/docker-compose.fluentbit.yml" + "docker/log/docker-compose.yml" }) protected DockerComposeContainer justForSideEffects; From 5640f0fe251a665c96ddf2800d44e30112c2c6ca Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 10:44:36 +0800 Subject: [PATCH 05/23] fix fluentbit & es6 --- test/e2e-v2/cases/log/es7.14/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/es7/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/h2/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/influxdb/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/mysql/e2e.yaml | 16 +++++++++++++--- test/e2e-v2/cases/log/postgres/e2e.yaml | 16 +++++++++++++--- 7 files changed, 91 insertions(+), 21 deletions(-) diff --git a/test/e2e-v2/cases/log/es7.14/e2e.yaml b/test/e2e-v2/cases/log/es7.14/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/es7.14/e2e.yaml +++ b/test/e2e-v2/cases/log/es7.14/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7/e2e.yaml b/test/e2e-v2/cases/log/es7/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/es7/e2e.yaml +++ b/test/e2e-v2/cases/log/es7/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index 5d78426ff236..902bb80a5da2 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -44,17 +44,27 @@ verify: # max retry count count: 20 # the interval between two retries, in millisecond. - interval: 10000 + interval: 10s cases: # service list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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' -) + - 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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) expected: ../expected/service-endpoint.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 # logs - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - query: | + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ + | yq e '.[]|select(.name=="e2e-service-provider").id' - \ + ) --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + ) expected: ../expected/logs.yml \ No newline at end of file From 132f17f2a9e02c5ad2ef1cab174f74d25799d6f1 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 10:49:04 +0800 Subject: [PATCH 06/23] fix rules. --- test/e2e-v2/cases/log/expected/logs.yml | 12 +++--------- .../cases/log/expected/service-endpoint.yml | 4 +--- .../cases/log/expected/service-instance.yml | 18 ++---------------- test/e2e-v2/cases/log/expected/service.yml | 6 +----- 4 files changed, 7 insertions(+), 33 deletions(-) diff --git a/test/e2e-v2/cases/log/expected/logs.yml b/test/e2e-v2/cases/log/expected/logs.yml index d21c60d835f4..594fdeedf63d 100644 --- a/test/e2e-v2/cases/log/expected/logs.yml +++ b/test/e2e-v2/cases/log/expected/logs.yml @@ -14,7 +14,7 @@ # limitations under the License. logs: - {{- range .logs }} +{{- contains .logs }} - servicename: e2e-service-provider serviceid: {{ b64enc "e2e-service-provider" }}.1 serviceinstancename: provider1 @@ -27,19 +27,13 @@ logs: content: | {{ notEmpty .content }} tags: - {{- range .tags }} - {{- if eq .key "level"}} + {{- contains .tags }} - key: level value: INFO - {{- end }} - {{- if eq .key "logger" }} - key: logger value: {{ notEmpty .value }} - {{- end }} - {{- if eq .key "thread" }} - key: thread value: {{ notEmpty .value }} {{- end }} - {{- end }} - {{- end }} +{{- end }} total: {{ gt .total 0 }} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/service-endpoint.yml b/test/e2e-v2/cases/log/expected/service-endpoint.yml index 30b1efb4c70c..53e74043c630 100644 --- a/test/e2e-v2/cases/log/expected/service-endpoint.yml +++ b/test/e2e-v2/cases/log/expected/service-endpoint.yml @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- range .}} -{{- if eq .name "POST:/info" }} +{{- contains .}} - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} name: POST:/info -{{- end}} {{- end}} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/expected/service-instance.yml b/test/e2e-v2/cases/log/expected/service-instance.yml index ef74087afa9d..652b0137133c 100644 --- a/test/e2e-v2/cases/log/expected/service-instance.yml +++ b/test/e2e-v2/cases/log/expected/service-instance.yml @@ -15,39 +15,25 @@ # specific language governing permissions and limitations # under the License. -{{- range .}} +{{- contains .}} - id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "provider1" }} name: {{ notEmpty .name }} 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-provider" }}.1_{{ b64enc "provider1" }} diff --git a/test/e2e-v2/cases/log/expected/service.yml b/test/e2e-v2/cases/log/expected/service.yml index e299d8b97eca..66502d0f3b2b 100644 --- a/test/e2e-v2/cases/log/expected/service.yml +++ b/test/e2e-v2/cases/log/expected/service.yml @@ -13,15 +13,11 @@ # 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 }} {{- end }} \ No newline at end of file From 303e6f8e5a08230a8c5126df8551e85eb7f52e30 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Sun, 3 Oct 2021 11:22:49 +0800 Subject: [PATCH 07/23] fix docker compose in h2 case. --- .../log/h2}/Dockerfile.h2 | 0 test/e2e-v2/cases/log/h2/docker-compose.yml | 4 +-- .../script/dockerfiles/Dockerfile.consumer | 26 -------------- .../script/dockerfiles/Dockerfile.provider | 26 -------------- .../script/dockerfiles/Dockerfile.satellite | 36 ------------------- 5 files changed, 2 insertions(+), 90 deletions(-) rename test/e2e-v2/{script/dockerfiles => cases/log/h2}/Dockerfile.h2 (100%) delete mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.consumer delete mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.provider delete mode 100644 test/e2e-v2/script/dockerfiles/Dockerfile.satellite diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.h2 b/test/e2e-v2/cases/log/h2/Dockerfile.h2 similarity index 100% rename from test/e2e-v2/script/dockerfiles/Dockerfile.h2 rename to test/e2e-v2/cases/log/h2/Dockerfile.h2 diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index 3fbc95c09932..eb79b9c593dc 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -18,8 +18,8 @@ version: '2.1' services: h2db: build: - context: .. - dockerfile: ../../../script/dockerfiles/Dockerfile.h2 + context: . + dockerfile: Dockerfile.h2 networks: - e2e expose: diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.consumer b/test/e2e-v2/script/dockerfiles/Dockerfile.consumer deleted file mode 100644 index 84a7dbc4603c..000000000000 --- a/test/e2e-v2/script/dockerfiles/Dockerfile.consumer +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -ARG SW_AGENT_JDK_VERSION=8 - -FROM ghcr.io/apache/skywalking-java/jdk-${SW_AGENT_JDK_VERSION}:2b519320559ba94131b098e1258bd5fe41d487e4 - -VOLUME /services - -ENV SW_LOGGING_OUTPUT=CONSOLE - -ADD e2e-service-consumer/target/e2e-service-consumer-1.0.0.jar /services/ - -CMD ["sh", "-c", "java -jar /services/e2e-service-consumer-1.0.0.jar"] diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.provider b/test/e2e-v2/script/dockerfiles/Dockerfile.provider deleted file mode 100644 index 525ad0346691..000000000000 --- a/test/e2e-v2/script/dockerfiles/Dockerfile.provider +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -ARG SW_AGENT_JDK_VERSION=8 - -FROM ghcr.io/apache/skywalking-java/jdk-${SW_AGENT_JDK_VERSION}:2b519320559ba94131b098e1258bd5fe41d487e4 - -VOLUME /services - -ENV SW_LOGGING_OUTPUT=CONSOLE - -ADD e2e-service-provider/target/e2e-service-provider-1.0.0.jar /services/ - -CMD ["sh", "-c", "java -jar /services/e2e-service-provider-1.0.0.jar"] diff --git a/test/e2e-v2/script/dockerfiles/Dockerfile.satellite b/test/e2e-v2/script/dockerfiles/Dockerfile.satellite deleted file mode 100644 index 2e0a7a2f342e..000000000000 --- a/test/e2e-v2/script/dockerfiles/Dockerfile.satellite +++ /dev/null @@ -1,36 +0,0 @@ -# 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 golang:1.14 AS builder - -ARG COMMIT_HASH=827f3a45e44cb2a64f874ff17d9eb454a680d08f -ARG SATELLITE_CODE=${COMMIT_HASH}.tar.gz -ARG SATELLITE_CODE_URL=https://github.com/apache/skywalking-satellite/archive/${SATELLITE_CODE} - -ENV CGO_ENABLED=0 - -WORKDIR /skywalking-satellite - -ADD ${SATELLITE_CODE_URL} . -RUN tar -xf ${SATELLITE_CODE} --strip 1 -RUN rm ${SATELLITE_CODE} - -RUN make linux - -FROM alpine:3.10 - -COPY --from=builder /skywalking-satellite/bin/skywalking-satellite-latest-linux-amd64 /sw-satellite - -ENTRYPOINT ["/sw-satellite"] \ No newline at end of file From 0579f0b79e43a23562414e0986ad918a181b9192 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Wed, 13 Oct 2021 09:19:40 +0800 Subject: [PATCH 08/23] update e2e --- .github/workflows/e2e.log.yaml | 24 ++++++++++++------- test/e2e-v2/cases/log/es6/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/es7.14/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/es7/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/h2/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/influxdb/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/mysql/e2e.yaml | 19 ++++----------- test/e2e-v2/cases/log/postgres/e2e.yaml | 19 ++++----------- .../skywalking/e2e/log/FluentBitE2E.java | 2 +- 10 files changed, 57 insertions(+), 121 deletions(-) diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index d7bb63e2c3e2..9f104c67b830 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -44,18 +44,26 @@ jobs: config-file: log/h2/e2e.yaml - name: mysql config-file: log/mysql/e2e.yaml - - name: es6 - config-file: log/es6/e2e.yaml - - name: es7 - config-file: log/es7/e2e.yaml - - name: es7.14 - config-file: log/es7.14/e2e.yaml + include: + - { case: elasticsearch, es-version: 6.3.2, config-file: log/es6/e2e.yaml } + - { case: elasticsearch, es-version: 7.0.0, config-file: log/es7/e2e.yaml } + - { case: elasticsearch, es-version: 7.8.0, config-file: log/es7/e2e.yaml } + - { case: elasticsearch, es-version: 7.10.1, config-file: log/es7/e2e.yaml } + - { case: elasticsearch, es-version: 7.14.0, config-file: log/es7/e2e.yaml } + - { case: elasticsearch, es-version: 7.15.0, config-file: log/es7/e2e.yaml } - name: influxdb config-file: log/influxdb/e2e.yaml - name: postgres config-file: log/postgres/e2e.yaml - - name: fluent bit & es6 - config-file: log/fluent-bit/e2e.yaml + - { case: elasticsearch, es-version: 6.3.2, config-file: log/fluent-bit/e2e.yaml } + - { case: elasticsearch, es-version: 7.0.0, config-file: log/fluent-bit/e2e.yaml } + - { case: elasticsearch, es-version: 7.8.0, config-file: log/fluent-bit/e2e.yaml } + - { case: elasticsearch, es-version: 7.10.1, config-file: log/fluent-bit/e2e.yaml } + - { case: elasticsearch, es-version: 7.14.0, config-file: log/fluent-bit/e2e.yaml } + - { case: elasticsearch, es-version: 7.15.0, config-file: log/fluent-bit/e2e.yaml } + env: + SW_STORAGE: ${{ matrix.case }} + ES_VERSION: ${{ matrix.es-version }} steps: - uses: actions/checkout@v2 with: diff --git a/test/e2e-v2/cases/log/es6/e2e.yaml b/test/e2e-v2/cases/log/es6/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/es6/e2e.yaml +++ b/test/e2e-v2/cases/log/es6/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7.14/e2e.yaml b/test/e2e-v2/cases/log/es7.14/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/es7.14/e2e.yaml +++ b/test/e2e-v2/cases/log/es7.14/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7/e2e.yaml b/test/e2e-v2/cases/log/es7/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/es7/e2e.yaml +++ b/test/e2e-v2/cases/log/es7/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index 902bb80a5da2..2073c809425c 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/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: 10s @@ -50,21 +47,15 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.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 | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider + - 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 # logs - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls \ - | yq e '.[]|select(.name=="e2e-service-provider").id' - \ - ) --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ + | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java index c707f760fdba..75071661d849 100644 --- a/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java +++ b/test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/log/FluentBitE2E.java @@ -31,7 +31,7 @@ public class FluentBitE2E extends LogE2E { @SuppressWarnings("unused") @DockerCompose({ - "docker/log/docker-compose.yml" + "docker/log/docker-compose.fluentbit.yml" }) protected DockerComposeContainer justForSideEffects; From eedc86752fa6846c79ac434813aa9b5eb45a0cf6 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Wed, 13 Oct 2021 09:24:59 +0800 Subject: [PATCH 09/23] fix e2e log --- .github/workflows/e2e.log.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 9f104c67b830..660b80e7e17d 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -61,9 +61,9 @@ jobs: - { case: elasticsearch, es-version: 7.10.1, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.14.0, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.15.0, config-file: log/fluent-bit/e2e.yaml } - env: - SW_STORAGE: ${{ matrix.case }} - ES_VERSION: ${{ matrix.es-version }} + env: + SW_STORAGE: ${{ matrix.case }} + ES_VERSION: ${{ matrix.es-version }} steps: - uses: actions/checkout@v2 with: From 999967d03d4396db4cf99f8f55b0051dea0d0863 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Wed, 13 Oct 2021 09:37:24 +0800 Subject: [PATCH 10/23] fix env in e2e. --- .github/workflows/e2e.log.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 660b80e7e17d..9f104c67b830 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -61,9 +61,9 @@ jobs: - { case: elasticsearch, es-version: 7.10.1, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.14.0, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.15.0, config-file: log/fluent-bit/e2e.yaml } - env: - SW_STORAGE: ${{ matrix.case }} - ES_VERSION: ${{ matrix.es-version }} + env: + SW_STORAGE: ${{ matrix.case }} + ES_VERSION: ${{ matrix.es-version }} steps: - uses: actions/checkout@v2 with: From f485a5381eb179b10180778746b4def8a94a1e27 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Wed, 13 Oct 2021 10:02:12 +0800 Subject: [PATCH 11/23] fix case in e2e. --- .github/workflows/e2e.log.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 9f104c67b830..974bbfdbb9dd 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -44,6 +44,10 @@ jobs: config-file: log/h2/e2e.yaml - name: mysql config-file: log/mysql/e2e.yaml + - name: influxdb + config-file: log/influxdb/e2e.yaml + - name: postgres + config-file: log/postgres/e2e.yaml include: - { case: elasticsearch, es-version: 6.3.2, config-file: log/es6/e2e.yaml } - { case: elasticsearch, es-version: 7.0.0, config-file: log/es7/e2e.yaml } @@ -51,10 +55,6 @@ jobs: - { case: elasticsearch, es-version: 7.10.1, config-file: log/es7/e2e.yaml } - { case: elasticsearch, es-version: 7.14.0, config-file: log/es7/e2e.yaml } - { case: elasticsearch, es-version: 7.15.0, config-file: log/es7/e2e.yaml } - - name: influxdb - config-file: log/influxdb/e2e.yaml - - name: postgres - config-file: log/postgres/e2e.yaml - { case: elasticsearch, es-version: 6.3.2, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.0.0, config-file: log/fluent-bit/e2e.yaml } - { case: elasticsearch, es-version: 7.8.0, config-file: log/fluent-bit/e2e.yaml } From a4dc6ead8fca277a550e0903e1e7cf511c6e1ec0 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Wed, 13 Oct 2021 10:26:27 +0800 Subject: [PATCH 12/23] fix case in e2e. --- .github/workflows/e2e.log.yaml | 54 ++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 974bbfdbb9dd..18c727ed9766 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -49,21 +49,42 @@ jobs: - name: postgres config-file: log/postgres/e2e.yaml include: - - { case: elasticsearch, es-version: 6.3.2, config-file: log/es6/e2e.yaml } - - { case: elasticsearch, es-version: 7.0.0, config-file: log/es7/e2e.yaml } - - { case: elasticsearch, es-version: 7.8.0, config-file: log/es7/e2e.yaml } - - { case: elasticsearch, es-version: 7.10.1, config-file: log/es7/e2e.yaml } - - { case: elasticsearch, es-version: 7.14.0, config-file: log/es7/e2e.yaml } - - { case: elasticsearch, es-version: 7.15.0, config-file: log/es7/e2e.yaml } - - { case: elasticsearch, es-version: 6.3.2, config-file: log/fluent-bit/e2e.yaml } - - { case: elasticsearch, es-version: 7.0.0, config-file: log/fluent-bit/e2e.yaml } - - { case: elasticsearch, es-version: 7.8.0, config-file: log/fluent-bit/e2e.yaml } - - { case: elasticsearch, es-version: 7.10.1, config-file: log/fluent-bit/e2e.yaml } - - { case: elasticsearch, es-version: 7.14.0, config-file: log/fluent-bit/e2e.yaml } - - { case: elasticsearch, es-version: 7.15.0, config-file: log/fluent-bit/e2e.yaml } - env: - SW_STORAGE: ${{ matrix.case }} - ES_VERSION: ${{ matrix.es-version }} + - name: elasticsearch + es-version: 6.3.2 + config-file: log/es6/e2e.yaml + - name: elasticsearch + es-version: 7.0.0 + config-file: log/es7/e2e.yaml + - name: elasticsearch + es-version: 7.8.0 + config-file: log/es7/e2e.yaml + - name: elasticsearch + es-version: 7.10.1 + config-file: log/es7/e2e.yaml + - name: elasticsearch + es-version: 7.14.0 + config-file: log/es7/e2e.yaml + - name: elasticsearch + es-version: 7.15.0 + config-file: log/es7/e2e.yaml + - name: elasticsearch + es-version: 6.3.2 + config-file: log/fluent-bit/e2e.yaml + - name: elasticsearch + es-version: 7.0.0 + config-file: log/fluent-bit/e2e.yaml + - name: elasticsearch + es-version: 7.8.0 + config-file: log/fluent-bit/e2e.yaml + - name: elasticsearch + es-version: 7.10.1 + config-file: log/fluent-bit/e2e.yaml + - name: elasticsearch + es-version: 7.14.0 + config-file: log/fluent-bit/e2e.yaml + - name: elasticsearch + es-version: 7.15.0 + config-file: log/fluent-bit/e2e.yaml steps: - uses: actions/checkout@v2 with: @@ -73,5 +94,8 @@ jobs: - name: Run E2E Test if: env.SKIP_CI != 'true' uses: ./.github/actions/infra-e2e-test + env: + SW_STORAGE: ${{ matrix.case }} + ES_VERSION: ${{ matrix.es-version }} with: config-file: ${{ matrix.case.config-file }} From d3a2edcb4123497ccccb97ea598a627fce611405 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Wed, 13 Oct 2021 10:50:38 +0800 Subject: [PATCH 13/23] Fix and refine matrix --- .github/workflows/e2e.log.yaml | 66 +++++++------------ .../cases/log/{es6 => es}/docker-compose.yml | 2 +- test/e2e-v2/cases/log/{es6 => es}/e2e.yaml | 0 .../cases/log/es7.14/docker-compose.yml | 56 ---------------- test/e2e-v2/cases/log/es7.14/e2e.yaml | 61 ----------------- test/e2e-v2/cases/log/es7/docker-compose.yml | 56 ---------------- test/e2e-v2/cases/log/es7/e2e.yaml | 61 ----------------- .../cases/log/fluent-bit/docker-compose.yml | 2 +- 8 files changed, 27 insertions(+), 277 deletions(-) rename test/e2e-v2/cases/log/{es6 => es}/docker-compose.yml (97%) rename test/e2e-v2/cases/log/{es6 => es}/e2e.yaml (100%) delete mode 100644 test/e2e-v2/cases/log/es7.14/docker-compose.yml delete mode 100644 test/e2e-v2/cases/log/es7.14/e2e.yaml delete mode 100644 test/e2e-v2/cases/log/es7/docker-compose.yml delete mode 100644 test/e2e-v2/cases/log/es7/e2e.yaml diff --git a/.github/workflows/e2e.log.yaml b/.github/workflows/e2e.log.yaml index 18c727ed9766..4cdce4fb7e7e 100644 --- a/.github/workflows/e2e.log.yaml +++ b/.github/workflows/e2e.log.yaml @@ -39,51 +39,36 @@ jobs: timeout-minutes: 90 strategy: matrix: - case: - - name: h2 - config-file: log/h2/e2e.yaml - - name: mysql - config-file: log/mysql/e2e.yaml - - name: influxdb - config-file: log/influxdb/e2e.yaml - - name: postgres - config-file: log/postgres/e2e.yaml + config-file: + - log/h2/e2e.yaml + - log/mysql/e2e.yaml + - log/influxdb/e2e.yaml + - log/postgres/e2e.yaml include: - - name: elasticsearch - es-version: 6.3.2 - config-file: log/es6/e2e.yaml - - name: elasticsearch - es-version: 7.0.0 - config-file: log/es7/e2e.yaml - - name: elasticsearch - es-version: 7.8.0 - config-file: log/es7/e2e.yaml - - name: elasticsearch - es-version: 7.10.1 - config-file: log/es7/e2e.yaml - - name: elasticsearch - es-version: 7.14.0 - config-file: log/es7/e2e.yaml - - name: elasticsearch - es-version: 7.15.0 - config-file: log/es7/e2e.yaml - - name: elasticsearch - es-version: 6.3.2 + - es-version: 6.3.2 + config-file: log/es/e2e.yaml + - es-version: 7.0.0 + config-file: log/es/e2e.yaml + - es-version: 7.8.0 + config-file: log/es/e2e.yaml + - es-version: 7.10.1 + config-file: log/es/e2e.yaml + - es-version: 7.14.0 + config-file: log/es/e2e.yaml + - es-version: 7.15.0 + config-file: log/es/e2e.yaml + + - es-version: 6.3.2 config-file: log/fluent-bit/e2e.yaml - - name: elasticsearch - es-version: 7.0.0 + - es-version: 7.0.0 config-file: log/fluent-bit/e2e.yaml - - name: elasticsearch - es-version: 7.8.0 + - es-version: 7.8.0 config-file: log/fluent-bit/e2e.yaml - - name: elasticsearch - es-version: 7.10.1 + - es-version: 7.10.1 config-file: log/fluent-bit/e2e.yaml - - name: elasticsearch - es-version: 7.14.0 + - es-version: 7.14.0 config-file: log/fluent-bit/e2e.yaml - - name: elasticsearch - es-version: 7.15.0 + - es-version: 7.15.0 config-file: log/fluent-bit/e2e.yaml steps: - uses: actions/checkout@v2 @@ -95,7 +80,6 @@ jobs: if: env.SKIP_CI != 'true' uses: ./.github/actions/infra-e2e-test env: - SW_STORAGE: ${{ matrix.case }} ES_VERSION: ${{ matrix.es-version }} with: - config-file: ${{ matrix.case.config-file }} + config-file: ${{ matrix.config-file }} diff --git a/test/e2e-v2/cases/log/es6/docker-compose.yml b/test/e2e-v2/cases/log/es/docker-compose.yml similarity index 97% rename from test/e2e-v2/cases/log/es6/docker-compose.yml rename to test/e2e-v2/cases/log/es/docker-compose.yml index 35dc028ea230..3ac5a306e781 100644 --- a/test/e2e-v2/cases/log/es6/docker-compose.yml +++ b/test/e2e-v2/cases/log/es/docker-compose.yml @@ -17,7 +17,7 @@ version: '2.1' services: es: - image: elastic/elasticsearch:6.3.2 + image: elastic/elasticsearch:${ES_VERSION} expose: - 9200 networks: diff --git a/test/e2e-v2/cases/log/es6/e2e.yaml b/test/e2e-v2/cases/log/es/e2e.yaml similarity index 100% rename from test/e2e-v2/cases/log/es6/e2e.yaml rename to test/e2e-v2/cases/log/es/e2e.yaml diff --git a/test/e2e-v2/cases/log/es7.14/docker-compose.yml b/test/e2e-v2/cases/log/es7.14/docker-compose.yml deleted file mode 100644 index 553c0dddffcf..000000000000 --- a/test/e2e-v2/cases/log/es7.14/docker-compose.yml +++ /dev/null @@ -1,56 +0,0 @@ -# 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: - es: - image: elastic/elasticsearch:7.14.0 - expose: - - 9200 - networks: - - e2e - environment: - - discovery.type=single-node - healthcheck: - test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] - interval: 5s - timeout: 60s - retries: 120 - - oap: - extends: - file: ../../../script/docker-compose/base-compose.yml - service: oap - environment: - SW_STORAGE: elasticsearch - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml - depends_on: - es: - condition: service_healthy - - provider: - extends: - file: ../../../script/docker-compose/base-compose.yml - service: provider - depends_on: - oap: - condition: service_healthy -networks: - e2e: diff --git a/test/e2e-v2/cases/log/es7.14/e2e.yaml b/test/e2e-v2/cases/log/es7.14/e2e.yaml deleted file mode 100644 index 2073c809425c..000000000000 --- a/test/e2e-v2/cases/log/es7.14/e2e.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# 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: 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: 10s - cases: - # service list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls - expected: ../expected/service.yml - # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider - expected: ../expected/service-endpoint.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 - # logs - - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - - ) - expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/es7/docker-compose.yml b/test/e2e-v2/cases/log/es7/docker-compose.yml deleted file mode 100644 index 922ae23aee90..000000000000 --- a/test/e2e-v2/cases/log/es7/docker-compose.yml +++ /dev/null @@ -1,56 +0,0 @@ -# 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: - es: - image: elastic/elasticsearch:7.4.2 - expose: - - 9200 - networks: - - e2e - environment: - - discovery.type=single-node - healthcheck: - test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] - interval: 5s - timeout: 60s - retries: 120 - - oap: - extends: - file: ../../../script/docker-compose/base-compose.yml - service: oap - environment: - SW_STORAGE: elasticsearch - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml - depends_on: - es: - condition: service_healthy - - provider: - extends: - file: ../../../script/docker-compose/base-compose.yml - service: provider - depends_on: - oap: - condition: service_healthy -networks: - e2e: diff --git a/test/e2e-v2/cases/log/es7/e2e.yaml b/test/e2e-v2/cases/log/es7/e2e.yaml deleted file mode 100644 index 2073c809425c..000000000000 --- a/test/e2e-v2/cases/log/es7/e2e.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# 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: 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: 10s - cases: - # service list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls - expected: ../expected/service.yml - # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider - expected: ../expected/service-endpoint.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 - # logs - - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - - ) - expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index c86429b074ff..fc9b04a4135a 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -17,7 +17,7 @@ version: '2.1' services: es: - image: elastic/elasticsearch:6.3.2 + image: elastic/elasticsearch:${ES_VERSION} expose: - 9200 networks: From 77af9fadc59efbfe7640a745bab6e04d9d27c0ef Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 10:24:35 +0800 Subject: [PATCH 14/23] update fluent mount. --- test/e2e-v2/cases/log/fluent-bit/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index fc9b04a4135a..646e6d886bac 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -58,9 +58,9 @@ services: image: fluent/fluent-bit:1.7 volumes: - /tmp/skywalking-logs:/tmp/skywalking-logs - - ./fluent-bit.conf:/fluent-bit/etc - - ./fluent-bit-parser.conf:/fluent-bit/etc - - ./fluent-bit-script.lua:/fluent-bit/etc + - ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf + - ./fluent-bit-parser.conf:/fluent-bit/etc/fluent-bit-parser.conf + - ./fluent-bit-script.lua:/fluent-bit/etc/fluent-bit-script.lua networks: - e2e depends_on: From 2f97c00c83789feaf82918291b50a67f7466c982 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 10:58:33 +0800 Subject: [PATCH 15/23] fix missed provider service and wrong triggers in e2e. --- test/e2e-v2/cases/log/es/e2e.yaml | 7 +++++-- test/e2e-v2/cases/log/expected/service.yml | 3 --- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 7 +++++-- test/e2e-v2/cases/log/h2/e2e.yaml | 7 +++++-- test/e2e-v2/cases/log/influxdb/e2e.yaml | 7 +++++-- test/e2e-v2/cases/log/mysql/e2e.yaml | 7 +++++-- test/e2e-v2/cases/log/postgres/docker-compose.yml | 8 ++++++++ test/e2e-v2/cases/log/postgres/e2e.yaml | 7 +++++-- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/test/e2e-v2/cases/log/es/e2e.yaml b/test/e2e-v2/cases/log/es/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/es/e2e.yaml +++ b/test/e2e-v2/cases/log/es/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/expected/service.yml b/test/e2e-v2/cases/log/expected/service.yml index 66502d0f3b2b..25f310ffe0ec 100644 --- a/test/e2e-v2/cases/log/expected/service.yml +++ b/test/e2e-v2/cases/log/expected/service.yml @@ -17,7 +17,4 @@ - id: {{ b64enc "e2e-service-provider" }}.1 name: e2e-service-provider group: "" -- id: {{ b64enc "e2e-service-consumer" }}.1 - name: e2e-service-consumer - group: "" {{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml index 15bf2f68478b..7fd6cef68dba 100644 --- a/test/e2e-v2/cases/log/postgres/docker-compose.yml +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -44,5 +44,13 @@ services: postgres: condition: service_healthy + provider: + extends: + file: ../../../script/docker-compose/base-compose.yml + service: provider + depends_on: + oap: + condition: service_healthy + networks: e2e: diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index 2073c809425c..f21585a27f56 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -30,10 +30,13 @@ setup: trigger: action: http - interval: 10s + interval: 3s times: 10 - url: http://${consumer_host}:${consumer_9092}/info + url: http://${provider_host}:${provider_9090}/users method: POST + body: '{"id":"123","name":"skywalking"}' + headers: + "Content-Type": "application/json" verify: # verify with retry strategy From 6c449774960c0adeb7ffdb691e851bae05623da4 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 14:34:22 +0800 Subject: [PATCH 16/23] fix docker compose --- test/e2e-v2/cases/log/es/docker-compose.yml | 10 ++++--- .../cases/log/fluent-bit/docker-compose.yml | 6 ++-- test/e2e-v2/cases/log/h2/docker-compose.yml | 9 +++--- .../cases/log/influxdb/docker-compose.yml | 7 ++--- test/e2e-v2/cases/log/log-base-compose.yml | 30 +++++++++++++++++++ .../e2e-v2/cases/log/mysql/docker-compose.yml | 7 ++--- .../cases/log/postgres/docker-compose.yml | 4 ++- 7 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 test/e2e-v2/cases/log/log-base-compose.yml diff --git a/test/e2e-v2/cases/log/es/docker-compose.yml b/test/e2e-v2/cases/log/es/docker-compose.yml index 3ac5a306e781..11ba55a8ea97 100644 --- a/test/e2e-v2/cases/log/es/docker-compose.yml +++ b/test/e2e-v2/cases/log/es/docker-compose.yml @@ -32,18 +32,18 @@ services: oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: elasticsearch + SW_STORAGE_ES_CLUSTER_NODES: es:9200 SW_LOG_LAL_FILES: test SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml depends_on: es: condition: service_healthy + networks: + - e2e provider: extends: @@ -52,5 +52,7 @@ services: depends_on: oap: condition: service_healthy + networks: + - e2e networks: e2e: diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index 646e6d886bac..88db4a4c8c4e 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -29,13 +29,15 @@ services: interval: 5s timeout: 60s retries: 120 - oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: elasticsearch + SW_STORAGE_ES_CLUSTER_NODES: es:9200 + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test depends_on: es: condition: service_healthy diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index eb79b9c593dc..5db0d028ba21 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -32,19 +32,18 @@ services: oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: h2 SW_STORAGE_H2_URL: jdbc:h2:tcp://h2db:1521/skywalking-oap-db SW_LOG_LAL_FILES: test SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml depends_on: - h2db: + es: condition: service_healthy + networks: + - e2e provider: extends: diff --git a/test/e2e-v2/cases/log/influxdb/docker-compose.yml b/test/e2e-v2/cases/log/influxdb/docker-compose.yml index f9538c8485a9..f19459ebc345 100644 --- a/test/e2e-v2/cases/log/influxdb/docker-compose.yml +++ b/test/e2e-v2/cases/log/influxdb/docker-compose.yml @@ -30,15 +30,14 @@ services: oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: influxdb SW_LOG_LAL_FILES: test SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + networks: + - e2e depends_on: influxdb: condition: service_healthy diff --git a/test/e2e-v2/cases/log/log-base-compose.yml b/test/e2e-v2/cases/log/log-base-compose.yml new file mode 100644 index 000000000000..7607f8e00bd6 --- /dev/null +++ b/test/e2e-v2/cases/log/log-base-compose.yml @@ -0,0 +1,30 @@ +# 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 + volumes: + - ./lal.yaml:/skywalking/config/lal/test.yaml + - ./log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + networks: + - e2e + +networks: + e2e: diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml index 4f649682a501..3dce6098d726 100644 --- a/test/e2e-v2/cases/log/mysql/docker-compose.yml +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -34,15 +34,14 @@ services: oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: mysql SW_LOG_LAL_FILES: test SW_LOG_MAL_FILES: test - volumes: - - ../lal.yaml:/skywalking/config/lal/test.yaml - - ../log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml + networks: + - e2e depends_on: mysql: condition: service_healthy diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml index 7fd6cef68dba..b57642c2b207 100644 --- a/test/e2e-v2/cases/log/postgres/docker-compose.yml +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -33,13 +33,15 @@ services: oap: extends: - file: ../../../script/docker-compose/base-compose.yml + file: ../log-base-compose.yml service: oap environment: SW_STORAGE: postgresql SW_PROMETHEUS_FETCHER: "default" SW_JDBC_URL: "jdbc:postgresql://postgres:5432/skywalking" SW_TELEMETRY: prometheus + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test depends_on: postgres: condition: service_healthy From 0aad2446b7264b66ae924ac6d833f756165b25a8 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 14:48:26 +0800 Subject: [PATCH 17/23] fix typo --- test/e2e-v2/cases/log/h2/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index 5db0d028ba21..334d6a2e7e96 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -40,7 +40,7 @@ services: SW_LOG_LAL_FILES: test SW_LOG_MAL_FILES: test depends_on: - es: + h2db: condition: service_healthy networks: - e2e From c4027c30e1928f1727010a73a3cf26024023d9a2 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 14:50:27 +0800 Subject: [PATCH 18/23] fix endpoints expected. --- test/e2e-v2/cases/log/expected/service-endpoint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e-v2/cases/log/expected/service-endpoint.yml b/test/e2e-v2/cases/log/expected/service-endpoint.yml index 53e74043c630..dd58100f94f4 100644 --- a/test/e2e-v2/cases/log/expected/service-endpoint.yml +++ b/test/e2e-v2/cases/log/expected/service-endpoint.yml @@ -14,6 +14,6 @@ # limitations under the License. {{- contains .}} -- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/info" }} - name: POST:/info +- id: {{ b64enc "e2e-service-provider" }}.1_{{ b64enc "POST:/users" }} + name: POST:/users {{- end}} \ No newline at end of file From 252cfb1d863e05c1dba3ae1934cf2e9b17398b42 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 15:43:19 +0800 Subject: [PATCH 19/23] fix mysql storage mount mysql driver. --- test/e2e-v2/cases/log/es/docker-compose.yml | 2 -- test/e2e-v2/cases/log/fluent-bit/docker-compose.yml | 2 -- test/e2e-v2/cases/log/h2/docker-compose.yml | 4 ++-- test/e2e-v2/cases/log/influxdb/docker-compose.yml | 5 +++-- test/e2e-v2/cases/log/log-base-compose.yml | 3 +++ test/e2e-v2/cases/log/mysql/docker-compose.yml | 8 +++++--- test/e2e-v2/cases/log/mysql/e2e.yaml | 2 ++ test/e2e-v2/cases/log/postgres/docker-compose.yml | 6 ++---- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/test/e2e-v2/cases/log/es/docker-compose.yml b/test/e2e-v2/cases/log/es/docker-compose.yml index 11ba55a8ea97..87e578bc4ce1 100644 --- a/test/e2e-v2/cases/log/es/docker-compose.yml +++ b/test/e2e-v2/cases/log/es/docker-compose.yml @@ -37,8 +37,6 @@ services: environment: SW_STORAGE: elasticsearch SW_STORAGE_ES_CLUSTER_NODES: es:9200 - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test depends_on: es: condition: service_healthy diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index 88db4a4c8c4e..f3a348b55735 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -36,8 +36,6 @@ services: environment: SW_STORAGE: elasticsearch SW_STORAGE_ES_CLUSTER_NODES: es:9200 - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test depends_on: es: condition: service_healthy diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index 334d6a2e7e96..c4d25efc5c15 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -37,8 +37,6 @@ services: environment: SW_STORAGE: h2 SW_STORAGE_H2_URL: jdbc:h2:tcp://h2db:1521/skywalking-oap-db - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test depends_on: h2db: condition: service_healthy @@ -49,6 +47,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + networks: + - e2e depends_on: oap: condition: service_healthy diff --git a/test/e2e-v2/cases/log/influxdb/docker-compose.yml b/test/e2e-v2/cases/log/influxdb/docker-compose.yml index f19459ebc345..6f0e4d7b5516 100644 --- a/test/e2e-v2/cases/log/influxdb/docker-compose.yml +++ b/test/e2e-v2/cases/log/influxdb/docker-compose.yml @@ -34,8 +34,7 @@ services: service: oap environment: SW_STORAGE: influxdb - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test + SW_STORAGE_INFLUXDB_URL: "http://influxdb:8086" networks: - e2e depends_on: @@ -46,6 +45,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + networks: + - e2e depends_on: oap: condition: service_healthy diff --git a/test/e2e-v2/cases/log/log-base-compose.yml b/test/e2e-v2/cases/log/log-base-compose.yml index 7607f8e00bd6..8aebe75ddef1 100644 --- a/test/e2e-v2/cases/log/log-base-compose.yml +++ b/test/e2e-v2/cases/log/log-base-compose.yml @@ -20,6 +20,9 @@ services: extends: file: ../../script/docker-compose/base-compose.yml service: oap + environment: + SW_LOG_LAL_FILES: test + SW_LOG_MAL_FILES: test volumes: - ./lal.yaml:/skywalking/config/lal/test.yaml - ./log-mal.yaml:/skywalking/config/log-mal-rules/test.yaml diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml index 3dce6098d726..5ddf19031c24 100644 --- a/test/e2e-v2/cases/log/mysql/docker-compose.yml +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -38,14 +38,14 @@ services: service: oap environment: SW_STORAGE: mysql - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test + SW_JDBC_URL: "jdbc:mysql://mysql:3306/swtest?rewriteBatchedStatements=true" + volumes: + - /skywalking/oap-libs/mysql-connector-java-8.0.13.jar:/skywalking/oap-libs/mysql-connector-java-8.0.13.jar networks: - e2e depends_on: mysql: condition: service_healthy - entrypoint: ['sh', '-c', '/download-mysql.sh && /skywalking/docker-entrypoint.sh'] provider: extends: @@ -54,6 +54,8 @@ services: depends_on: oap: condition: service_healthy + networks: + - e2e networks: e2e: diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index f21585a27f56..6d7dfab7b555 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -27,6 +27,8 @@ setup: 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 + - name: download mysql driver + command: bash test/e2e-v2/script/prepare/setup-oap/download-mysql.sh trigger: action: http diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml index b57642c2b207..e5b5e7c30cea 100644 --- a/test/e2e-v2/cases/log/postgres/docker-compose.yml +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -37,11 +37,7 @@ services: service: oap environment: SW_STORAGE: postgresql - SW_PROMETHEUS_FETCHER: "default" SW_JDBC_URL: "jdbc:postgresql://postgres:5432/skywalking" - SW_TELEMETRY: prometheus - SW_LOG_LAL_FILES: test - SW_LOG_MAL_FILES: test depends_on: postgres: condition: service_healthy @@ -50,6 +46,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + networks: + - e2e depends_on: oap: condition: service_healthy From 80c682cee1c5f59c021b2863a5611164fcabbffb Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 16:29:14 +0800 Subject: [PATCH 20/23] add ports for provider. --- test/e2e-v2/cases/log/es/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/fluent-bit/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/h2/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/influxdb/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/mysql/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/postgres/docker-compose.yml | 2 ++ 6 files changed, 12 insertions(+) diff --git a/test/e2e-v2/cases/log/es/docker-compose.yml b/test/e2e-v2/cases/log/es/docker-compose.yml index 87e578bc4ce1..98648304e422 100644 --- a/test/e2e-v2/cases/log/es/docker-compose.yml +++ b/test/e2e-v2/cases/log/es/docker-compose.yml @@ -47,6 +47,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + ports: + - 9090 depends_on: oap: condition: service_healthy diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index f3a348b55735..c90426ee135c 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -48,6 +48,8 @@ services: service: provider volumes: - /tmp/skywalking-logs/:/tmp/skywalking-logs/ + ports: + - 9090 networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index c4d25efc5c15..0b34015c8082 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -47,6 +47,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + ports: + - 9090 networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/influxdb/docker-compose.yml b/test/e2e-v2/cases/log/influxdb/docker-compose.yml index 6f0e4d7b5516..5e8e93a1b53f 100644 --- a/test/e2e-v2/cases/log/influxdb/docker-compose.yml +++ b/test/e2e-v2/cases/log/influxdb/docker-compose.yml @@ -45,6 +45,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + ports: + - 9090 networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml index 5ddf19031c24..8a8b3f450470 100644 --- a/test/e2e-v2/cases/log/mysql/docker-compose.yml +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -54,6 +54,8 @@ services: depends_on: oap: condition: service_healthy + ports: + - 9090 networks: - e2e diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml index e5b5e7c30cea..967a41dd059a 100644 --- a/test/e2e-v2/cases/log/postgres/docker-compose.yml +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -46,6 +46,8 @@ services: extends: file: ../../../script/docker-compose/base-compose.yml service: provider + ports: + - 9090 networks: - e2e depends_on: From ef2d10c485930c8a4a1ab94808c78a1406c8b58f Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 16:51:00 +0800 Subject: [PATCH 21/23] add oap port for trigger. --- test/e2e-v2/cases/log/es/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/fluent-bit/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/h2/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/influxdb/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/mysql/docker-compose.yml | 2 ++ test/e2e-v2/cases/log/postgres/docker-compose.yml | 2 ++ 6 files changed, 12 insertions(+) diff --git a/test/e2e-v2/cases/log/es/docker-compose.yml b/test/e2e-v2/cases/log/es/docker-compose.yml index 98648304e422..46edc680882c 100644 --- a/test/e2e-v2/cases/log/es/docker-compose.yml +++ b/test/e2e-v2/cases/log/es/docker-compose.yml @@ -37,6 +37,8 @@ services: environment: SW_STORAGE: elasticsearch SW_STORAGE_ES_CLUSTER_NODES: es:9200 + ports: + - 12800 depends_on: es: condition: service_healthy diff --git a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml index c90426ee135c..2a3e4a2a0088 100644 --- a/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml +++ b/test/e2e-v2/cases/log/fluent-bit/docker-compose.yml @@ -39,6 +39,8 @@ services: depends_on: es: condition: service_healthy + ports: + - 12800 networks: - e2e diff --git a/test/e2e-v2/cases/log/h2/docker-compose.yml b/test/e2e-v2/cases/log/h2/docker-compose.yml index 0b34015c8082..6f657005c24c 100644 --- a/test/e2e-v2/cases/log/h2/docker-compose.yml +++ b/test/e2e-v2/cases/log/h2/docker-compose.yml @@ -40,6 +40,8 @@ services: depends_on: h2db: condition: service_healthy + ports: + - 12800 networks: - e2e diff --git a/test/e2e-v2/cases/log/influxdb/docker-compose.yml b/test/e2e-v2/cases/log/influxdb/docker-compose.yml index 5e8e93a1b53f..5cc28269068b 100644 --- a/test/e2e-v2/cases/log/influxdb/docker-compose.yml +++ b/test/e2e-v2/cases/log/influxdb/docker-compose.yml @@ -35,6 +35,8 @@ services: environment: SW_STORAGE: influxdb SW_STORAGE_INFLUXDB_URL: "http://influxdb:8086" + ports: + - 12800 networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml index 8a8b3f450470..3380d4051a3e 100644 --- a/test/e2e-v2/cases/log/mysql/docker-compose.yml +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -39,6 +39,8 @@ services: environment: SW_STORAGE: mysql SW_JDBC_URL: "jdbc:mysql://mysql:3306/swtest?rewriteBatchedStatements=true" + ports: + - 12800 volumes: - /skywalking/oap-libs/mysql-connector-java-8.0.13.jar:/skywalking/oap-libs/mysql-connector-java-8.0.13.jar networks: diff --git a/test/e2e-v2/cases/log/postgres/docker-compose.yml b/test/e2e-v2/cases/log/postgres/docker-compose.yml index 967a41dd059a..0c97992fd141 100644 --- a/test/e2e-v2/cases/log/postgres/docker-compose.yml +++ b/test/e2e-v2/cases/log/postgres/docker-compose.yml @@ -38,6 +38,8 @@ services: environment: SW_STORAGE: postgresql SW_JDBC_URL: "jdbc:postgresql://postgres:5432/skywalking" + ports: + - 12800 depends_on: postgres: condition: service_healthy From 31d2742fbbf8a4661a997d00bd54007420e7f8f5 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Thu, 14 Oct 2021 18:08:36 +0800 Subject: [PATCH 22/23] update e2e check --- test/e2e-v2/cases/log/es/e2e.yaml | 4 ++-- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 4 ++-- test/e2e-v2/cases/log/h2/e2e.yaml | 4 ++-- test/e2e-v2/cases/log/influxdb/e2e.yaml | 4 ++-- test/e2e-v2/cases/log/mysql/e2e.yaml | 4 ++-- test/e2e-v2/cases/log/postgres/e2e.yaml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/e2e-v2/cases/log/es/e2e.yaml b/test/e2e-v2/cases/log/es/e2e.yaml index f21585a27f56..4f2a04a49bef 100644 --- a/test/e2e-v2/cases/log/es/e2e.yaml +++ b/test/e2e-v2/cases/log/es/e2e.yaml @@ -53,12 +53,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index f21585a27f56..4f2a04a49bef 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -53,12 +53,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index f21585a27f56..4f2a04a49bef 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -53,12 +53,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index f21585a27f56..4f2a04a49bef 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -53,12 +53,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index 6d7dfab7b555..505807bbec29 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -55,12 +55,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index f21585a27f56..4f2a04a49bef 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -53,12 +53,12 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider expected: ../expected/service-endpoint.yml # service instance list - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-entry-provider + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider expected: ../expected/service-instance.yml # logs - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql logs list --service-name=e2e-service-provider --trace-id=$( \ swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls \ - | yq e '.traces | select(.[].endpointnames[0]=="POST:/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | .[0].traceids[0]' - ) expected: ../expected/logs.yml \ No newline at end of file From c4d75159751257b6d00fafaab4195180ecad9729 Mon Sep 17 00:00:00 2001 From: JaredTan95 Date: Fri, 15 Oct 2021 12:09:15 +0800 Subject: [PATCH 23/23] fix mysql --- test/e2e-v2/cases/log/es/e2e.yaml | 2 +- test/e2e-v2/cases/log/fluent-bit/e2e.yaml | 2 +- test/e2e-v2/cases/log/h2/e2e.yaml | 2 +- test/e2e-v2/cases/log/influxdb/e2e.yaml | 2 +- test/e2e-v2/cases/log/mysql/docker-compose.yml | 11 +++++------ test/e2e-v2/cases/log/mysql/e2e.yaml | 4 +--- test/e2e-v2/cases/log/postgres/e2e.yaml | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/test/e2e-v2/cases/log/es/e2e.yaml b/test/e2e-v2/cases/log/es/e2e.yaml index 4f2a04a49bef..6f9824725036 100644 --- a/test/e2e-v2/cases/log/es/e2e.yaml +++ b/test/e2e-v2/cases/log/es/e2e.yaml @@ -50,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider diff --git a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml index 4f2a04a49bef..6f9824725036 100644 --- a/test/e2e-v2/cases/log/fluent-bit/e2e.yaml +++ b/test/e2e-v2/cases/log/fluent-bit/e2e.yaml @@ -50,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider diff --git a/test/e2e-v2/cases/log/h2/e2e.yaml b/test/e2e-v2/cases/log/h2/e2e.yaml index 4f2a04a49bef..6f9824725036 100644 --- a/test/e2e-v2/cases/log/h2/e2e.yaml +++ b/test/e2e-v2/cases/log/h2/e2e.yaml @@ -50,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider diff --git a/test/e2e-v2/cases/log/influxdb/e2e.yaml b/test/e2e-v2/cases/log/influxdb/e2e.yaml index 4f2a04a49bef..6f9824725036 100644 --- a/test/e2e-v2/cases/log/influxdb/e2e.yaml +++ b/test/e2e-v2/cases/log/influxdb/e2e.yaml @@ -50,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider diff --git a/test/e2e-v2/cases/log/mysql/docker-compose.yml b/test/e2e-v2/cases/log/mysql/docker-compose.yml index 3380d4051a3e..8581a9249293 100644 --- a/test/e2e-v2/cases/log/mysql/docker-compose.yml +++ b/test/e2e-v2/cases/log/mysql/docker-compose.yml @@ -23,9 +23,9 @@ services: expose: - 3306 environment: - - MYSQL_ROOT_PASSWORD=root@1234 - - MYSQL_DATABASE=swtest - - MYSQL_ROOT_HOST=% + MYSQL_ROOT_PASSWORD: "root@1234" + MYSQL_DATABASE: "swtest" + MYSQL_ROOT_HOST: "%" healthcheck: test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"] interval: 5s @@ -38,11 +38,10 @@ services: service: oap environment: SW_STORAGE: mysql - SW_JDBC_URL: "jdbc:mysql://mysql:3306/swtest?rewriteBatchedStatements=true" + SW_JDBC_URL: jdbc:mysql://mysql:3306/swtest ports: - 12800 - volumes: - - /skywalking/oap-libs/mysql-connector-java-8.0.13.jar:/skywalking/oap-libs/mysql-connector-java-8.0.13.jar + entrypoint: ['sh', '-c', 'apk add --no-cache bash && /download-mysql.sh && /skywalking/docker-entrypoint.sh'] networks: - e2e depends_on: diff --git a/test/e2e-v2/cases/log/mysql/e2e.yaml b/test/e2e-v2/cases/log/mysql/e2e.yaml index 505807bbec29..6f9824725036 100644 --- a/test/e2e-v2/cases/log/mysql/e2e.yaml +++ b/test/e2e-v2/cases/log/mysql/e2e.yaml @@ -27,8 +27,6 @@ setup: 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 - - name: download mysql driver - command: bash test/e2e-v2/script/prepare/setup-oap/download-mysql.sh trigger: action: http @@ -52,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider diff --git a/test/e2e-v2/cases/log/postgres/e2e.yaml b/test/e2e-v2/cases/log/postgres/e2e.yaml index 4f2a04a49bef..6f9824725036 100644 --- a/test/e2e-v2/cases/log/postgres/e2e.yaml +++ b/test/e2e-v2/cases/log/postgres/e2e.yaml @@ -50,7 +50,7 @@ verify: - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls expected: ../expected/service.yml # service endpoint - - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=info --service-name=e2e-service-provider + - 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 instance list - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=e2e-service-provider