Skip to content

Commit a216c23

Browse files
authored
ci(openai): move cassettes for mocked responses to local directory in place of test agent (#6152)
1 parent 85b53d0 commit a216c23

File tree

46 files changed

+9231
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9231
-19
lines changed

docker-compose.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,18 @@ services:
171171
- LDAP_PASSWORDS=password1,password2
172172

173173
testagent:
174-
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.24.1
174+
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.27.4
175175
ports:
176-
- "127.0.0.1:9126:9126"
176+
- "127.0.0.1:9126:9126"
177177
environment:
178-
- LOG_LEVEL=DEBUG
179-
- TRACE_LANGUAGE=javascript
180-
- ENABLED_CHECKS=trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service
181-
- PORT=9126
178+
- LOG_LEVEL=DEBUG
179+
- TRACE_LANGUAGE=javascript
180+
- ENABLED_CHECKS=trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service
181+
- PORT=9126
182+
- VCR_CASSETTES_DIRECTORY=/vcr-cassettes
183+
volumes:
184+
# when there are other products not using the cassette feature from the test agent,
185+
# we can move this directory to a shared location here, and change the above
186+
# environment variable to point to that location
187+
- ./packages/dd-trace/test/llmobs/cassettes:/vcr-cassettes
182188

183-
# Use this for local development when making new VCR cassettes to persist to the test agent
184-
# Do not use the above testagent service if using this one.
185-
# testagent-vcr:
186-
# image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.24.1
187-
# ports:
188-
# - "127.0.0.1:9126:9126"
189-
# environment:
190-
# - LOG_LEVEL=DEBUG
191-
# - TRACE_LANGUAGE=javascript
192-
# - ENABLED_CHECKS=trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service
193-
# - PORT=9126
194-
# volumes:
195-
# - ${VCR_CASSETTES_PATH:-/tmp/empty-vcr}:/vcr-cassettes:delegated
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
interactions:
2+
- request:
3+
body: "{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\":
4+
\"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n
5+
\ \"role\": \"user\",\n \"content\": \"Hello, OpenAI!\"\n }\n ],\n
6+
\ \"temperature\": 0.5,\n \"stream\": false,\n \"max_tokens\": 100,\n \"n\":
7+
1,\n \"user\": \"dd-trace-test\"\n}"
8+
headers:
9+
? !!python/object/apply:multidict._multidict.istr
10+
- Accept
11+
: - application/json
12+
? !!python/object/apply:multidict._multidict.istr
13+
- Accept-Encoding
14+
: - gzip,deflate
15+
? !!python/object/apply:multidict._multidict.istr
16+
- Connection
17+
: - keep-alive
18+
Content-Length:
19+
- '303'
20+
? !!python/object/apply:multidict._multidict.istr
21+
- Content-Type
22+
: - application/json
23+
? !!python/object/apply:multidict._multidict.istr
24+
- User-Agent
25+
: - OpenAI/JS 4.0.0
26+
? !!python/object/apply:multidict._multidict.istr
27+
- X-Stainless-Arch
28+
: - arm64
29+
? !!python/object/apply:multidict._multidict.istr
30+
- X-Stainless-Lang
31+
: - js
32+
? !!python/object/apply:multidict._multidict.istr
33+
- X-Stainless-OS
34+
: - MacOS
35+
? !!python/object/apply:multidict._multidict.istr
36+
- X-Stainless-Package-Version
37+
: - 4.0.0
38+
? !!python/object/apply:multidict._multidict.istr
39+
- X-Stainless-Runtime
40+
: - node
41+
? !!python/object/apply:multidict._multidict.istr
42+
- X-Stainless-Runtime-Version
43+
: - v22.17.0
44+
method: POST
45+
uri: https://api.deepseek.com/chat/completions
46+
response:
47+
body:
48+
string: "{\n \"id\": \"chatcmpl-BkZxQcJvaxbyldxLmrNffCobBnd84\",\n \"object\":
49+
\"chat.completion\",\n \"created\": 1750441008,\n \"model\": \"deepseek-chat\",\n
50+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
51+
\"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n
52+
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
53+
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
54+
21,\n \"completion_tokens\": 9,\n \"total_tokens\": 30,\n \"prompt_tokens_details\":
55+
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
56+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
57+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
58+
\"default\",\n \"system_fingerprint\": \"fp_07871e2ad8\"\n}\n"
59+
headers:
60+
CF-RAY:
61+
- 9634baaefa18efa3-EWR
62+
Connection:
63+
- keep-alive
64+
Content-Length:
65+
- '111'
66+
Content-Type:
67+
- application/json
68+
Date:
69+
- Tue, 22 Jul 2025 17:41:30 GMT
70+
Server:
71+
- cloudflare
72+
Set-Cookie:
73+
- __cf_bm=wKLTWpAihrXPtJXxWf9gg03qzUy4swOVEIjdAL2LVeU-1753206090-1.0.1.1-B0S0e4OYbPrIFhFANl9VPT7Y9Cl7YsZvUIz8QhZKuv.miYh4OgFXRI2a3bkjT1DVdz5L2BWye3LjYCotCH.C54x5Gz68qj_UnMSoWQ7Y6c8;
74+
path=/; expires=Tue, 22-Jul-25 18:11:30 GMT; domain=.deepseek.com; HttpOnly;
75+
Secure; SameSite=None
76+
Strict-Transport-Security:
77+
- max-age=31536000; includeSubDomains; preload
78+
X-Content-Type-Options:
79+
- nosniff
80+
access-control-allow-credentials:
81+
- 'true'
82+
cf-cache-status:
83+
- DYNAMIC
84+
vary:
85+
- origin, access-control-request-method, access-control-request-headers
86+
x-ds-trace-id:
87+
- 9cb6d19f3bfad709a589688110123087
88+
status:
89+
code: 200
90+
message: OK
91+
version: 1

0 commit comments

Comments
 (0)