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/25 15:46:01 UTC

[skywalking] branch master updated: Replace e2e cases to e2e-v2: Client-JS (#7999)

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 3470f7f  Replace e2e cases to e2e-v2: Client-JS (#7999)
3470f7f is described below

commit 3470f7fb3b8eb64402cfa338b194a64e9f773dc8
Author: zhang-wei <zh...@apache.org>
AuthorDate: Mon Oct 25 23:44:40 2021 +0800

    Replace e2e cases to e2e-v2: Client-JS (#7999)
---
 .github/workflows/e2e.js.yaml                      |  25 +----
 CHANGES.md                                         |   1 +
 test/e2e-v2/cases/browser/docker-compose.yml       | 117 +++++++++++++++++++++
 .../browser/docker/Dockerfile.generate-traffic}    |  13 ++-
 .../browser/docker/Dockerfile.provider}            |  16 +--
 .../e2e-v2/cases/browser/docker/Dockerfile.test-ui |  49 +++++++++
 test/e2e-v2/cases/browser/docker/index.js          |  51 +++++++++
 .../env => cases/browser/docker/nginx.conf}        |  32 ++++--
 test/e2e-v2/cases/browser/docker/provider.py       |  57 ++++++++++
 .../{script/env => cases/browser/docker/test.py}   |  35 ++++--
 test/e2e-v2/cases/browser/e2e.yaml                 | 114 ++++++++++++++++++++
 .../env => cases/browser/expected/dependency.yml}  |  30 ++++--
 .../env => cases/browser/expected/error-log.yml}   |  25 +++--
 .../expected/metrics-has-value-percentile.yml}     |  40 +++++--
 .../browser/expected/metrics-has-value.yml}        |  12 +--
 .../env => cases/browser/expected/page.yml}        |  10 +-
 .../env => cases/browser/expected/service.yml}     |  11 +-
 .../e2e-v2/cases/browser/expected/trace-detail.yml |  68 ++++++++++++
 .../env => cases/browser/expected/traces.yml}      |  20 ++--
 .../env => cases/browser/expected/version.yml}     |  13 +--
 test/e2e-v2/script/env                             |   4 +-
 21 files changed, 625 insertions(+), 118 deletions(-)

diff --git a/.github/workflows/e2e.js.yaml b/.github/workflows/e2e.js.yaml
index e364900..9d960f8 100644
--- a/.github/workflows/e2e.js.yaml
+++ b/.github/workflows/e2e.js.yaml
@@ -36,11 +36,7 @@ jobs:
     if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule')
     name: Java Script Client
     runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        storage: [ 'h2', 'mysql', 'es6', 'es7', 'influxdb' ]
-    env:
-      SW_STORAGE: ${{ matrix.storage }}
+    timeout-minutes: 30
     steps:
       - uses: actions/checkout@v2
         with:
@@ -49,21 +45,6 @@ jobs:
         uses: ./.github/actions/skip
       - name: Run E2E Test
         if: env.SKIP_CI != 'true'
-        uses: ./.github/actions/e2e-test
+        uses: ./.github/actions/infra-e2e-test
         with:
-          test_class: org.apache.skywalking.e2e.browser.BrowserE2E
-  JavaScriptClientWithRealAgent:
-    if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule')
-    name: Java Script Client With Real Agent
-    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.browser.BrowserWithClientJSE2E
+          config-file: browser/e2e.yaml
\ No newline at end of file
diff --git a/CHANGES.md b/CHANGES.md
index 55601ce..9bc7390 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -23,6 +23,7 @@ Release Notes.
   - Event
   - Profile
   - Kafka: Base, Meter, Log, Profile
+  - Client-JS
 
 #### OAP Server
 
