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

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


The following commit(s) were added to refs/heads/main by this push:
     new 63be6e80 Add an e2e case to verify cluster mode (#335)
63be6e80 is described below

commit 63be6e80bef82ea274d7352cc7a461b757d28355
Author: Gao Hongtao <hanahm...@gmail.com>
AuthorDate: Thu Sep 21 15:03:46 2023 +0800

    Add an e2e case to verify cluster mode (#335)
---
 .github/workflows/e2e.storage.yml                  |   2 +
 banyand/metadata/client.go                         |  21 ++-
 banyand/metadata/schema/etcd.go                    |   1 +
 banyand/tsdb/buffer.go                             |   2 +-
 pkg/run/run.go                                     |   2 +-
 test/docker/base-compose.yml                       |  34 ++++-
 .../cluster/docker-compose.yml}                    |  64 +++++++--
 test/e2e-v2/cases/cluster/e2e.yaml                 |  50 +++++++
 test/e2e-v2/cases/cluster/storage-cases.yaml       | 154 +++++++++++++++++++++
 test/e2e-v2/script/docker-compose/base-compose.yml |  23 +++
 10 files changed, 331 insertions(+), 22 deletions(-)

diff --git a/.github/workflows/e2e.storage.yml 
b/.github/workflows/e2e.storage.yml
index dec0d6ac..8f35d6d0 100644
--- a/.github/workflows/e2e.storage.yml
+++ b/.github/workflows/e2e.storage.yml
@@ -47,6 +47,8 @@ jobs:
             config: test/e2e-v2/cases/profiling/ebpf/oncpu/banyandb/e2e.yaml
           - name: Event BanyanDB
             config: test/e2e-v2/cases/event/banyandb/e2e.yaml
+          - name: BanyanDB Cluster Mode
+            config: test/e2e-v2/cases/cluster/e2e.yaml
     env:
       TAG: ${{ github.sha }}
     steps:
diff --git a/banyand/metadata/client.go b/banyand/metadata/client.go
index 9a166d38..35ecbcec 100644
--- a/banyand/metadata/client.go
+++ b/banyand/metadata/client.go
@@ -29,6 +29,7 @@ import (
        commonv1 
"github.com/apache/skywalking-banyandb/api/proto/banyandb/common/v1"
        databasev1 
"github.com/apache/skywalking-banyandb/api/proto/banyandb/database/v1"
        "github.com/apache/skywalking-banyandb/banyand/metadata/schema"
+       "github.com/apache/skywalking-banyandb/pkg/logger"
        "github.com/apache/skywalking-banyandb/pkg/run"
 )
 
@@ -87,9 +88,8 @@ func (s *clientService) PreRun(ctx context.Context) error {
                return errors.New("node roles is empty")
        }
        nodeRoles := val.([]databasev1.Role)
-       ctxRegister, cancel := context.WithTimeout(ctx, time.Second*5)
-       defer cancel()
-       return s.schemaRegistry.RegisterNode(ctxRegister, &databasev1.Node{
+       l := logger.GetLogger(s.Name())
+       nodeInfo := &databasev1.Node{
                Metadata: &commonv1.Metadata{
                        Name: node.NodeID,
                },
@@ -97,7 +97,20 @@ func (s *clientService) PreRun(ctx context.Context) error {
                HttpAddress: node.HTTPAddress,
                Roles:       nodeRoles,
                CreatedAt:   timestamppb.Now(),
-       })
+       }
+       for {
+               ctxRegister, cancel := context.WithTimeout(ctx, time.Second*10)
+               err = s.schemaRegistry.RegisterNode(ctxRegister, nodeInfo)
+               cancel()
+               if errors.Is(err, context.DeadlineExceeded) {
+                       l.Warn().Strs("etcd-endpoints", 
s.endpoints).Msg("register node timeout, retrying...")
+                       continue
+               }
+               if err == nil {
+                       l.Info().Stringer("info", nodeInfo).Msg("register node 
successfully")
+               }
+               return err
+       }
 }
 
 func (s *clientService) Serve() run.StopNotify {
diff --git a/banyand/metadata/schema/etcd.go b/banyand/metadata/schema/etcd.go
index d06d865e..8b90490e 100644
--- a/banyand/metadata/schema/etcd.go
+++ b/banyand/metadata/schema/etcd.go
@@ -133,6 +133,7 @@ func NewEtcdSchemaRegistry(options ...RegistryOption) 
(Registry, error) {
                DialTimeout:          5 * time.Second,
                DialKeepAliveTime:    30 * time.Second,
                DialKeepAliveTimeout: 10 * time.Second,
+               AutoSyncInterval:     5 * time.Minute,
                Logger:               l,
        }
        client, err := clientv3.New(config)
diff --git a/banyand/tsdb/buffer.go b/banyand/tsdb/buffer.go
index 2d8764fd..e1fe1c50 100644
--- a/banyand/tsdb/buffer.go
+++ b/banyand/tsdb/buffer.go
@@ -391,6 +391,7 @@ func (bsb *bufferShardBucket) recoveryWorkSegment(segment 
wal.Segment) {
                elementIndex := 0
                for element := values.Front(); element != nil; element = 
element.Next() {
                        timestamp := timestamps[elementIndex]
+                       wg.Add(1)
                        bsb.writeCh <- operation{
                                key:   logEntry.GetSeriesID(),
                                value: element.Value.([]byte),
@@ -403,7 +404,6 @@ func (bsb *bufferShardBucket) recoveryWorkSegment(segment 
wal.Segment) {
                                        }
                                },
                        }
-                       wg.Add(1)
                        elementIndex++
                }
        }
diff --git a/pkg/run/run.go b/pkg/run/run.go
index cd4d4f6d..4da2c23c 100644
--- a/pkg/run/run.go
+++ b/pkg/run/run.go
@@ -395,7 +395,7 @@ func (g *Group) Run(ctx context.Context) (err error) {
                }
                g.log.Debug().Uint32("ran", uint32(idx+1)).Uint32("total", 
uint32(len(g.p))).Str("name", g.p[idx].Name()).Msg("pre-run")
                if err := g.p[idx].PreRun(context.WithValue(ctx, 
common.ContextNodeRolesKey, rr)); err != nil {
-                       return err
+                       return errors.WithMessage(err, fmt.Sprintf("pre-run 
module[%s]", g.p[idx].Name()))
                }
        }
 
diff --git a/test/docker/base-compose.yml b/test/docker/base-compose.yml
index 98f0a428..44a9bd47 100644
--- a/test/docker/base-compose.yml
+++ b/test/docker/base-compose.yml
@@ -25,6 +25,27 @@ services:
       interval: 5s
       timeout: 10s
       retries: 120
+
+  liaison:
+    hostname: liaison
+    expose:
+      - 17912
+      - 2121
+      - 6060
+    command: liaison --etcd-endpoints=http://etcd:2379 
+    healthcheck:
+      test: wget --spider http://localhost:17913 || wget --spider 
--no-check-certificate https://localhost:17913 || exit 1
+      interval: 5s
+      timeout: 10s
+      retries: 120
+  
+  data:
+    hostname: data
+    expose:
+      - 17912
+      - 2121
+      - 6060
+    command: data --etcd-endpoints=http://etcd:2379 
   
   agent:
     image: 
"ghcr.io/apache/skywalking-java/skywalking-java:${SW_AGENT_JAVA_COMMIT}-java8"
@@ -108,7 +129,18 @@ services:
     image: grafana/k6:latest
     ports:
       - "6565:6565"
-   
+
+  etcd:
+    image: gcr.io/etcd-development/etcd:v3.5.9
+    ports:
+      - "2379:2379"
+    command: etcd --listen-client-urls http://0.0.0.0:2379 
--advertise-client-urls http://etcd:2379 --max-request-bytes 10485760 
--backend-batch-limit 10000 
+    healthcheck:
+      test: ["CMD", "etcdctl", "endpoint", "health"]
+      interval: 1m30s
+      timeout: 10s
+      retries: 3
+      start_period: 40s
 
 volumes:
   sw_agent:
\ No newline at end of file
diff --git a/test/e2e-v2/script/docker-compose/base-compose.yml 
b/test/e2e-v2/cases/cluster/docker-compose.yml
similarity index 51%
copy from test/e2e-v2/script/docker-compose/base-compose.yml
copy to test/e2e-v2/cases/cluster/docker-compose.yml
index d44292f1..87956813 100644
--- a/test/e2e-v2/script/docker-compose/base-compose.yml
+++ b/test/e2e-v2/cases/cluster/docker-compose.yml
@@ -16,43 +16,77 @@
 version: '2.1'
 
 services:
-  banyandb:
+  etcd:
     extends:
-      file: ../../../docker/base-compose.yml
-      service: banyandb
-    image: "apache/skywalking-banyandb:${TAG}"
+      file: ../../script/docker-compose/base-compose.yml
+      service: etcd
     networks:
       - e2e
-  
-  agent:
+
+  data:
     extends:
-      file: ../../../docker/base-compose.yml
-      service: agent
+      file: ../../script/docker-compose/base-compose.yml
+      service: data
+    networks:
+      - e2e
+
+  liaison:
+    extends:
+      file: ../../script/docker-compose/base-compose.yml
+      service: liaison
     networks:
       - e2e
 
   oap:
     extends:
-      file: ../../../docker/base-compose.yml
+      file: ../../script/docker-compose/base-compose.yml
       service: oap
+    environment:
+      SW_STORAGE: banyandb
+      SW_STORAGE_BANYANDB_HOST: "liaison"
+    ports:
+      - 12800
+    depends_on:
+      liaison:
+        condition: service_healthy
+
+  agent:
+    extends:
+      file: ../../script/docker-compose/base-compose.yml
+      service: agent
     networks:
       - e2e
-    volumes:
-      - ./../prepare/setup-oap/log4j2.xml:/skywalking/config/log4j2.xml
 
   provider:
     extends:
-      file: ../../../docker/base-compose.yml
+      file: ../../script/docker-compose/base-compose.yml
       service: provider
+    ports:
+      - 9090
     networks:
       - e2e
+    depends_on:
+      oap:
+        condition: service_healthy
+      agent:
+        condition: service_completed_successfully
 
   consumer:
     extends:
-      file: ../../../docker/base-compose.yml
+      file: ../../script/docker-compose/base-compose.yml
       service: consumer
-    networks:
-      - e2e
+    ports:
+      - 9092
+    depends_on:
+      oap:
+        condition: service_healthy
+      provider:
+        condition: service_healthy
+      agent:
+        condition: service_completed_successfully
 
 networks:
   e2e:
+
+volumes:
+  sw_agent:
\ No newline at end of file
diff --git a/test/e2e-v2/cases/cluster/e2e.yaml 
b/test/e2e-v2/cases/cluster/e2e.yaml
new file mode 100644
index 00000000..9f321cc6
--- /dev/null
+++ b/test/e2e-v2/cases/cluster/e2e.yaml
@@ -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.
+
+# 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: 20m
+  init-system-environment: ../../script/env
+  steps:
+    - name: set PATH
+      command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
+    - 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
+
+trigger:
+  action: http
+  interval: 3s
+  times: 10
+  url: http://${consumer_host}:${consumer_9092}/users
+  method: POST
+  body: '{"id":"123","name":"skywalking"}'
+  headers:
+    "Content-Type": "application/json"
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 20
+    # the interval between two retries, in millisecond.
+    interval: 10s
+  cases:
+    - includes:
+      - storage-cases.yaml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/cluster/storage-cases.yaml 
b/test/e2e-v2/cases/cluster/storage-cases.yaml
new file mode 100644
index 00000000..0498a582
--- /dev/null
+++ b/test/e2e-v2/cases/cluster/storage-cases.yaml
@@ -0,0 +1,154 @@
+# 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.
+
+cases:
+  # layer list
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql layer ls
+    expected: ../storage/expected/layer.yml
+  # service list
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql service layer GENERAL
+    expected: ../storage/expected/service.yml
+  # service instance list
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql instance list 
--service-name=e2e-service-provider
+    expected: ../storage/expected/service-instance-provider.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql instance list 
--service-name=e2e-service-consumer
+    expected: ../storage/expected/service-instance-consumer.yml
+  # service endpoint
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql endpoint list 
--keyword=users --service-name=e2e-service-provider
+    expected: ../storage/expected/service-endpoint-provider.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql endpoint list 
--keyword=users --service-name=e2e-service-consumer
+    expected: ../storage/expected/service-endpoint-consumer.yml
+  # dependency service
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql dependency service 
--service-name=e2e-service-provider
+    expected: ../storage/expected/dependency-services-provider.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql dependency service 
--service-name=e2e-service-consumer
+    expected: ../storage/expected/dependency-services-consumer.yml
+  # dependency instance
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql dependency instance 
--service-name=e2e-service-consumer --dest-service-name=e2e-service-provider
+    expected: ../storage/expected/dependency-instance.yml
+  # dependency endpoint
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint 
--service-name=e2e-service-provider --endpoint-name=POST:/users
+    expected: ../storage/expected/dependency-endpoint-provider.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql dependency endpoint 
--service-name=e2e-service-consumer --endpoint-name=POST:/users
+    expected: ../storage/expected/dependency-endpoint-consumer.yml
+  # trace segment list
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql trace ls
+    expected: ../storage/expected/traces-list.yml
+  # negative tags search: relationship should be logical AND instead of 
logical OR
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql trace ls --tags 
http.method=POST,http.status_code=201
+    expected: ../storage/expected/empty-traces-list.yml
+  # trace detail
+  - query: |
+      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql 
trace $( \
+        swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql trace ls \
+          | yq e '.traces | select(.[].endpointnames[0]=="POST:/users") | 
.[0].traceids[0]' -
+      )
+    expected: ../storage/expected/trace-users-detail.yml
+  # service metrics
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics sorted --name 
service_apdex 5
+    expected: ../storage/expected/metrics-top-service.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics top --name 
service_sla 5
+    expected: ../storage/expected/metrics-top-service.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_sla --service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_cpm --service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_resp_time --service-name=e2e-service-provider |yq e 'to_entries' 
-
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_apdex --service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_sla --service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_cpm --service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_resp_time --service-name=e2e-service-consumer |yq e 'to_entries' 
-
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_apdex --service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  # service instance metrics
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_instance_resp_time --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_instance_cpm --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=service_instance_sla --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  # service instance JVM metrics
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_heap --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_heap_max --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_noheap --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_live_count --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_daemon_count --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_peak_count --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_runnable_state_thread_count 
--instance-name=consumer1 --service-name=e2e-service-consumer |yq e 
'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_class_loaded_class_count --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_class_total_loaded_class_count --instance-name=consumer1 
--service-name=e2e-service-consumer |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_heap --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_heap_max --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_memory_noheap --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_live_count --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_daemon_count --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_peak_count --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_thread_runnable_state_thread_count 
--instance-name=provider1 --service-name=e2e-service-provider |yq e 
'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_class_loaded_class_count --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=instance_jvm_class_total_loaded_class_count --instance-name=provider1 
--service-name=e2e-service-provider |yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  # service endpoint metrics
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_cpm --endpoint-name=POST:/users 
--service-name=e2e-service-provider | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_resp_time --endpoint-name=POST:/users 
--service-name=e2e-service-provider | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_sla --endpoint-name=POST:/users 
--service-name=e2e-service-provider | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_cpm --endpoint-name=POST:/users 
--service-name=e2e-service-consumer | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_resp_time --endpoint-name=POST:/users 
--service-name=e2e-service-consumer | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics linear 
--name=endpoint_sla --endpoint-name=POST:/users 
--service-name=e2e-service-consumer | yq e 'to_entries' -
+    expected: ../storage/expected/metrics-has-value.yml
+  # service endpoint metrics percentile
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear 
--name=endpoint_percentile --endpoint-name=POST:/users 
--service-name=e2e-service-consumer |yq e 'to_entries | with(.[] ; 
.value=(.value | to_entries))' -
+    expected: ../storage/expected/metrics-has-value-percentile.yml
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear 
--name=endpoint_percentile --endpoint-name=POST:/users 
--service-name=e2e-service-consumer |yq e 'to_entries | with(.[] ; 
.value=(.value | to_entries))' -
+    expected: ../storage/expected/metrics-has-value-percentile.yml
+
+  # native event: event list
+  - query: swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql event list
+    expected: ../storage/expected/event-list.yml
+
+  - query: |
+      curl -s -XPOST http://${provider_host}:${provider_9090}/users -d 
'{"id":"123","name":"SinglesBar"}' -H "Content-Type: application/json" > 
/dev/null;
+      sleep 5;
+      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql 
trace $( \
+        swctl --display yaml 
--base-url=http://${oap_host}:${oap_12800}/graphql trace ls --order startTime 
--service-name "e2e-service-provider" --endpoint-name "POST:/users" \
+          | yq e '.traces[0].traceids[0]' - \
+      )
+    expected: ../storage/expected/trace-users-detail.yml
diff --git a/test/e2e-v2/script/docker-compose/base-compose.yml 
b/test/e2e-v2/script/docker-compose/base-compose.yml
index d44292f1..0a7354d6 100644
--- a/test/e2e-v2/script/docker-compose/base-compose.yml
+++ b/test/e2e-v2/script/docker-compose/base-compose.yml
@@ -23,6 +23,22 @@ services:
     image: "apache/skywalking-banyandb:${TAG}"
     networks:
       - e2e
+
+  liaison:
+    extends:
+      file: ../../../docker/base-compose.yml
+      service: liaison
+    image: "apache/skywalking-banyandb:${TAG}"
+    networks:
+      - e2e
+
+  data:
+    extends:
+      file: ../../../docker/base-compose.yml
+      service: data
+    image: "apache/skywalking-banyandb:${TAG}"
+    networks:
+      - e2e
   
   agent:
     extends:
@@ -54,5 +70,12 @@ services:
     networks:
       - e2e
 
+  etcd:
+    extends:
+      file: ../../../docker/base-compose.yml
+      service: etcd
+    networks:
+      - e2e
+
 networks:
   e2e:

Reply via email to