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

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

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

kezhenxu94 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 f4c99db  Replace e2e cases to e2e-v2: Nodejs (#7914)
f4c99db is described below

commit f4c99db4f028a527c166a954007d71cf4c5f40cc
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Wed Oct 13 09:59:29 2021 +0800

    Replace e2e cases to e2e-v2: Nodejs (#7914)
---
 .github/workflows/e2e.nodejs.yaml                  |   4 +-
 CHANGES.md                                         |   1 +
 test/e2e-v2/cases/meter/docker-compose.yml         |   2 +
 .../{script/env => cases/nodejs/Dockerfile.nodejs} |  18 +++-
 test/e2e-v2/cases/nodejs/consumer.ts               |  40 ++++++++
 test/e2e-v2/cases/nodejs/docker-compose.yml        |  92 +++++++++++++++++
 test/e2e-v2/cases/nodejs/e2e.yaml                  | 111 +++++++++++++++++++++
 .../cases/nodejs/expected/dependency-instance.yml  |  41 ++++++++
 .../dependency-services-consumer-nodejs.yml}       |  57 ++++++-----
 .../expected/dependency-services-consumer.yml      |  49 +++++++++
 .../dependency-services-provider-nodejs.yml}       |  46 ++++-----
 .../nodejs/expected/metrics-has-value.yml}         |   9 +-
 .../expected/service-endpoint-consumer-nodejs.yml} |   9 +-
 .../expected/service-endpoint-provider-nodejs.yml} |   9 +-
 .../expected/service-instance-consumer-nodejs.yml  |  32 ++++++
 .../expected/service-instance-provider-nodejs.yml  |  32 ++++++
 .../env => cases/nodejs/expected/service.yml}      |  16 ++-
 .../env => cases/nodejs/expected/traces-list.yml}  |  17 +++-
 test/e2e-v2/cases/nodejs/provider.ts               |  35 +++++++
 test/e2e-v2/script/env                             |   3 +-
 20 files changed, 543 insertions(+), 80 deletions(-)

diff --git a/.github/workflows/e2e.nodejs.yaml b/.github/workflows/e2e.nodejs.yaml
index 4084cc7..3972771 100644
--- a/.github/workflows/e2e.nodejs.yaml
+++ b/.github/workflows/e2e.nodejs.yaml
@@ -45,6 +45,6 @@ jobs:
         uses: ./.github/actions/skip
       - name: Run E2E Test
         if: env.SKIP_CI != 'true'
-        uses: ./.github/actions/e2e-test
+        uses: ./.github/actions/infra-e2e-test
         with:
-          test_class: org.apache.skywalking.e2e.NodeJSE2E
+          config-file: nodejs/e2e.yaml
diff --git a/CHANGES.md b/CHANGES.md
index 6eba553..b23d894 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -26,6 +26,7 @@ Release Notes.
   attribute expression.
 * Refactor the OAL compiler context to improve readability.
 * Fix wrong generated codes of `hashCode` and `remoteHashCode` methods for numeric fields.
+* Replace e2e cases to e2e-v2: Nodejs.
 
 #### UI
 
diff --git a/test/e2e-v2/cases/meter/docker-compose.yml b/test/e2e-v2/cases/meter/docker-compose.yml
index 02217aa..7ab0404 100644
--- a/test/e2e-v2/cases/meter/docker-compose.yml
+++ b/test/e2e-v2/cases/meter/docker-compose.yml
@@ -29,6 +29,8 @@ services:
     extends:
       file: ../../script/docker-compose/base-compose.yml
       service: provider
