Skip to content

Commit 2f0fb46

Browse files
committed
✅ add piplines API test suite
1 parent 4fac00c commit 2f0fb46

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

tests/e2e/integration/pipelines.hurl

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
GET http://localhost:5080/api/v1/pipelines
2+
Authorization: Bearer {{admin_token}}
3+
HTTP 200
4+
[Asserts]
5+
jsonpath "$.success" == true
6+
jsonpath "$.pipelines" count == 1
7+
jsonpath "$.pipelines[0]" == "default"
8+
9+
GET http://localhost:5080/api/v1/pipelines/default
10+
Authorization: Bearer {{admin_token}}
11+
HTTP 200
12+
[Asserts]
13+
jsonpath "$.success" == true
14+
jsonpath "$.flow" exists
15+
16+
GET http://localhost:5080/api/v1/pipelines/test
17+
Authorization: Bearer {{admin_token}}
18+
HTTP 404
19+
20+
PUT http://localhost:5080/api/v1/pipelines/test
21+
Authorization: Bearer {{admin_token}}
22+
Content-Type: application/json
23+
{
24+
"flow": {
25+
"nodes": [
26+
{
27+
"id": "__builtin__source_direct",
28+
"type": "source",
29+
"position": {"x": 210, "y": 195},
30+
"deletable": false,
31+
"data": {"type": "direct"},
32+
"measured": {"width": 136, "height": 38},
33+
"selected": true,
34+
"dragging": false
35+
},
36+
{
37+
"id": "__builtin__source_syslog",
38+
"type": "source",
39+
"position": {"x": 210, "y": 250},
40+
"deletable": false,
41+
"data": {"type": "syslog"},
42+
"measured": {"width": 136, "height": 38},
43+
"selected": true,
44+
"dragging": false
45+
},
46+
{
47+
"id": "node-1",
48+
"type": "router",
49+
"position": {"x": 405, "y": 195},
50+
"data": {"stream": "test"},
51+
"measured": {"width": 241,"height": 91},
52+
"selected": false,
53+
"dragging": false
54+
}
55+
],
56+
"edges": [
57+
{
58+
"id": "xy-edge____builtin__source_direct-node-1",
59+
"type": "smoothstep",
60+
"source": "__builtin__source_direct",
61+
"target": "node-1",
62+
"animated": true
63+
},
64+
{
65+
"id": "xy-edge____builtin__source_syslog-node-1",
66+
"type": "smoothstep",
67+
"source": "__builtin__source_syslog",
68+
"target": "node-1",
69+
"animated": true
70+
}
71+
]
72+
}
73+
}
74+
HTTP 200
75+
[Asserts]
76+
jsonpath "$.success" == true
77+
78+
GET http://localhost:5080/api/v1/pipelines
79+
Authorization: Bearer {{admin_token}}
80+
HTTP 200
81+
[Asserts]
82+
jsonpath "$.success" == true
83+
jsonpath "$.pipelines" count == 2
84+
jsonpath "$.pipelines" includes "default"
85+
jsonpath "$.pipelines" includes "test"
86+
87+
POST http://localhost:5080/api/v1/pipelines/test/logs
88+
Authorization: Bearer {{admin_token}}
89+
Content-Type: application/json
90+
{
91+
"record": {
92+
"level": "info",
93+
"message": "test"
94+
}
95+
}
96+
HTTP 200
97+
98+
GET http://localhost:5080/api/v1/streams/test/logs
99+
Authorization: Bearer {{admin_token}}
100+
[QueryStringParams]
101+
from: {{timewindow_begin}}
102+
to: {{timewindow_end}}
103+
104+
HTTP 200
105+
[Asserts]
106+
jsonpath "$.success" == true
107+
jsonpath "$.records" count == 1
108+
jsonpath "$.records[0].fields.level" == "info"
109+
jsonpath "$.records[0].fields.message" == "test"
110+
111+
DELETE http://localhost:5080/api/v1/streams/test
112+
Authorization: Bearer {{admin_token}}
113+
HTTP 200
114+
[Asserts]
115+
jsonpath "$.success" == true
116+
117+
DELETE http://localhost:5080/api/v1/pipelines/test
118+
Authorization: Bearer {{admin_token}}
119+
HTTP 200
120+
[Asserts]
121+
jsonpath "$.success" == true
122+
123+
GET http://localhost:5080/api/v1/pipelines/test
124+
Authorization: Bearer {{admin_token}}
125+
HTTP 404
126+
127+
GET http://localhost:5080/api/v1/pipelines
128+
Authorization: Bearer {{admin_token}}
129+
HTTP 200
130+
[Asserts]
131+
jsonpath "$.success" == true
132+
jsonpath "$.pipelines" not includes "test"

0 commit comments

Comments
 (0)