From bc735892f332152ffe3a33347c7996dbfca89586 Mon Sep 17 00:00:00 2001 From: heyanlong Date: Sun, 10 Sep 2023 14:08:25 +0800 Subject: [PATCH 01/14] e2e --- test/e2e-v2/cases/php/Dockerfile.php | 45 ++++++++++++++++++++++++++++ test/e2e-v2/script/env | 1 + 2 files changed, 46 insertions(+) create mode 100644 test/e2e-v2/cases/php/Dockerfile.php diff --git a/test/e2e-v2/cases/php/Dockerfile.php b/test/e2e-v2/cases/php/Dockerfile.php new file mode 100644 index 000000000000..0e69bb4792c0 --- /dev/null +++ b/test/e2e-v2/cases/php/Dockerfile.php @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM php:8.1-fpm-bullseye as builder + +ARG SW_AGENT_PHP_COMMIT + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.64.0 + + +RUN apt update \ + && apt install -y wget protobuf-compiler libclang-dev git \ + && wget https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init \ + && chmod +x rustup-init \ + && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host x86_64-unknown-linux-gnu \ + && rm rustup-init \ + && chmod -R a+w $RUSTUP_HOME $CARGO_HOME + +RUN git clone https://github.com/apache/skywalking-php.git $(pwd) + +RUN git reset --hard ${SW_AGENT_PHP_COMMIT} && git submodule update --init + +RUN phpize \ + && ./configure --enable-skywalking_agent \ + && make \ + && make install + +FROM php:8.1-fpm-bullseye +COPY --from=builder /usr/local/etc/php/conf.d/docker-php-ext-skywalking_agent.ini /usr/local/etc/php/conf.d/ +COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ \ No newline at end of file diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 2c5956f986eb..448b00a23e22 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -24,5 +24,6 @@ SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016 SW_KUBERNETES_COMMIT_SHA=e2c61c6774cf377b23516fca6f8a1e119d3191c5 SW_ROVER_COMMIT=fc8d074c6d34ecfee585a7097cbd5aef1ca680a5 SW_BANYANDB_COMMIT=df34a83663d66af9687ff484884ceae669c83980 +SW_AGENT_PHP_COMMIT=81e04a242b0b7089e2a43fe72b90614bd2a2ffc5 SW_CTL_COMMIT=9d2d0edccda2afe5cf24f1e632142f40e80e8fa4 From 391835febbe4393b9844fd7a63d4177d9a6d7a0f Mon Sep 17 00:00:00 2001 From: heyanlong Date: Thu, 14 Sep 2023 10:16:35 +0800 Subject: [PATCH 02/14] e2e --- test/e2e-v2/cases/php/Dockerfile.php | 11 +++-- test/e2e-v2/cases/php/docker-compose.yml | 9 +++- test/e2e-v2/cases/php/entrypoint.sh | 19 ++++++++ test/e2e-v2/cases/php/nginx.conf | 62 ++++++++++++++++++++++++ test/e2e-v2/cases/php/php.ini | 16 +++--- 5 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 test/e2e-v2/cases/php/entrypoint.sh create mode 100644 test/e2e-v2/cases/php/nginx.conf diff --git a/test/e2e-v2/cases/php/Dockerfile.php b/test/e2e-v2/cases/php/Dockerfile.php index 0e69bb4792c0..8932c9abec35 100644 --- a/test/e2e-v2/cases/php/Dockerfile.php +++ b/test/e2e-v2/cases/php/Dockerfile.php @@ -22,7 +22,7 @@ PATH=/usr/local/cargo/bin:$PATH \ RUST_VERSION=1.64.0 - +WORKDIR /tmp RUN apt update \ && apt install -y wget protobuf-compiler libclang-dev git \ && wget https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init \ @@ -41,5 +41,10 @@ && make install FROM php:8.1-fpm-bullseye -COPY --from=builder /usr/local/etc/php/conf.d/docker-php-ext-skywalking_agent.ini /usr/local/etc/php/conf.d/ -COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ \ No newline at end of file +RUN apt update \ + && apt install -y nginx \ + && cd / \ + && rm -rf /var/cache/apk/* +COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/test/e2e-v2/cases/php/docker-compose.yml b/test/e2e-v2/cases/php/docker-compose.yml index eb921cf25a92..187eaf529dcd 100644 --- a/test/e2e-v2/cases/php/docker-compose.yml +++ b/test/e2e-v2/cases/php/docker-compose.yml @@ -24,7 +24,11 @@ services: - 12800 php: - image: skyapm/skywalking-php:v4.2.0-8.0-fpm-alpine + build: + context: . + dockerfile: Dockerfile.php + args: + - SW_AGENT_PHP_COMMIT=${SW_AGENT_PHP_COMMIT} networks: - e2e ports: @@ -36,7 +40,8 @@ services: condition: service_healthy volumes: - ./index.php:/var/www/html/index.php - - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking.ini + - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini + - ./entrypoint.sh:/entrypoint.sh provider: extends: diff --git a/test/e2e-v2/cases/php/entrypoint.sh b/test/e2e-v2/cases/php/entrypoint.sh new file mode 100644 index 000000000000..27d1919751ea --- /dev/null +++ b/test/e2e-v2/cases/php/entrypoint.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# 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. + + +nginx +php-fpm \ No newline at end of file diff --git a/test/e2e-v2/cases/php/nginx.conf b/test/e2e-v2/cases/php/nginx.conf new file mode 100644 index 000000000000..2a87938d1224 --- /dev/null +++ b/test/e2e-v2/cases/php/nginx.conf @@ -0,0 +1,62 @@ +# 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. + + +user www-data; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + server { + listen 8080; + root /var/www/html; + index index.php; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + } +} \ No newline at end of file diff --git a/test/e2e-v2/cases/php/php.ini b/test/e2e-v2/cases/php/php.ini index 2fbef153c9bd..fa299094bb4b 100644 --- a/test/e2e-v2/cases/php/php.ini +++ b/test/e2e-v2/cases/php/php.ini @@ -14,13 +14,11 @@ ; limitations under the License. -[skywalking] -extension=skywalking.so -skywalking.app_code = php -skywalking.enable = 1 -skywalking.version = 8 -skywalking.grpc = oap:11800 -skywalking.error_handler_enable = 0 -skywalking.sample_n_per_3_secs = -1 -skywalking.instance_name = "php-instance" +[skywalking_agent] +extension = skywalking_agent.so +skywalking_agent.service_name = php +skywalking_agent.enable = 1 +skywalking_agent.log_file = /tmp/skywalking-agent.log +skywalking_agent.log_level = DEBUG +skywalking_agent.server_addr = oap:11800 From eb834b6f41495e9c175f4ac02921da509de2cd5e Mon Sep 17 00:00:00 2001 From: simonluo345 <101088629+simonluo345@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:10:14 -0700 Subject: [PATCH 03/14] Update Dockerfile.php added COPY entrypoint.sh /entrypoint.sh --- test/e2e-v2/cases/php/Dockerfile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e-v2/cases/php/Dockerfile.php b/test/e2e-v2/cases/php/Dockerfile.php index 8932c9abec35..70f5cf344e8e 100644 --- a/test/e2e-v2/cases/php/Dockerfile.php +++ b/test/e2e-v2/cases/php/Dockerfile.php @@ -46,5 +46,6 @@ && cd / \ && rm -rf /var/cache/apk/* COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ +COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] From d8d4b1ae36e512b0377a269ebf3ec0012f1126e7 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Fri, 15 Sep 2023 00:30:00 -0700 Subject: [PATCH 04/14] modified entrypoint.sh --- test/e2e-v2/cases/php/entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/e2e-v2/cases/php/entrypoint.sh diff --git a/test/e2e-v2/cases/php/entrypoint.sh b/test/e2e-v2/cases/php/entrypoint.sh old mode 100644 new mode 100755 From 0cdcd0b4bcae6de038fc72ac71426281857b9d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=BB=B6=E9=BE=99?= Date: Fri, 15 Sep 2023 17:57:21 +0800 Subject: [PATCH 05/14] Update Dockerfile.php --- test/e2e-v2/cases/php/Dockerfile.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/e2e-v2/cases/php/Dockerfile.php b/test/e2e-v2/cases/php/Dockerfile.php index 70f5cf344e8e..f3fe4c8f6430 100644 --- a/test/e2e-v2/cases/php/Dockerfile.php +++ b/test/e2e-v2/cases/php/Dockerfile.php @@ -48,4 +48,7 @@ COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ COPY entrypoint.sh /entrypoint.sh +EXPOSE 9000 +EXPOSE 8080 + ENTRYPOINT ["/entrypoint.sh"] From 93fe0ec42a6bd8361c60808fd5c51d1f790dab97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=BB=B6=E9=BE=99?= Date: Fri, 15 Sep 2023 17:57:49 +0800 Subject: [PATCH 06/14] Update docker-compose.yml --- test/e2e-v2/cases/php/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e-v2/cases/php/docker-compose.yml b/test/e2e-v2/cases/php/docker-compose.yml index 187eaf529dcd..b22a1ceabb2c 100644 --- a/test/e2e-v2/cases/php/docker-compose.yml +++ b/test/e2e-v2/cases/php/docker-compose.yml @@ -41,7 +41,6 @@ services: volumes: - ./index.php:/var/www/html/index.php - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini - - ./entrypoint.sh:/entrypoint.sh provider: extends: From 39f442553a84d05760478311aae88e3b653a8ca1 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Sun, 17 Sep 2023 20:54:38 -0700 Subject: [PATCH 07/14] Fix: context deadline exceeded --- test/e2e-v2/cases/php/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e-v2/cases/php/docker-compose.yml b/test/e2e-v2/cases/php/docker-compose.yml index b22a1ceabb2c..6ba2b11a0f03 100644 --- a/test/e2e-v2/cases/php/docker-compose.yml +++ b/test/e2e-v2/cases/php/docker-compose.yml @@ -41,6 +41,7 @@ services: volumes: - ./index.php:/var/www/html/index.php - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini + - .nginx.conf:/etc/nginx/nginx.conf provider: extends: From fb8d9bd2fa5c8ae291fc367b43de4e499d3bb192 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Sun, 17 Sep 2023 21:05:30 -0700 Subject: [PATCH 08/14] Fixed value changed to random value --- test/e2e-v2/cases/php/expected/service-instance-php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e-v2/cases/php/expected/service-instance-php.yml b/test/e2e-v2/cases/php/expected/service-instance-php.yml index 52a1343dc116..8ab1a1595a47 100644 --- a/test/e2e-v2/cases/php/expected/service-instance-php.yml +++ b/test/e2e-v2/cases/php/expected/service-instance-php.yml @@ -16,7 +16,7 @@ # under the License. shadow {{- contains .}} -- id: {{ b64enc "php" }}.1_{{ b64enc "php-instance" }} +- id: {{ notEmpty .value }} name: php-instance attributes: {{- contains .attributes }} @@ -30,5 +30,5 @@ value: {{ notEmpty .value }} {{- end}} language: PHP - instanceuuid: {{ b64enc "php" }}.1_{{ b64enc "php-instance" }} + instanceuuid: {{ notEmpty .value }} {{- end}} From 70237088ae06e999f14d60d6e0b52576e2281b65 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Sun, 17 Sep 2023 21:38:34 -0700 Subject: [PATCH 09/14] fix minor error for the random value --- test/e2e-v2/cases/php/expected/service-instance-php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e-v2/cases/php/expected/service-instance-php.yml b/test/e2e-v2/cases/php/expected/service-instance-php.yml index 8ab1a1595a47..3b4fe7ca3589 100644 --- a/test/e2e-v2/cases/php/expected/service-instance-php.yml +++ b/test/e2e-v2/cases/php/expected/service-instance-php.yml @@ -16,7 +16,7 @@ # under the License. shadow {{- contains .}} -- id: {{ notEmpty .value }} +- id: {{ notEmpty .id }} name: php-instance attributes: {{- contains .attributes }} @@ -30,5 +30,5 @@ value: {{ notEmpty .value }} {{- end}} language: PHP - instanceuuid: {{ notEmpty .value }} + instanceuuid: {{ notEmpty .instanceuuid }} {{- end}} From 01318f0d34457f1790e547028f63862a352b73b8 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Tue, 19 Sep 2023 18:30:13 -0700 Subject: [PATCH 10/14] Fixed: Topology display error --- test/e2e-v2/script/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 448b00a23e22..449df4ae3461 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -24,6 +24,6 @@ SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016 SW_KUBERNETES_COMMIT_SHA=e2c61c6774cf377b23516fca6f8a1e119d3191c5 SW_ROVER_COMMIT=fc8d074c6d34ecfee585a7097cbd5aef1ca680a5 SW_BANYANDB_COMMIT=df34a83663d66af9687ff484884ceae669c83980 -SW_AGENT_PHP_COMMIT=81e04a242b0b7089e2a43fe72b90614bd2a2ffc5 +SW_AGENT_PHP_COMMIT=3192c553002707d344bd6774cfab5bc61f67a1d3 SW_CTL_COMMIT=9d2d0edccda2afe5cf24f1e632142f40e80e8fa4 From 74ebe248bab8d4da0f3f79da5183d3ff4e256c43 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Wed, 27 Sep 2023 00:38:39 -0700 Subject: [PATCH 11/14] updated remaining 9 files and passed tests --- test/e2e-v2/cases/php/docker-compose.yml | 2 +- test/e2e-v2/cases/php/e2e.yaml | 2 +- .../cases/php/expected/metrics-has-value.yml | 4 +-- .../php/expected/service-endpoint-php.yml | 4 +-- .../php/expected/service-instance-php.yml | 8 ++--- .../cases/php/expected/trace-info-detail.yml | 32 ++++++++++++------- .../cases/php/expected/traces-list-php.yml | 6 ++-- .../php/expected/traces-list-provider.yml | 2 +- test/e2e-v2/cases/php/php.ini | 3 ++ 9 files changed, 37 insertions(+), 26 deletions(-) diff --git a/test/e2e-v2/cases/php/docker-compose.yml b/test/e2e-v2/cases/php/docker-compose.yml index 6ba2b11a0f03..91120d4b56a0 100644 --- a/test/e2e-v2/cases/php/docker-compose.yml +++ b/test/e2e-v2/cases/php/docker-compose.yml @@ -41,7 +41,7 @@ services: volumes: - ./index.php:/var/www/html/index.php - ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini - - .nginx.conf:/etc/nginx/nginx.conf + - ./nginx.conf:/etc/nginx/nginx.conf provider: extends: diff --git a/test/e2e-v2/cases/php/e2e.yaml b/test/e2e-v2/cases/php/e2e.yaml index f0727a1ca146..046daa028fec 100644 --- a/test/e2e-v2/cases/php/e2e.yaml +++ b/test/e2e-v2/cases/php/e2e.yaml @@ -68,7 +68,7 @@ verify: - 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 --service-name=php\ - | yq e '.traces | select(.[].endpointnames[0]=="/php/info") | .[0].traceids[0]' - + | yq e '.traces | select(.[].endpointnames[0]=="POST:/php/info") | .[0].traceids[0]' - ) expected: expected/trace-info-detail.yml # dependency service diff --git a/test/e2e-v2/cases/php/expected/metrics-has-value.yml b/test/e2e-v2/cases/php/expected/metrics-has-value.yml index 04b077dd982c..474e0ef1e441 100644 --- a/test/e2e-v2/cases/php/expected/metrics-has-value.yml +++ b/test/e2e-v2/cases/php/expected/metrics-has-value.yml @@ -20,6 +20,6 @@ isemptyvalue: true - key: {{ notEmpty .key }} value: - value: {{ ge .value.value 1 }} - isemptyvalue: false + value: 0 + isemptyvalue: true {{- end }} diff --git a/test/e2e-v2/cases/php/expected/service-endpoint-php.yml b/test/e2e-v2/cases/php/expected/service-endpoint-php.yml index 91e5011cb615..905e06361419 100644 --- a/test/e2e-v2/cases/php/expected/service-endpoint-php.yml +++ b/test/e2e-v2/cases/php/expected/service-endpoint-php.yml @@ -14,6 +14,6 @@ # limitations under the License. {{- contains . }} -- id: {{ b64enc "php" }}.1_{{ b64enc "/php/info" }} - name: /php/info +- id: {{ b64enc "php" }}.1_{{ b64enc "POST:/php/info" }} + name: POST:/php/info {{- end}} diff --git a/test/e2e-v2/cases/php/expected/service-instance-php.yml b/test/e2e-v2/cases/php/expected/service-instance-php.yml index 3b4fe7ca3589..11964dd2e76b 100644 --- a/test/e2e-v2/cases/php/expected/service-instance-php.yml +++ b/test/e2e-v2/cases/php/expected/service-instance-php.yml @@ -17,14 +17,14 @@ {{- contains .}} - id: {{ notEmpty .id }} - name: php-instance + name: {{ notEmpty .name }} attributes: {{- contains .attributes }} - - name: os_name + - name: Process No. value: {{ notEmpty .value }} - - name: host_name + - name: OS Name value: {{ notEmpty .value }} - - name: process_no + - name: hostname value: {{ notEmpty .value }} - name: ipv4s value: {{ notEmpty .value }} diff --git a/test/e2e-v2/cases/php/expected/trace-info-detail.yml b/test/e2e-v2/cases/php/expected/trace-info-detail.yml index bb8fade2258e..b27e45df1db1 100644 --- a/test/e2e-v2/cases/php/expected/trace-info-detail.yml +++ b/test/e2e-v2/cases/php/expected/trace-info-detail.yml @@ -15,8 +15,8 @@ spans: {{- contains .spans }} - - traceid: {{ .traceid }} - segmentid: {{ .segmentid }} + - traceid: "{{ .traceid }}" + segmentid: "{{ .segmentid }}" spanid: {{ .spanid }} parentspanid: {{ .parentspanid }} refs: [] @@ -24,9 +24,9 @@ spans: serviceinstancename: {{ notEmpty .serviceinstancename }} starttime: {{ gt .starttime 0 }} endtime: {{ gt .endtime 0 }} - endpointname: /php/info + endpointname: POST:/php/info type: Entry - peer: {{ notEmpty .peer }} + peer: "" component: PHP iserror: false layer: Http @@ -34,11 +34,15 @@ spans: {{- contains .tags }} - key: url value: {{ notEmpty .value }} + - key: http.method + value: {{ notEmpty .value }} + - key: http.status_code + value: {{ notEmpty .value }} {{- end }} logs: [] attachedevents: [] - - traceid: {{ notEmpty .traceid }} - segmentid: {{ .segmentid }} + - traceid: "{{ notEmpty .traceid }}" + segmentid: "{{ .segmentid }}" spanid: {{ .spanid }} parentspanid: {{ .parentspanid }} refs: [] @@ -56,17 +60,19 @@ spans: {{- contains .tags }} - key: url value: {{ notEmpty .value }} + - key: status_code + value: {{ notEmpty .value }} {{- end }} logs: [] attachedevents: [] - - traceid: {{ notEmpty .traceid }} + - traceid: "{{ notEmpty .traceid }}" segmentid: {{ .segmentid }} spanid: {{ .spanid }} parentspanid: {{ .parentspanid }} refs: {{- contains .refs }} - - traceid: {{ notEmpty .traceid }} - parentsegmentid: {{ .parentsegmentid }} + - traceid: "{{ notEmpty .traceid }}" + parentsegmentid: "{{ .parentsegmentid }}" parentspanid: 1 type: CROSS_PROCESS {{- end }} @@ -82,12 +88,14 @@ spans: layer: Http tags: {{- contains .tags }} - - key: http.method - value: GET - key: url + value: {{ notEmpty .value}} + - key: http.method + value: {{ notEmpty .value }} + key: http.status_code value: {{ notEmpty .value }} {{- end }} logs: [] attachedevents: [] - {{- end }} + {{- end }} diff --git a/test/e2e-v2/cases/php/expected/traces-list-php.yml b/test/e2e-v2/cases/php/expected/traces-list-php.yml index fe737c94341c..7bd4814f9cc1 100644 --- a/test/e2e-v2/cases/php/expected/traces-list-php.yml +++ b/test/e2e-v2/cases/php/expected/traces-list-php.yml @@ -15,12 +15,12 @@ traces: {{- contains .traces }} -- segmentid: {{ notEmpty .segmentid }} +- segmentid: "{{ notEmpty .segmentid }}" endpointnames: - - /php/info + - POST:/php/info duration: {{ ge .duration 0 }} start: "{{ notEmpty .start}}" iserror: false traceids: - - {{ (index .traceids 0) }} + - "{{ (index .traceids 0) }}" {{- end }} diff --git a/test/e2e-v2/cases/php/expected/traces-list-provider.yml b/test/e2e-v2/cases/php/expected/traces-list-provider.yml index 888cac1f49da..aab7258d9d9d 100644 --- a/test/e2e-v2/cases/php/expected/traces-list-provider.yml +++ b/test/e2e-v2/cases/php/expected/traces-list-provider.yml @@ -22,5 +22,5 @@ traces: start: "{{ notEmpty .start}}" iserror: false traceids: - - {{ (index .traceids 0) }} + - "{{ (index .traceids 0) }}" {{- end }} diff --git a/test/e2e-v2/cases/php/php.ini b/test/e2e-v2/cases/php/php.ini index fa299094bb4b..8789034b0ef0 100644 --- a/test/e2e-v2/cases/php/php.ini +++ b/test/e2e-v2/cases/php/php.ini @@ -22,3 +22,6 @@ skywalking_agent.log_file = /tmp/skywalking-agent.log skywalking_agent.log_level = DEBUG skywalking_agent.server_addr = oap:11800 +skywalking_agent.skywalking_version = 9 +skywalking_agent.runtime_dir = /tmp + From 300825eb0e925b143a389bca069e738d5df8060e Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Wed, 4 Oct 2023 01:28:33 -0700 Subject: [PATCH 12/14] debug {{notEmpty .value}} --- .../cases/php/expected/trace-info-detail.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e-v2/cases/php/expected/trace-info-detail.yml b/test/e2e-v2/cases/php/expected/trace-info-detail.yml index b27e45df1db1..9d2d0016c123 100644 --- a/test/e2e-v2/cases/php/expected/trace-info-detail.yml +++ b/test/e2e-v2/cases/php/expected/trace-info-detail.yml @@ -35,9 +35,9 @@ spans: - key: url value: {{ notEmpty .value }} - key: http.method - value: {{ notEmpty .value }} + value: POST - key: http.status_code - value: {{ notEmpty .value }} + value: "200" {{- end }} logs: [] attachedevents: [] @@ -59,9 +59,9 @@ spans: tags: {{- contains .tags }} - key: url - value: {{ notEmpty .value }} + value: http://provider:9090/info - key: status_code - value: {{ notEmpty .value }} + value: ”200“ {{- end }} logs: [] attachedevents: [] @@ -89,13 +89,13 @@ spans: tags: {{- contains .tags }} - key: url - value: {{ notEmpty .value}} + value: http://provider:9090/info - key: http.method - value: {{ notEmpty .value }} - key: http.status_code - value: {{ notEmpty .value }} + value: GET + - key: http.status_code + value: "200" {{- end }} logs: [] attachedevents: [] - {{- end }} +{{- end }} From 6cbd29fc7a74ad4031d4278c8d15137524b93f91 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Sat, 7 Oct 2023 01:01:20 -0700 Subject: [PATCH 13/14] fix typo --- test/e2e-v2/cases/php/expected/trace-info-detail.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-v2/cases/php/expected/trace-info-detail.yml b/test/e2e-v2/cases/php/expected/trace-info-detail.yml index 9d2d0016c123..7d0711bb3a56 100644 --- a/test/e2e-v2/cases/php/expected/trace-info-detail.yml +++ b/test/e2e-v2/cases/php/expected/trace-info-detail.yml @@ -61,7 +61,7 @@ spans: - key: url value: http://provider:9090/info - key: status_code - value: ”200“ + value: "200" {{- end }} logs: [] attachedevents: [] From 41ca304d6935f355d3a09d7c203804f283fbb837 Mon Sep 17 00:00:00 2001 From: Simon Luo Date: Sat, 7 Oct 2023 02:30:42 -0700 Subject: [PATCH 14/14] fix BANYANDB COMMIT ERROR --- test/e2e-v2/script/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-v2/script/env b/test/e2e-v2/script/env index 449df4ae3461..8414fca8adf0 100644 --- a/test/e2e-v2/script/env +++ b/test/e2e-v2/script/env @@ -23,7 +23,7 @@ SW_AGENT_CLIENT_JS_COMMIT=af0565a67d382b683c1dbd94c379b7080db61449 SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016 SW_KUBERNETES_COMMIT_SHA=e2c61c6774cf377b23516fca6f8a1e119d3191c5 SW_ROVER_COMMIT=fc8d074c6d34ecfee585a7097cbd5aef1ca680a5 -SW_BANYANDB_COMMIT=df34a83663d66af9687ff484884ceae669c83980 +SW_BANYANDB_COMMIT=63be6e80bef82ea274d7352cc7a461b757d28355 SW_AGENT_PHP_COMMIT=3192c553002707d344bd6774cfab5bc61f67a1d3 SW_CTL_COMMIT=9d2d0edccda2afe5cf24f1e632142f40e80e8fa4