+    environment:
+      SW_METER_REPORT_INTERVAL: 5
     depends_on:
       oap:
         condition: service_healthy
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/Dockerfile.nodejs
similarity index 72%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/Dockerfile.nodejs
index a7cabcc..e19e81f 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/Dockerfile.nodejs
@@ -13,8 +13,18 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
+FROM node:12
 
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+ARG SW_AGENT_NODEJS_COMMIT
+
+WORKDIR /app
+
+EXPOSE 5050 5051
+
+RUN git clone https://github.com/apache/skywalking-nodejs.git $(pwd)
+
+RUN git reset --hard ${SW_AGENT_NODEJS_COMMIT} && git submodule update --init
+
+RUN npm install
+RUN npm run generate-source
+RUN npm install express axios
diff --git a/test/e2e-v2/cases/nodejs/consumer.ts b/test/e2e-v2/cases/nodejs/consumer.ts
new file mode 100644
index 0000000..f5405e0
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/consumer.ts
@@ -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.
+ *
+ */
+
+import * as http from 'http';
+import agent from './src';
+import axios from 'axios';
+
+agent.start({
+  serviceName: 'consumer',
+  maxBufferSize: 1000,
+});
+
+const server = http.createServer((req, res) => {
+  axios
+  .post(`http://${process.env.SERVER || 'localhost:5000'}${req.url}`, {}, {
+    headers: {
+      'Content-Type': 'application/json'
+    }
+  })
+  .then((r) => res.end(JSON.stringify(r.data)))
+  .catch(err => res.end(JSON.stringify(err.message)));
+});
+
+server.listen(5001, () => console.info('Listening on port 5001...'));
diff --git a/test/e2e-v2/cases/nodejs/docker-compose.yml b/test/e2e-v2/cases/nodejs/docker-compose.yml
new file mode 100644
index 0000000..9345eae
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/docker-compose.yml
@@ -0,0 +1,92 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '2.1'
+
+services:
+  oap:
+    extends:
+      file: ../../script/docker-compose/base-compose.yml
+      service: oap
+    ports:
+      - 12800
+
+  provider:
+    build:
+      context: .
+      dockerfile: Dockerfile.nodejs
+      args:
+        - SW_AGENT_NODEJS_COMMIT=${SW_AGENT_NODEJS_COMMIT}
+    networks:
+      - e2e
+    expose:
+      - 5000
+    environment:
+      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
+      SW_AGENT_INSTANCE: provider-instance
+    volumes:
+      - ./provider.ts:/app/provider.ts
+    depends_on:
+      oap:
+        condition: service_healthy
+    healthcheck:
+      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5000" ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+    entrypoint: [ 'npx', 'ts-node', '/app/provider.ts' ]
+
+  medium:
+    extends:
+      file: ../../script/docker-compose/base-compose.yml
+      service: consumer
+    environment:
+      PROVIDER_URL: http://provider:5000
+    depends_on:
+      oap:
+        condition: service_healthy
+      provider:
+        condition: service_healthy
+
+  consumer:
+    build:
+      context: .
+      dockerfile: Dockerfile.nodejs
+      args:
+        - SW_AGENT_NODEJS_COMMIT=${SW_AGENT_NODEJS_COMMIT}
+    networks:
+      - e2e
+    ports:
+      - 5001
+    environment:
+      SW_AGENT_COLLECTOR_BACKEND_SERVICES: oap:11800
+      SW_AGENT_INSTANCE: consumer-instance
+      SERVER: medium:9092
+    volumes:
+      - ./consumer.ts:/app/consumer.ts
+    depends_on:
+      oap:
+        condition: service_healthy
+      medium:
+        condition: service_healthy
+    healthcheck:
+      test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/5051" ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+    entrypoint: [ 'npx', 'ts-node', '/app/consumer.ts' ]
+
+networks:
+  e2e:
diff --git a/test/e2e-v2/cases/nodejs/e2e.yaml b/test/e2e-v2/cases/nodejs/e2e.yaml
new file mode 100644
index 0000000..9f84214
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/e2e.yaml
@@ -0,0 +1,111 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is used to show how to write configuration files and can be used to test.
+
+setup:
+  env: compose
+  file: docker-compose.yml
+  timeout: 1200
+  init-system-environment: ../../script/env
+  steps:
+    - name: install yq
+      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq
+    - name: install swctl
+      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl
+    - name: install etcdctl
+      command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh etcdctl
+
+trigger:
+  action: http
+  interval: 3s
+  times: 10
+  url: http://${consumer_host}:${consumer_5001}/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: 3s
+  cases:
+    # service list
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
+      expected: expected/service.yml
+    # service instance list
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=provider
+      expected: expected/service-instance-provider-nodejs.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=consumer
+      expected: expected/service-instance-consumer-nodejs.yml
+    # service endpoint
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=provider
+      expected: expected/service-endpoint-provider-nodejs.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint list --keyword=users --service-name=consumer
+      expected: expected/service-endpoint-consumer-nodejs.yml
+    # trace segment list
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls
+      expected: expected/traces-list.yml
+    # dependency service
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=provider
+      expected: expected/dependency-services-provider-nodejs.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=consumer
+      expected: expected/dependency-services-consumer-nodejs.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency service --service-name=e2e-service-consumer
+      expected: expected/dependency-services-consumer.yml
+    # dependency instance
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql dependency instance --service-name=consumer --dest-service-name=e2e-service-consumer
+      expected: expected/dependency-instance.yml
+    # service metrics
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_sla --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_cpm --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_resp_time --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_apdex --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    # service instance metrics
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_resp_time --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_cpm --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_sla --instance-name=provider-instance --service-name=provider |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    # service endpoint metrics
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_cpm --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_avg --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=endpoint_sla --endpoint-name=/users --service-name=consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    # service relation metrics
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm  --service-name=consumer --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm  --service-name=consumer --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_client_cpm  --service-name=e2e-service-consumer --dest-service-name=provider |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_relation_server_cpm  --service-name=e2e-service-consumer --dest-service-name=provider |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    # service instance relation metrics
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_client_cpm  --instance-name=consumer-instance  --service-name=consumer --dest-instance-name=consumer1 --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=service_instance_relation_server_cpm  --instance-name=consumer-instance  --service-name=consumer --dest-instance-name=consumer1 --dest-service-name=e2e-service-consumer |yq e 'to_entries' -
+      expected: expected/metrics-has-value.yml
diff --git a/test/e2e-v2/cases/nodejs/expected/dependency-instance.yml b/test/e2e-v2/cases/nodejs/expected/dependency-instance.yml
new file mode 100644
index 0000000..900f7e1
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/expected/dependency-instance.yml
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+nodes:
+{{- contains .nodes }}
+- id: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
+  name: consumer1
+  serviceid: {{ b64enc "e2e-service-consumer" }}.1
+  servicename: e2e-service-consumer
+  type: Tomcat
+  isreal: true
+- id: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
+  name: consumer-instance
+  serviceid: {{ b64enc "consumer" }}.1
+  servicename: consumer
+  type: ""
+  isreal: true
+{{- end }}
+calls:
+{{- contains .calls }}
+- source: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
+  sourcecomponents: []
+  target: {{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
+  targetcomponents: []
+  id: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}-{{ b64enc "e2e-service-consumer" }}.1_{{ b64enc "consumer1" }}
+  detectpoints:
+    - CLIENT
+    - SERVER
+{{- end }}
diff --git a/test/e2e-v2/cases/meter/docker-compose.yml b/test/e2e-v2/cases/nodejs/expected/dependency-services-consumer-nodejs.yml
similarity index 50%
copy from test/e2e-v2/cases/meter/docker-compose.yml
copy to test/e2e-v2/cases/nodejs/expected/dependency-services-consumer-nodejs.yml
index 02217aa..5188fc0 100644
--- a/test/e2e-v2/cases/meter/docker-compose.yml
+++ b/test/e2e-v2/cases/nodejs/expected/dependency-services-consumer-nodejs.yml
@@ -13,27 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-version: '2.1'
-
-services:
-  oap:
-    environment:
-      SW_METER_ANALYZER_ACTIVE_FILES: spring-sleuth
-    extends:
-      file: ../../script/docker-compose/base-compose.yml
-      service: oap
-    ports:
-      - 12800
-
-  provider:
-    extends:
-      file: ../../script/docker-compose/base-compose.yml
-      service: provider
-    depends_on:
-      oap:
-        condition: service_healthy
-    ports:
-      - 9090
-
-networks:
-  e2e:
+nodes:
+{{- contains .nodes }}
+- id: {{ b64enc "User" }}.0
+  name: User
+  type: USER
+  isreal: false
+- id: {{ b64enc "e2e-service-consumer" }}.1
+  name: e2e-service-consumer
+  type: Tomcat
+  isreal: true
+- id: {{ b64enc "consumer" }}.1
+  name: consumer
+  type: http
+  isreal: true
+{{- end }}
+calls:
+{{- contains .calls }}
+- source: {{ b64enc "consumer" }}.1
+  sourcecomponents: []
+  target: {{ b64enc "e2e-service-consumer" }}.1
+  targetcomponents: []
+  id: {{ b64enc "consumer" }}.1-{{ b64enc "e2e-service-consumer" }}.1
+  detectpoints:
+    - CLIENT
+    - SERVER
+- source: {{ b64enc "User" }}.0
+  sourcecomponents: []
+  target: {{ b64enc "consumer" }}.1
+  targetcomponents: []
+  id: {{ b64enc "User" }}.0-{{ b64enc "consumer" }}.1
+  detectpoints:
+    - SERVER
+{{- end }}
diff --git a/test/e2e-v2/cases/nodejs/expected/dependency-services-consumer.yml b/test/e2e-v2/cases/nodejs/expected/dependency-services-consumer.yml
new file mode 100644
index 0000000..f5bf1ed
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/expected/dependency-services-consumer.yml
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+nodes:
+{{- contains .nodes }}
+- id: {{ b64enc "provider" }}.1
+  name: provider
+  type: Express
+  isreal: true
+- id: {{ b64enc "e2e-service-consumer" }}.1
+  name: e2e-service-consumer
+  type: Tomcat
+  isreal: true
+- id: {{ b64enc "consumer" }}.1
+  name: consumer
+  type: http
+  isreal: true
+{{- end }}
+calls:
+{{- contains .calls }}
+- source: {{ b64enc "e2e-service-consumer" }}.1
+  sourcecomponents: []
+  target: {{ b64enc "provider" }}.1
+  targetcomponents: []
+  id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "provider" }}.1
+  detectpoints:
+    - CLIENT
+    - SERVER
+- source: {{ b64enc "consumer" }}.1
+  sourcecomponents: []
+  target: {{ b64enc "e2e-service-consumer" }}.1
+  targetcomponents: []
+  id: {{ b64enc "consumer" }}.1-{{ b64enc "e2e-service-consumer" }}.1
+  detectpoints:
+    - CLIENT
+    - SERVER
+{{- end }}
diff --git a/test/e2e-v2/cases/meter/docker-compose.yml b/test/e2e-v2/cases/nodejs/expected/dependency-services-provider-nodejs.yml
similarity index 60%
copy from test/e2e-v2/cases/meter/docker-compose.yml
copy to test/e2e-v2/cases/nodejs/expected/dependency-services-provider-nodejs.yml
index 02217aa..f3af4eb 100644
--- a/test/e2e-v2/cases/meter/docker-compose.yml
+++ b/test/e2e-v2/cases/nodejs/expected/dependency-services-provider-nodejs.yml
@@ -13,27 +13,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-version: '2.1'
-
-services:
-  oap:
-    environment:
-      SW_METER_ANALYZER_ACTIVE_FILES: spring-sleuth
-    extends:
-      file: ../../script/docker-compose/base-compose.yml
-      service: oap
-    ports:
-      - 12800
-
-  provider:
-    extends:
-      file: ../../script/docker-compose/base-compose.yml
-      service: provider
-    depends_on:
-      oap:
-        condition: service_healthy
-    ports:
-      - 9090
-
-networks:
-  e2e:
+nodes:
+{{- contains .nodes }}
+- id: {{ b64enc "provider" }}.1
+  name: provider
+  type: Express
+  isreal: true
+- id: {{ b64enc "e2e-service-consumer" }}.1
+  name: e2e-service-consumer
+  type: Tomcat
+  isreal: true
+{{- end }}
+calls:
+{{- contains .calls }}
+- source: {{ b64enc "e2e-service-consumer" }}.1
+  sourcecomponents: []
+  target: {{ b64enc "provider" }}.1
+  targetcomponents: []
+  id: {{ b64enc "e2e-service-consumer" }}.1-{{ b64enc "provider" }}.1
+  detectpoints:
+    - CLIENT
+    - SERVER
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/expected/metrics-has-value.yml
similarity index 75%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/expected/metrics-has-value.yml
index a7cabcc..d9c4985 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/expected/metrics-has-value.yml
@@ -13,8 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+{{- contains . }}
+- key: {{ notEmpty .key }}
+  value: {{ ge .value 1 }}
+{{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/expected/service-endpoint-consumer-nodejs.yml
similarity index 75%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/expected/service-endpoint-consumer-nodejs.yml
index a7cabcc..334098d 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/expected/service-endpoint-consumer-nodejs.yml
@@ -13,8 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+{{- contains .}}
+- id: {{ b64enc "consumer" }}.1_{{ b64enc "/users" }}
+  name: /users
+{{- end}}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/expected/service-endpoint-provider-nodejs.yml
similarity index 75%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/expected/service-endpoint-provider-nodejs.yml
index a7cabcc..6872b35 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/expected/service-endpoint-provider-nodejs.yml
@@ -13,8 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+{{- contains .}}
+- id: {{ b64enc "provider" }}.1_{{ b64enc "/users" }}
+  name: /users
+{{- end}}
diff --git a/test/e2e-v2/cases/nodejs/expected/service-instance-consumer-nodejs.yml b/test/e2e-v2/cases/nodejs/expected/service-instance-consumer-nodejs.yml
new file mode 100644
index 0000000..8c23508
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/expected/service-instance-consumer-nodejs.yml
@@ -0,0 +1,32 @@
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you under
+# the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+{{- contains .}}
+- id: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
+  name: consumer-instance
+  attributes:
+  {{- contains .attributes }}
+  - name: OS Name
+    value: linux
+  - name: ""
+    value: "1"
+  - name: ipv4s
+    value: ""
+  {{- end}}
+  language: UNKNOWN
+  instanceuuid: {{ b64enc "consumer" }}.1_{{ b64enc "consumer-instance" }}
+{{- end}}
diff --git a/test/e2e-v2/cases/nodejs/expected/service-instance-provider-nodejs.yml b/test/e2e-v2/cases/nodejs/expected/service-instance-provider-nodejs.yml
new file mode 100644
index 0000000..196d196
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/expected/service-instance-provider-nodejs.yml
@@ -0,0 +1,32 @@
+# Licensed to Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Apache Software Foundation (ASF) licenses this file to you under
+# the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+{{- contains .}}
+- id: {{ b64enc "provider" }}.1_{{ b64enc "provider-instance" }}
+  name: provider-instance
+  attributes:
+  {{- contains .attributes }}
+  - name: OS Name
+    value: linux
+  - name: ""
+    value: "1"
+  - name: ipv4s
+    value: ""
+  {{- end}}
+  language: UNKNOWN
+  instanceuuid: {{ b64enc "provider" }}.1_{{ b64enc "provider-instance" }}
+{{- end}}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/expected/service.yml
similarity index 75%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/expected/service.yml
index a7cabcc..68428b1 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/expected/service.yml
@@ -13,8 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+{{- contains . }}
+- id: {{ b64enc "consumer" }}.1
+  name: consumer
+  group: ""
+- id: {{ b64enc "provider" }}.1
+  name: provider
+  group: ""
+- id: {{ b64enc "e2e-service-consumer" }}.1
+  name: e2e-service-consumer
+  group: ""
+{{- end }}
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/cases/nodejs/expected/traces-list.yml
similarity index 74%
copy from test/e2e-v2/script/env
copy to test/e2e-v2/cases/nodejs/expected/traces-list.yml
index a7cabcc..2e5d158 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/cases/nodejs/expected/traces-list.yml
@@ -13,8 +13,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
-SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
-SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
-
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+traces:
+{{- contains .traces }}
+- segmentid: {{ notEmpty .segmentid }}
+  endpointnames:
+    - /users
+  duration: {{ ge .duration 0 }}
+  start: "{{ notEmpty .start}}"
+  iserror: false
+  traceids:
+    - {{ (index .traceids 0) }}
+{{- end }}
+total: {{ gt .total 0 }}
diff --git a/test/e2e-v2/cases/nodejs/provider.ts b/test/e2e-v2/cases/nodejs/provider.ts
new file mode 100644
index 0000000..97410c8
--- /dev/null
+++ b/test/e2e-v2/cases/nodejs/provider.ts
@@ -0,0 +1,35 @@
+/*!
+ *
+ * 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 agent from './src';
+
+import express from 'express';
+
+agent.start({
+  serviceName: 'provider',
+  maxBufferSize: 1000,
+});
+const app = express();
+
+const handle = (req, res) => setTimeout(() => res.send({'id': 1, 'name': 'ke'}), 200);
+
+app.get('/users', handle);
+app.post('/users', handle);
+
+app.listen(5000, () => console.info('Listening on port 5000...'));
diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env
index a7cabcc..fb87a8c 100644
--- a/test/e2e-v2/script/env
+++ b/test/e2e-v2/script/env
@@ -16,5 +16,6 @@
 SW_AGENT_JAVA_COMMIT=3997f0256056788bd054ee37e4603c11c0fd6756
 SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
 SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
+SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
 
-SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e
\ No newline at end of file
+SW_CTL_COMMIT=515a6a415f83a2e7ba114ca8c6fc79e2acd0ee4e