diff --git a/test/e2e-v2/cases/browser/docker-compose.yml b/test/e2e-v2/cases/browser/docker-compose.yml
new file mode 100644
index 0000000..58dd54d
--- /dev/null
+++ b/test/e2e-v2/cases/browser/docker-compose.yml
@@ -0,0 +1,117 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '2.1'
+
+services:
+  oap:
+    extends:
+      file: ../../script/docker-compose/base-compose.yml
+      service: oap
+    ports:
+      - 12800
+    environment:
+      SW_STORAGE: h2
+
+  provider:
+    build:
+      context: ./
+      dockerfile: docker/Dockerfile.provider
+      args:
+        - SW_AGENT_PYTHON_COMMIT=c8479000eb729cc86509222fd48b942edcaaca74
+    command: [ 'python3', '/entrypoint.py' ]
+    networks:
+      - e2e
+    expose:
+      - 9091
+    environment:
+      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
+      SW_AGENT_LOGGING_LEVEL: DEBUG
+    volumes:
+      - ./docker/provider.py:/entrypoint.py
+    depends_on:
+      oap:
+        condition: service_healthy
+    healthcheck:
+      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9091" ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+
+  testui:
+    build:
+      context: ./
+      dockerfile: docker/Dockerfile.test-ui
+      args:
+        - SW_AGENT_CLIENT_JS_TEST_COMMIT=${SW_AGENT_CLIENT_JS_TEST_COMMIT}
+        - SW_AGENT_CLIENT_JS_COMMIT=${SW_AGENT_CLIENT_JS_COMMIT}
+    networks:
+      - e2e
+    ports:
+      - 80
+    depends_on:
+      provider:
+        condition: service_healthy
+      oap:
+        condition: service_healthy
+
+  selenium-hub:
+    image: selenium/hub:4.0.0-alpha-7-prerelease-20201009
+    networks:
+      - e2e
+    expose:
+      - 4444
+    depends_on:
+      testui:
+        condition: service_started
+      provider:
+        condition: service_healthy
+
+  chrome:
+    image: selenium/node-chrome:4.0.0-alpha-7-prerelease-20201009
+    networks:
+      - e2e
+    volumes:
+      - /dev/shm:/dev/shm
+    depends_on:
+      selenium-hub:
+        condition: service_started
+      testui:
+        condition: service_started
+      provider:
+        condition: service_healthy
+    environment:
+      - SE_EVENT_BUS_HOST=selenium-hub
+      - SE_EVENT_BUS_PUBLISH_PORT=4442
+      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
+  generate-traffic:
+    build:
+      context: .
+      dockerfile: docker/Dockerfile.generate-traffic
+    networks:
+      - e2e
+    restart: always
+    depends_on:
+      selenium-hub:
+        condition: service_started
+      chrome:
+        condition: service_started
+      provider:
+        condition: service_healthy
+      testui:
+        condition: service_started
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/docker/Dockerfile.generate-traffic
similarity index 64%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/docker/Dockerfile.generate-traffic
index 65123c1..0939810 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/docker/Dockerfile.generate-traffic
@@ -13,11 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
+FROM python:3.7
 
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+COPY docker/test.py .
+
+RUN pip3 install selenium
+
+CMD ["python3", "/test.py"]
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/docker/Dockerfile.provider
similarity index 64%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/docker/Dockerfile.provider
index 65123c1..085f8c5 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/docker/Dockerfile.provider
@@ -13,11 +13,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
+FROM python:3.7
+ARG SW_AGENT_PYTHON_COMMIT
 
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+WORKDIR /app
+
+RUN git clone https://github.com/apache/skywalking-python.git $(pwd)
+
+RUN git reset --hard ${SW_AGENT_PYTHON_COMMIT} && git submodule update --init
+
+RUN make setup install
diff --git a/test/e2e-v2/cases/browser/docker/Dockerfile.test-ui b/test/e2e-v2/cases/browser/docker/Dockerfile.test-ui
new file mode 100644
index 0000000..da43d5d
--- /dev/null
+++ b/test/e2e-v2/cases/browser/docker/Dockerfile.test-ui
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM node:10.23 AS builder
+
+## download and build skywalking client js
+ARG SW_AGENT_CLIENT_JS_COMMIT
+ARG CLIENT_JS_CODE=${SW_AGENT_CLIENT_JS_COMMIT}.tar.gz
+ARG CLIENT_JS_CODE_URL=https://github.com/apache/skywalking-client-js/archive/${CLIENT_JS_CODE}
+
+WORKDIR /skywalking-client-js
+ADD ${CLIENT_JS_CODE_URL} .
+RUN tar -xf ${CLIENT_JS_CODE} --strip 1 && rm ${CLIENT_JS_CODE}
+RUN npm run rebuild \
+    && npm link
+
+# download and build skywalking client test
+ARG SW_AGENT_CLIENT_JS_TEST_COMMIT
+ARG CLIENT_JS_TEST_CODE=${SW_AGENT_CLIENT_JS_TEST_COMMIT}.tar.gz
+ARG CLIENT_JS_TEST_CODE_URL=https://github.com/SkyAPMTest/skywalking-client-test/archive/${CLIENT_JS_TEST_CODE}
+
+WORKDIR /skywalking-client-test
+ADD ${CLIENT_JS_TEST_CODE_URL} .
+RUN tar -xf ${CLIENT_JS_TEST_CODE} --strip 1 \
+    && rm ${CLIENT_JS_TEST_CODE} \
+    && rm src/index.js
+COPY docker/index.js src/index.js
+
+RUN npm install \
+    && rm -rf node_modules/skywalking-client-js \
+    && npm link skywalking-client-js \
+    && npm run build
+
+FROM nginx:1.19
+
+COPY --from=builder /skywalking-client-test/dist/* /etc/nginx/html/
+COPY docker/nginx.conf /etc/nginx/nginx.conf
diff --git a/test/e2e-v2/cases/browser/docker/index.js b/test/e2e-v2/cases/browser/docker/index.js
new file mode 100644
index 0000000..eae9167
--- /dev/null
+++ b/test/e2e-v2/cases/browser/docker/index.js
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+import ClientMonitor from 'skywalking-client-js';
+import Vue from 'vue';
+
+ClientMonitor.register({
+  service: 'test-ui',
+  pagePath: 'index.html',
+  serviceVersion: 'v1.0.0',
+  vue: Vue,
+  useFmp: true,
+  traceTimeInterval: 2000,
+});
+
+// vue error
+new Vue({
+  methods: {
+    test() {
+      throw {
+        msg: 'vue error',
+        status: 3000
+      }
+    }
+  },
+  created() {
+    this.test();
+  }
+})
+
+fetch('http://provider:9091/info', {
+  method: 'POST',
+  headers: {
+    'Content-Type': 'application/json'
+  },
+}).then((data) => {
+  console.log(data.body);
+})
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/docker/nginx.conf
similarity index 62%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/docker/nginx.conf
index 65123c1..ea88f47 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/docker/nginx.conf
@@ -13,11 +13,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+worker_processes  auto;
+events {
+  worker_connections 1024;
+}
+http {
+  server_tokens off;
+  client_header_timeout 10;
+  client_body_timeout 10;
+  # limit_conn_zone $binary_remote_addr zone=addr:5m;
+  # limit_conn addr 100;
+  index index.html;
+  server {
+    listen 80;
+    location /browser {
+        proxy_pass http://oap:12800;
+    }
+    location /v3 {
+        proxy_pass http://oap:12800;
+    }
+    location /info {
+        proxy_pass http://provider:9091;
+    }
+  }
+}
diff --git a/test/e2e-v2/cases/browser/docker/provider.py b/test/e2e-v2/cases/browser/docker/provider.py
new file mode 100644
index 0000000..83b0cca
--- /dev/null
+++ b/test/e2e-v2/cases/browser/docker/provider.py
@@ -0,0 +1,57 @@
+#
+# 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.
+#
+import time
+
+from urllib import request
+
+from skywalking import agent, config
+
+if __name__ == '__main__':
+    config.service_name = 'provider-py'
+    config.logging_level = 'DEBUG'
+    agent.start()
+
+    import socketserver
+    from http.server import BaseHTTPRequestHandler
+
+    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
+
+        def _send_cors_headers(self):
+            """ sets headers required for cors """
+            self.send_header("Access-Control-Allow-Origin", "*")
+            self.send_header("Access-Control-Allow-Methods", "*")
+            self.send_header("Access-Control-Allow-Headers", "*")
+
+        def do_OPTIONS(self):
+            self.send_response(200)
+            self._send_cors_headers()
+            self.end_headers()
+
+        def do_POST(self):
+            time.sleep(0.5)
+            self.send_response(200)
+            self.send_header('Content-Type', 'application/json')
+            self._send_cors_headers()
+            self.end_headers()
+            self.wfile.write('{"name": "whatever"}'.encode('ascii'))
+
+    PORT = 9091
+    Handler = SimpleHTTPRequestHandler
+
+    with socketserver.TCPServer(("", PORT), Handler) as httpd:
+        print("serving at port", PORT)
+        httpd.serve_forever()
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/docker/test.py
similarity index 56%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/docker/test.py
index 65123c1..7e9a21f 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/docker/test.py
@@ -13,11 +13,30 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+import os
+import time
+
+from selenium import webdriver as wd
+from selenium.webdriver.common.desired_capabilities import DesiredCapabilities as DC
+
+hub_remote_url = os.environ.get("HUB_REMOTE_URL", "http://selenium-hub:4444/wd/hub")
+test_url = os.environ.get("TEST_URL", "http://testui:80/")
+
+
+def test_screenshot():
+    try:
+        driver.get(test_url)
+    except Exception as e:
+        print(e)
+
+try:
+    driver = wd.Remote(
+        command_executor=hub_remote_url,
+        desired_capabilities=DC.CHROME)
+
+    while True:
+        test_screenshot()
+        time.sleep(10)
+
+finally:
+    driver.quit()
diff --git a/test/e2e-v2/cases/browser/e2e.yaml b/test/e2e-v2/cases/browser/e2e.yaml
new file mode 100644
index 0000000..d265ecd
--- /dev/null
+++ b/test/e2e-v2/cases/browser/e2e.yaml
@@ -0,0 +1,114 @@
+# 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
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 20
+    # the interval between two retries, in millisecond.
+    interval: 3s
+  cases:
+    # service
+    - expected: expected/service.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser service ls test-ui
+    # version
+    - expected: expected/version.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser version ls --service-name test-ui
+    # page
+    - expected: expected/page.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser page ls --service-name test-ui
+    # browser error log
+    - expected: expected/error-log.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql browser logs ls --service-name test-ui --version-name v1.0.0
+    # browser service metrics
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_pv --service-id dGVzdC11aQ==.1 |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_error_sum --service-id dGVzdC11aQ==.1 |yq e 'to_entries' -
+    # browser version metrics
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_single_version_pv --service-id dGVzdC11aQ==.1 --instance-name v1.0.0 |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_single_version_error_sum --service-id dGVzdC11aQ==.1 --instance-name v1.0.0 |yq e 'to_entries' -
+    # browser page metrics
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_pv --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_error_sum --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_js_error_sum --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    #  # browser performance metrics
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_dom_analysis_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_dom_ready_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_load_page_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
+          --name=browser_app_page_ttl_avg --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries' -
+    - expected: expected/metrics-has-value-percentile.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear \
+          --name=browser_app_page_dom_ready_percentile --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+    - expected: expected/metrics-has-value-percentile.yml
+      query: |
+        swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics multiple-linear \
+          --name=browser_app_page_load_page_percentile --service-id dGVzdC11aQ==.1 --endpoint-name index.html |yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' -
+    # dependency service
+    - expected: expected/dependency.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-id dGVzdC11aTxicm93c2VyPg==.1
+    # trace
+    - expected: expected/traces.yml
+      query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
+    - expected: expected/trace-detail.yml
+      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 | grep -A 5 'index.html' | tail -n1 | awk -F ' ' '{print $2}')
\ No newline at end of file
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/dependency.yml
similarity index 61%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/dependency.yml
index 65123c1..7cd89cd 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/dependency.yml
@@ -13,11 +13,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+nodes:
+{{- contains .nodes }}
+- id: {{ b64enc "provider-py"}}.1
+  name: provider-py
+  type: Python
+  isreal: true
+- id: {{ b64enc "test-ui<browser>"}}.1
+  name: test-ui<browser>
+  type: null
+  isreal: true
+{{- end }}
+calls:
+{{- contains .calls }}
+- source: {{ b64enc "test-ui<browser>"}}.1
+  sourcecomponents: []
+  target: {{ b64enc "provider-py"}}.1
+  targetcomponents: []
+  id: {{ b64enc "test-ui<browser>"}}.1-{{ b64enc "provider-py"}}.1
+  detectpoints:
+    - CLIENT
+    - SERVER
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/error-log.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/error-log.yml
index 65123c1..f1bd1e6 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/error-log.yml
@@ -12,12 +12,19 @@
 # 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.
-
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+logs:
+{{- contains .logs }}
+- service: test-ui
+  serviceversion: v1.0.0
+  time: {{ gt .time  0 }}
+  pagepath: index.html
+  category: {{ notEmpty .category }}
+  grade: {{ notEmpty .grade }}
+  message: {{ notEmpty .message }}
+  line: 0
+  col: 0
+  stack: ""
+  errorurl: http://testui/
+  firstreportederror: {{ .firstreportederror }}
+{{- end }}
+total: {{ gt .total 0 }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/metrics-has-value-percentile.yml
similarity index 56%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/metrics-has-value-percentile.yml
index 65123c1..ef17490 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/metrics-has-value-percentile.yml
@@ -13,11 +13,35 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+{{- contains . }}
+- key: 0
+  value:
+  {{- contains .value }}
+  - key: {{ notEmpty .key }}
+    value: {{ ge .value 1 }}
+  {{- end }}
+- key: 1
+  value:
+  {{- contains .value }}
+  - key: {{ notEmpty .key }}
+    value: {{ ge .value 1 }}
+  {{- end }}
+- key: 2
+  value:
+  {{- contains .value }}
+  - key: {{ notEmpty .key }}
+    value: {{ ge .value 1 }}
+  {{- end }}
+- key: 3
+  value:
+  {{- contains .value }}
+  - key: {{ notEmpty .key }}
+    value: {{ ge .value 1 }}
+  {{- end }}
+- key: 4
+  value:
+  {{- contains .value }}
+  - key: {{ notEmpty .key }}
+    value: {{ ge .value 1 }}
+  {{- end }}
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/metrics-has-value.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/metrics-has-value.yml
index 65123c1..5359e6d 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/metrics-has-value.yml
@@ -13,11 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+{{- contains . }}
+- key: {{ notEmpty .key }}
+  value: {{ ge .value 1 }}
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/page.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/page.yml
index 65123c1..554fdf8 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/page.yml
@@ -13,11 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+- id: {{ b64enc "test-ui" }}.1_{{ b64enc "index.html" }}
+  name: index.html
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/service.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/service.yml
index 65123c1..b81f77f 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/service.yml
@@ -13,11 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+- id: {{ b64enc "test-ui" }}.1
+  name: test-ui
+  group: ""
diff --git a/test/e2e-v2/cases/browser/expected/trace-detail.yml b/test/e2e-v2/cases/browser/expected/trace-detail.yml
new file mode 100644
index 0000000..3d2bb3d
--- /dev/null
+++ b/test/e2e-v2/cases/browser/expected/trace-detail.yml
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+spans:
+{{- contains .spans }}
+  - traceid: {{ notEmpty .traceid }}
+    segmentid: {{ notEmpty .segmentid }}
+    spanid: 0
+    parentspanid: -1
+    refs: []
+    servicecode: test-ui<browser>
+    serviceinstancename: "v1.0.0"
+    starttime: {{ gt .starttime 0 }}
+    endtime: {{ gt .endtime 0 }}
+    endpointname: index.html
+    type: Exit
+    peer: provider:9091
+    component: ajax
+    iserror: false
+    layer: Http
+    tags:
+      - key: http.method
+        value: POST
+      - key: url
+        value: http://provider:9091/info
+    logs: []
+  - traceid: {{ notEmpty .traceid }}
+    segmentid: {{ notEmpty .segmentid }}
+    spanid: 0
+    parentspanid: -1
+    refs:
+      {{- contains .refs }}
+      - traceid: {{ notEmpty .traceid }}
+        parentsegmentid: {{ notEmpty .parentsegmentid }}
+        parentspanid: 0
+        type: CROSS_PROCESS
+      {{- end }}
+    servicecode: provider-py
+    serviceinstancename: {{ notEmpty .serviceinstancename }}
+    starttime: {{ gt .starttime 0 }}
+    endtime: {{ gt .endtime 0 }}
+    endpointname: /info
+    type: Entry
+    peer: {{ notEmpty .peer  }}
+    component: Python
+    iserror: false
+    layer: Http
+    tags:
+      - key: http.method
+        value: POST
+      - key: http.url
+        value: http://provider:9091/info
+      - key: http.status.code
+        value: "200"
+    logs: []
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/traces.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/traces.yml
index 65123c1..763b930 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/traces.yml
@@ -13,11 +13,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+traces:
+{{- contains .traces }}
+- segmentid: {{ notEmpty .segmentid }}
+  endpointnames:
+  - index.html
+  duration: {{ gt .duration 0 }}
+  start: "{{ notEmpty .start}}"
+  iserror: false
+  traceids:
+  - {{ notEmpty (index .traceids 0) }}
+{{- end }}
+total: {{ gt .total 0 }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/browser/expected/version.yml
similarity index 63%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/browser/expected/version.yml
index 65123c1..ad097ed 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/browser/expected/version.yml
@@ -13,11 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
-SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
-SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
-
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+- id: {{ b64enc "test-ui" }}.1_{{ b64enc "v1.0.0" }}
+  name: v1.0.0
+  attributes: []
+  language: UNKNOWN
+  instanceuuid: {{ b64enc "test-ui" }}.1_{{ b64enc "v1.0.0" }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env
index 65123c1..430faee 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/script/env
@@ -19,5 +19,7 @@ SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
 SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
 SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0
 SW_AGENT_PYTHON_COMMIT=50388c55428d742d73d9733278f04173585de80d
+SW_AGENT_CLIENT_JS_COMMIT=af0565a67d382b683c1dbd94c379b7080db61449
+SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016
 
-SW_CTL_COMMIT=7dfb10bf79f463f16037e1ac352a8b2f5da6f27e
+SW_CTL_COMMIT=48338d3827bddd47f7db320a43978a29c1084e64