Skip to content

Commit feb3f15

Browse files
authored
test: Add e2e tests for jest-node scenario (#1624)
We have these smoke tests https://github.com/braintrustdata/braintrust-sdk-javascript/tree/main/js/smoke. These can probably be e2e tests. This converts the `jest-node` smoke tests to be e2e tests.
1 parent 201d504 commit feb3f15

17 files changed

Lines changed: 4472 additions & 278 deletions
Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
[
2+
{
3+
"_is_merge": false,
4+
"context": {
5+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
6+
"caller_functionname": "Object.<anonymous>",
7+
"caller_lineno": 0
8+
},
9+
"created": "<timestamp>",
10+
"id": "<span:1>",
11+
"log_id": "g",
12+
"metadata": {
13+
"case": "basic-span",
14+
"scenario": "jest-node",
15+
"testRunId": "<run:1>"
16+
},
17+
"metrics": {
18+
"start": 0
19+
},
20+
"project_id": "<uuid:3>",
21+
"root_span_id": "<span:2>",
22+
"span_attributes": {
23+
"exec_counter": 0,
24+
"name": "jest basic span",
25+
"type": "task"
26+
},
27+
"span_id": "<span:2>"
28+
},
29+
{
30+
"_is_merge": true,
31+
"expected": "Paris",
32+
"id": "<span:1>",
33+
"input": "What is the capital of France?",
34+
"log_id": "g",
35+
"metadata": {
36+
"case": "basic-span",
37+
"scenario": "jest-node",
38+
"testRunId": "<run:1>",
39+
"transport": "http"
40+
},
41+
"output": "Paris",
42+
"project_id": "<uuid:3>",
43+
"root_span_id": "<span:2>",
44+
"span_id": "<span:2>"
45+
},
46+
{
47+
"_is_merge": true,
48+
"id": "<span:1>",
49+
"log_id": "g",
50+
"metrics": {
51+
"end": 0
52+
},
53+
"project_id": "<uuid:3>",
54+
"root_span_id": "<span:2>",
55+
"span_id": "<span:2>"
56+
},
57+
{
58+
"_is_merge": false,
59+
"context": {
60+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
61+
"caller_functionname": "Object.<anonymous>",
62+
"caller_lineno": 0
63+
},
64+
"created": "<timestamp>",
65+
"id": "<span:4>",
66+
"input": {
67+
"transcript": {
68+
"content_type": "application/json",
69+
"filename": "conversation_transcript.json",
70+
"key": "<uuid:6>",
71+
"type": "braintrust_attachment"
72+
},
73+
"type": "chat_completion"
74+
},
75+
"log_id": "g",
76+
"metadata": {
77+
"case": "json-attachment",
78+
"scenario": "jest-node",
79+
"testRunId": "<run:1>"
80+
},
81+
"metrics": {
82+
"start": 0
83+
},
84+
"output": {
85+
"attachment": true
86+
},
87+
"project_id": "<uuid:3>",
88+
"root_span_id": "<span:5>",
89+
"span_attributes": {
90+
"exec_counter": 1,
91+
"name": "root",
92+
"type": "task"
93+
},
94+
"span_id": "<span:5>"
95+
},
96+
{
97+
"_is_merge": false,
98+
"context": {
99+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
100+
"caller_functionname": "Object.<anonymous>",
101+
"caller_lineno": 0
102+
},
103+
"created": "<timestamp>",
104+
"id": "<span:7>",
105+
"input": {
106+
"phase": "parent",
107+
"testRunId": "<run:1>"
108+
},
109+
"log_id": "g",
110+
"metadata": {
111+
"case": "parent-span",
112+
"scenario": "jest-node",
113+
"testRunId": "<run:1>"
114+
},
115+
"metrics": {
116+
"start": 0
117+
},
118+
"project_id": "<uuid:3>",
119+
"root_span_id": "<span:8>",
120+
"span_attributes": {
121+
"exec_counter": 2,
122+
"name": "jest parent span",
123+
"type": "task"
124+
},
125+
"span_id": "<span:8>"
126+
},
127+
{
128+
"_is_merge": false,
129+
"context": {
130+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
131+
"caller_functionname": "traced.name",
132+
"caller_lineno": 0
133+
},
134+
"created": "<timestamp>",
135+
"id": "<span:9>",
136+
"input": {
137+
"step": "child",
138+
"testRunId": "<run:1>"
139+
},
140+
"log_id": "g",
141+
"metadata": {
142+
"case": "child-span",
143+
"scenario": "jest-node",
144+
"testRunId": "<run:1>"
145+
},
146+
"metrics": {
147+
"start": 0
148+
},
149+
"project_id": "<uuid:3>",
150+
"root_span_id": "<span:8>",
151+
"span_attributes": {
152+
"exec_counter": 3,
153+
"name": "jest child span"
154+
},
155+
"span_id": "<span:10>",
156+
"span_parents": [
157+
"<span:8>"
158+
]
159+
},
160+
{
161+
"_is_merge": false,
162+
"context": {
163+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
164+
"caller_functionname": "Object.<anonymous>",
165+
"caller_lineno": 0
166+
},
167+
"created": "<timestamp>",
168+
"id": "<span:11>",
169+
"log_id": "g",
170+
"metadata": {
171+
"case": "nested-parent",
172+
"scenario": "jest-node",
173+
"testRunId": "<run:1>"
174+
},
175+
"metrics": {
176+
"start": 0
177+
},
178+
"project_id": "<uuid:3>",
179+
"root_span_id": "<span:12>",
180+
"span_attributes": {
181+
"exec_counter": 4,
182+
"name": "jest nested parent span",
183+
"type": "task"
184+
},
185+
"span_id": "<span:12>"
186+
},
187+
{
188+
"context": {
189+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
190+
"caller_functionname": "traced.name",
191+
"caller_lineno": 0
192+
},
193+
"created": "<timestamp>",
194+
"id": "<span:13>",
195+
"log_id": "g",
196+
"metadata": {
197+
"case": "nested-child",
198+
"scenario": "jest-node",
199+
"testRunId": "<run:1>"
200+
},
201+
"metrics": {
202+
"end": 0,
203+
"start": 0
204+
},
205+
"project_id": "<uuid:3>",
206+
"root_span_id": "<span:12>",
207+
"span_attributes": {
208+
"exec_counter": 5,
209+
"name": "jest nested child span"
210+
},
211+
"span_id": "<span:14>",
212+
"span_parents": [
213+
"<span:12>"
214+
]
215+
},
216+
{
217+
"context": {
218+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
219+
"caller_functionname": "traced.name",
220+
"caller_lineno": 0
221+
},
222+
"created": "<timestamp>",
223+
"id": "<span:15>",
224+
"log_id": "g",
225+
"metadata": {
226+
"case": "nested-grandchild",
227+
"scenario": "jest-node",
228+
"testRunId": "<run:1>"
229+
},
230+
"metrics": {
231+
"end": 0,
232+
"start": 0
233+
},
234+
"output": {
235+
"depth": 3
236+
},
237+
"project_id": "<uuid:3>",
238+
"root_span_id": "<span:12>",
239+
"span_attributes": {
240+
"exec_counter": 6,
241+
"name": "jest nested grandchild span"
242+
},
243+
"span_id": "<span:16>",
244+
"span_parents": [
245+
"<span:14>"
246+
]
247+
},
248+
{
249+
"_is_merge": false,
250+
"context": {
251+
"caller_filename": "<repo>/e2e/scenarios/jest-node/runner.case.cjs",
252+
"caller_functionname": "Object.<anonymous>",
253+
"caller_lineno": 0
254+
},
255+
"created": "<timestamp>",
256+
"id": "<span:17>",
257+
"log_id": "g",
258+
"metadata": {
259+
"case": "current-span",
260+
"scenario": "jest-node",
261+
"testRunId": "<run:1>"
262+
},
263+
"metrics": {
264+
"start": 0
265+
},
266+
"project_id": "<uuid:3>",
267+
"root_span_id": "<span:18>",
268+
"span_attributes": {
269+
"exec_counter": 7,
270+
"name": "jest current span",
271+
"type": "task"
272+
},
273+
"span_id": "<span:18>"
274+
},
275+
{
276+
"_is_merge": true,
277+
"id": "<span:17>",
278+
"log_id": "g",
279+
"metadata": {
280+
"case": "current-span",
281+
"scenario": "jest-node",
282+
"testRunId": "<run:1>"
283+
},
284+
"output": {
285+
"observedSpanId": "<span:18>"
286+
},
287+
"project_id": "<uuid:3>",
288+
"root_span_id": "<span:18>",
289+
"span_id": "<span:18>"
290+
},
291+
{
292+
"_is_merge": true,
293+
"id": "<span:17>",
294+
"log_id": "g",
295+
"metrics": {
296+
"end": 0
297+
},
298+
"project_id": "<uuid:3>",
299+
"root_span_id": "<span:18>",
300+
"span_id": "<span:18>"
301+
}
302+
]

0 commit comments

Comments
 (0)