Skip to content

Commit 3eb47a2

Browse files
committed
fix
1 parent 13baa14 commit 3eb47a2

4 files changed

Lines changed: 38 additions & 42 deletions

File tree

.github/workflows/plugins-test.2.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,35 @@ jobs:
6868
matrix:
6969
case:
7070
- okhttp-scenario
71-
- play-scenario
72-
- postgresql-scenario
73-
- pulsar-scenario
74-
- rabbitmq-scenario
75-
- redisson-scenario
76-
- resttemplate-4.x-scenario
77-
- servicecomb-1.x-scenario
78-
- servicecomb-2.x-scenario
79-
- shardingsphere-3.x-scenario
80-
- shardingsphere-4.0.x-scenario
81-
- shardingsphere-4.x-scenario
82-
- shardingsphere-5.0.0-scenario
83-
- sofarpc-scenario
84-
- solrj-7.x-scenario
85-
- spring-3.0.x-scenario
86-
- spring-cloud-feign-1.1.x-scenario
87-
- spring-cloud-feign-1.2.x-scenario
88-
- spring-cloud-feign-2.x-scenario
89-
- spring-tx-scenario
90-
- struts2.3-scenario
91-
- struts2.5-scenario
92-
- cxf-scenario
93-
- okhttp2-scenario
94-
- jersey-2.0.x-2.25.x-scenario
95-
- jersey-2.26.x-2.39.x-scenario
96-
- websphere-liberty-23.x-scenario
97-
- nacos-client-2.x-scenario
98-
- rocketmq-scenario
99-
- rocketmq-5-grpc-scenario
71+
# - play-scenario
72+
# - postgresql-scenario
73+
# - pulsar-scenario
74+
# - rabbitmq-scenario
75+
# - redisson-scenario
76+
# - resttemplate-4.x-scenario
77+
# - servicecomb-1.x-scenario
78+
# - servicecomb-2.x-scenario
79+
# - shardingsphere-3.x-scenario
80+
# - shardingsphere-4.0.x-scenario
81+
# - shardingsphere-4.x-scenario
82+
# - shardingsphere-5.0.0-scenario
83+
# - sofarpc-scenario
84+
# - solrj-7.x-scenario
85+
# - spring-3.0.x-scenario
86+
# - spring-cloud-feign-1.1.x-scenario
87+
# - spring-cloud-feign-1.2.x-scenario
88+
# - spring-cloud-feign-2.x-scenario
89+
# - spring-tx-scenario
90+
# - struts2.3-scenario
91+
# - struts2.5-scenario
92+
# - cxf-scenario
93+
# - okhttp2-scenario
94+
# - jersey-2.0.x-2.25.x-scenario
95+
# - jersey-2.26.x-2.39.x-scenario
96+
# - websphere-liberty-23.x-scenario
97+
# - nacos-client-2.x-scenario
98+
# - rocketmq-scenario
99+
# - rocketmq-5-grpc-scenario
100100
steps:
101101
- uses: actions/checkout@v2
102102
with:

test/plugin/scenarios/spring-ai-1.x-scenario/config/expectedData.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ segmentItems:
115115
- { key: gen_ai.request.model, value: gpt-4.1-2025-04-14 }
116116
- { key: gen_ai.request.temperature, value: '0.7' }
117117
- { key: gen_ai.request.top_p, value: '0.9' }
118-
- { key: gen_ai.response.id, value: 'chatcmpl-CyJXJt7gxwDgz' }
118+
- { key: gen_ai.stream.ttfr, value: not null }
119+
- { key: gen_ai.response.id, value: 'chatcmpl-fc1b64d3' }
119120
- { key: gen_ai.response.model, value: gpt-4.1-2025-04-14 }
120-
- { key: gen_ai.usage.input_tokens, value: '52' }
121-
- { key: gen_ai.usage.output_tokens, value: '17' }
122-
- { key: gen_ai.client.token.usage, value: '69' }
123121
- { key: gen_ai.response.finish_reasons, value: STOP }
122+
- { key: gen_ai.usage.input_tokens, value: '104' }
123+
- { key: gen_ai.usage.output_tokens, value: '34' }
124+
- { key: gen_ai.client.token.usage, value: '138' }
124125
- { key: gen_ai.input.messages, value: not null }
125126
- { key: gen_ai.output.messages, value: not null }
126127

test/plugin/scenarios/spring-ai-1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/CaseController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public String testCase() throws Exception {
4747
Do not use outside knowledge. Be concise.
4848
""";
4949

50-
chatClient
50+
System.out.println(chatClient
5151
.prompt("What's the weather in New York?")
5252
.system(systemPrompt)
5353
.tools(weatherTool)
5454
.call()
55-
.content();
55+
.content());
5656

5757
chatClient
5858
.prompt("What's the weather in New York?")

test/plugin/scenarios/spring-ai-1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/LLMMockController.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.io.IOException;
2929
import java.io.PrintWriter;
3030
import java.time.Instant;
31-
import java.util.UUID;
3231

3332
@RestController
3433
@RequestMapping("/llm")
@@ -49,7 +48,7 @@ public Object completions(@RequestBody JSONObject request, HttpServletResponse r
4948
response.setHeader("Connection", "keep-alive");
5049

5150
PrintWriter writer = response.getWriter();
52-
String id = "chatcmpl-" + UUID.randomUUID();
51+
String id = "chatcmpl-fc1b64d3";
5352
long created = Instant.now().getEpochSecond();
5453
String model = "gpt-4.1-2025-04-14";
5554

@@ -59,11 +58,7 @@ public Object completions(@RequestBody JSONObject request, HttpServletResponse r
5958
writeStreamChunk(writer, id, created, model, "{\"role\":\"assistant\"}", "null");
6059

6160
int len = fullContent.length();
62-
String[] parts = {
63-
fullContent.substring(0, len / 3),
64-
fullContent.substring(len / 3, len * 2 / 3),
65-
fullContent.substring(len * 2 / 3)
66-
};
61+
String[] parts = {fullContent.substring(0, len / 3), fullContent.substring(len / 3, len * 2 / 3), fullContent.substring(len * 2 / 3)};
6762

6863
for (String part : parts) {
6964
Thread.sleep(50);

0 commit comments

Comments
 (0)