Skip to content

Commit 1eb4067

Browse files
authored
Enhance the stability of e2e PHP tests and update the PHP agent version. (#13294)
1 parent 30e2dcd commit 1eb4067

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* [Break Change]Storage: Move `event` from metrics to records.
3030
* Remove string limitation in Jackson deserializer for ElasticSearch client.
3131
* Fix `disable.oal` does not work.
32+
* Enhance the stability of e2e PHP tests and update the PHP agent version.
3233

3334
#### UI
3435

test/e2e-v2/cases/php/Dockerfile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
ENV RUSTUP_HOME=/usr/local/rustup \
2121
CARGO_HOME=/usr/local/cargo \
2222
PATH=/usr/local/cargo/bin:$PATH \
23-
RUST_VERSION=1.64.0
23+
RUST_VERSION=1.85.1
2424

2525
WORKDIR /tmp
2626
RUN apt update \
2727
&& apt install -y wget protobuf-compiler libclang-dev git \
28-
&& wget https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init \
28+
&& wget https://static.rust-lang.org/rustup/archive/1.28.2/x86_64-unknown-linux-gnu/rustup-init \
2929
&& chmod +x rustup-init \
3030
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host x86_64-unknown-linux-gnu \
3131
&& rm rustup-init \

test/e2e-v2/cases/php/docker-compose.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ services:
2222
service: oap
2323
ports:
2424
- 12800
25+
networks:
26+
- e2e
2527

2628
banyandb:
2729
extends:
2830
file: ../../script/docker-compose/base-compose.yml
2931
service: banyandb
3032
ports:
3133
- 17912
34+
networks:
35+
- e2e
3236

3337
php:
3438
build:
@@ -42,13 +46,20 @@ services:
4246
- 8080
4347
depends_on:
4448
provider:
45-
condition: service_started
49+
condition: service_healthy
4650
oap:
4751
condition: service_healthy
52+
banyandb:
53+
condition: service_healthy
4854
volumes:
4955
- ./index.php:/var/www/html/index.php
5056
- ./php.ini:/usr/local/etc/php/conf.d/ext-skywalking_agent.ini
5157
- ./nginx.conf:/etc/nginx/nginx.conf
58+
healthcheck:
59+
test: ["CMD", "sh", "-c", "nc -z 127.0.0.1 8080"]
60+
interval: 5s
61+
timeout: 60s
62+
retries: 120
5263

5364
provider:
5465
extends:
@@ -57,6 +68,8 @@ services:
5768
depends_on:
5869
oap:
5970
condition: service_healthy
71+
networks:
72+
- e2e
6073

6174
networks:
6275
e2e:

test/e2e-v2/cases/php/e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ trigger:
3838
verify:
3939
# verify with retry strategy
4040
retry:
41-
count: 30
41+
count: 10
4242
interval: 15s
4343
cases:
4444
# layer list
@@ -66,7 +66,7 @@ verify:
6666
- query: |
6767
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace $( \
6868
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql trace ls --service-name=php\
69-
| yq e '.traces | select(.[].endpointnames[0]=="POST:/php/info") | .[9].traceids[0]' -
69+
| yq e '.traces | select(.[].endpointnames[0]=="POST:/php/info") | .[2].traceids[0]' -
7070
)
7171
expected: expected/trace-info-detail.yml
7272
# dependency service

test/e2e-v2/cases/php/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@
2222
curl_setopt($ch, CURLOPT_URL, "http://provider:9090/info");
2323
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2424
$output = curl_exec($ch);
25+
if (curl_errno($ch)) {
26+
$error_code = curl_errno($ch);
27+
$error_message = curl_error($ch);
28+
throw new Exception("curl failed: $error_code $error_message");
29+
}
2530
curl_close($ch);
2631
}

test/e2e-v2/cases/php/php.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
extension = skywalking_agent.so
1919
skywalking_agent.service_name = php
2020
skywalking_agent.enable = 1
21-
skywalking_agent.log_file = /tmp/skywalking-agent.log
21+
skywalking_agent.log_file = /proc/1/fd/2
2222
skywalking_agent.log_level = DEBUG
2323
skywalking_agent.server_addr = oap:11800
2424

test/e2e-v2/script/env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SW_AGENT_CLIENT_JS_TEST_COMMIT=4f1eb1dcdbde3ec4a38534bf01dded4ab5d2f016
2424
SW_KUBERNETES_COMMIT_SHA=6fe5e6f0d3b7686c6be0457733e825ee68cb9b35
2525
SW_ROVER_COMMIT=79292fe07f17f98f486e0c4471213e1961fb2d1d
2626
SW_BANYANDB_COMMIT=c4b4384f3083f44ca6067257f5fa59030427ad6b
27-
SW_AGENT_PHP_COMMIT=3192c553002707d344bd6774cfab5bc61f67a1d3
27+
SW_AGENT_PHP_COMMIT=d1114e7be5d89881eec76e5b56e69ff844691e35
2828
SW_PREDICTOR_COMMIT=54a0197654a3781a6f73ce35146c712af297c994
2929

3030
SW_CTL_COMMIT=7bbac156e74e8fdc0c5bd6f377be9f0b30420176

0 commit comments

Comments
 (0)