You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/10/18 14:47:07 UTC

[skywalking] branch master updated: Replace e2e cases to e2e-v2: Event (#7951)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e59e55  Replace e2e cases to e2e-v2: Event (#7951)
8e59e55 is described below

commit 8e59e550409b7eb61a2393f8841eae87484ffbf0
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Mon Oct 18 22:46:56 2021 +0800

    Replace e2e cases to e2e-v2: Event (#7951)
---
 .github/workflows/e2e.event.yaml                   | 10 +++--
 CHANGES.md                                         |  1 +
 test/e2e-v2/cases/event/es/docker-compose.yml      | 48 +++++++++++++++++++++
 test/e2e-v2/cases/event/es/e2e.yaml                | 37 ++++++++++++++++
 test/e2e-v2/cases/event/event-cases.yaml           | 22 ++++++++++
 test/e2e-v2/cases/event/expected/events.yml        | 37 ++++++++++++++++
 test/e2e-v2/cases/event/expected/report-event.yml  | 16 +++++++
 test/e2e-v2/cases/event/h2/Dockerfile.h2           | 24 +++++++++++
 test/e2e-v2/cases/event/h2/docker-compose.yml      | 50 ++++++++++++++++++++++
 test/e2e-v2/cases/event/h2/e2e.yaml                | 37 ++++++++++++++++
 .../e2e-v2/cases/event/influxdb/docker-compose.yml | 45 +++++++++++++++++++
 test/e2e-v2/cases/event/influxdb/e2e.yaml          | 37 ++++++++++++++++
 test/e2e-v2/cases/event/mysql/docker-compose.yml   | 50 ++++++++++++++++++++++
 test/e2e-v2/cases/event/mysql/e2e.yaml             | 37 ++++++++++++++++
 14 files changed, 448 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/e2e.event.yaml b/.github/workflows/e2e.event.yaml
index 13abeb8..899e0bd 100644
--- a/.github/workflows/e2e.event.yaml
+++ b/.github/workflows/e2e.event.yaml
@@ -38,7 +38,11 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        storage: ['h2', 'mysql', 'es6', 'es7.0', 'influxdb']
+        config-file:
+          - event/h2/e2e.yaml
+          - event/es/e2e.yaml
+          - event/mysql/e2e.yaml
+          - event/influxdb/e2e.yaml
     env:
       SW_STORAGE: ${{ matrix.storage }}
     steps:
@@ -49,6 +53,6 @@ jobs:
         uses: ./.github/actions/skip
       - name: Run E2E Test
         if: env.SKIP_CI != 'true'
-        uses: ./.github/actions/e2e-test
+        uses: ./.github/actions/infra-e2e-test
         with:
-          test_class: org.apache.skywalking.e2e.event.EventE2E
+          config-file: ${{ matrix.config-file }}
diff --git a/CHANGES.md b/CHANGES.md
index 86d1cb2..7f17550 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -20,6 +20,7 @@ Release Notes.
   - Python
   - Storage
   - Cluster
+  - Event
 
 #### OAP Server
 
diff --git a/test/e2e-v2/cases/event/es/docker-compose.yml b/test/e2e-v2/cases/event/es/docker-compose.yml
new file mode 100644
index 0000000..8413ec3
--- /dev/null
+++ b/test/e2e-v2/cases/event/es/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: '3.8'
+
+services:
+  es:
+    image: elastic/elasticsearch:7.15.0
+    expose:
+      - 9200
+    networks:
+      - e2e
+    environment:
+      - discovery.type=single-node
+      - cluster.routing.allocation.disk.threshold_enabled=false
+    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
+    depends_on:
+      es:
+        condition: service_healthy
+    ports:
+    - 11800
+    - 12800
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/cases/event/es/e2e.yaml b/test/e2e-v2/cases/event/es/e2e.yaml
new file mode 100644
index 0000000..91ec5d4
--- /dev/null
+++ b/test/e2e-v2/cases/event/es/e2e.yaml
@@ -0,0 +1,37 @@
+# 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
+
+verify:
+  retry:
+    count: 20
+    interval: 3s
+  cases:
+    - includes:
+        - ../event-cases.yaml
diff --git a/test/e2e-v2/cases/event/event-cases.yaml b/test/e2e-v2/cases/event/event-cases.yaml
new file mode 100644
index 0000000..7304929
--- /dev/null
+++ b/test/e2e-v2/cases/event/event-cases.yaml
@@ -0,0 +1,22 @@
+# 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.
+
+  cases:
+    - query: swctl --grpc-addr=${oap_host}:${oap_11800} event report --uuid=abcde --name=Upgrade --service-name=e2e-service --instance-name=e2e-service-instance --endpoint-name='/e2e-endpoint' --message='Upgrade from {fromVersion} to {toVersion}' --start-time=`date +%s`000 --end-time=`date +%s`999 fromVersion=v1 toVersion=v2
+      expected: expected/report-event.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql event ls
+      expected: expected/events.yml
diff --git a/test/e2e-v2/cases/event/expected/events.yml b/test/e2e-v2/cases/event/expected/events.yml
new file mode 100644
index 0000000..8548b5b
--- /dev/null
+++ b/test/e2e-v2/cases/event/expected/events.yml
@@ -0,0 +1,37 @@
+# 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.
+
+events:
+  {{- contains .events }}
+  - uuid: abcde
+    source:
+      service: e2e-service
+      serviceinstance: e2e-service-instance
+      endpoint: /e2e-endpoint
+    name: Upgrade
+    type: Normal
+    message: Upgrade from {fromVersion} to {toVersion}
+    parameters:
+      {{- contains .parameters }}
+      - key: fromVersion
+        value: v1
+      - key: toVersion
+        value: v2
+      {{- end }}
+    starttime: {{ gt .starttime 0 }}
+    endtime: {{ gt .endtime 0 }}
+  {{- end }}
+total: 1
+
diff --git a/test/e2e-v2/cases/event/expected/report-event.yml b/test/e2e-v2/cases/event/expected/report-event.yml
new file mode 100644
index 0000000..ba37c93
--- /dev/null
+++ b/test/e2e-v2/cases/event/expected/report-event.yml
@@ -0,0 +1,16 @@
+# 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.
+
+level=info msg="Report the event successfully, whose uuid is  abcde" {}
diff --git a/test/e2e-v2/cases/event/h2/Dockerfile.h2 b/test/e2e-v2/cases/event/h2/Dockerfile.h2
new file mode 100644
index 0000000..b77f407
--- /dev/null
+++ b/test/e2e-v2/cases/event/h2/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/cases/event/h2/docker-compose.yml b/test/e2e-v2/cases/event/h2/docker-compose.yml
new file mode 100644
index 0000000..3b3a118
--- /dev/null
+++ b/test/e2e-v2/cases/event/h2/docker-compose.yml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '3.8'
+
+services:
+
+
+  h2db:
+    build:
+      context: .
+      dockerfile: 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
+    depends_on:
+      h2db:
+        condition: service_healthy
+    ports:
+    - 11800
+    - 12800
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/cases/event/h2/e2e.yaml b/test/e2e-v2/cases/event/h2/e2e.yaml
new file mode 100644
index 0000000..91ec5d4
--- /dev/null
+++ b/test/e2e-v2/cases/event/h2/e2e.yaml
@@ -0,0 +1,37 @@
+# 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
+
+verify:
+  retry:
+    count: 20
+    interval: 3s
+  cases:
+    - includes:
+        - ../event-cases.yaml
diff --git a/test/e2e-v2/cases/event/influxdb/docker-compose.yml b/test/e2e-v2/cases/event/influxdb/docker-compose.yml
new file mode 100644
index 0000000..ea477b7
--- /dev/null
+++ b/test/e2e-v2/cases/event/influxdb/docker-compose.yml
@@ -0,0 +1,45 @@
+# 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: '3.8'
+
+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
+    depends_on:
+      influxdb:
+        condition: service_healthy
+    ports:
+    - 11800
+    - 12800
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/cases/event/influxdb/e2e.yaml b/test/e2e-v2/cases/event/influxdb/e2e.yaml
new file mode 100644
index 0000000..91ec5d4
--- /dev/null
+++ b/test/e2e-v2/cases/event/influxdb/e2e.yaml
@@ -0,0 +1,37 @@
+# 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
+
+verify:
+  retry:
+    count: 20
+    interval: 3s
+  cases:
+    - includes:
+        - ../event-cases.yaml
diff --git a/test/e2e-v2/cases/event/mysql/docker-compose.yml b/test/e2e-v2/cases/event/mysql/docker-compose.yml
new file mode 100644
index 0000000..39f77b5
--- /dev/null
+++ b/test/e2e-v2/cases/event/mysql/docker-compose.yml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '3.8'
+
+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
+    depends_on:
+      mysql:
+        condition: service_healthy
+    entrypoint: ['sh', '-c', 'apk add --no-cache bash && /download-mysql.sh && /skywalking/docker-entrypoint.sh']
+    ports:
+    - 11800
+    - 12800
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/cases/event/mysql/e2e.yaml b/test/e2e-v2/cases/event/mysql/e2e.yaml
new file mode 100644
index 0000000..91ec5d4
--- /dev/null
+++ b/test/e2e-v2/cases/event/mysql/e2e.yaml
@@ -0,0 +1,37 @@
+# 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
+
+verify:
+  retry:
+    count: 20
+    interval: 3s
+  cases:
+    - includes:
+        - ../event-cases.yaml