Skip to content

Commit 5726f70

Browse files
committed
feat: add thunder client testing against backend
1 parent 1119670 commit 5726f70

File tree

6 files changed

+301
-0
lines changed

6 files changed

+301
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ See **[CONTRIBUTING.md](CONTRIBUTING.md)**
1212
***Note that the frontend will report errors when calling `/api/namespaces` when run locally. This***
1313
***issue does not arise in production, as the `/api/namespaces` endpoint is unused.***
1414

15+
To initialize the `.env` file for the development environment, use `task env`.
16+
You will need to fill out your kubeflow cloud account and kubeflow namespace information manually.
17+
The `thunder-tests` folder contains configuration for testing requests against the backend. Use the `vscode`
18+
`THUNDER CLIENT` extension to load the tests.
19+
1520
### Run API Server
1621

1722
The API server will connect to the Kubeflow cluster from your current `kubectl`

Taskfile.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ tasks:
174174
prefix: ⚙ > env
175175
desc: setup dev environment
176176
cmds:
177+
- echo "KF_NAMESPACE=">>.env
177178
- echo "KF_USER_ID=">>.env
179+
- echo "KF_NOTEBOOK_NAME=swag">>.env
180+
- echo "KF_PVC_NAME=swag">>.env
178181
sources:
179182
- .env

thunder-tests/thunderActivity.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

thunder-tests/thunderCollection.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"_id": "bf518063-1214-41a0-a602-702e12d98039",
4+
"colName": "Golang Kubeflow",
5+
"created": "2022-09-23T13:47:44.945Z",
6+
"sortNum": 10000,
7+
"folders": [],
8+
"settings": {
9+
"headers": [
10+
{
11+
"name": "kubeflow-userid",
12+
"value": "{{KF_USER_ID}}"
13+
}
14+
],
15+
"tests": [],
16+
"options": {
17+
"baseUrl": "http://localhost:5000"
18+
},
19+
"envId": "0d8a7513-38dd-4e46-93b3-2c0ccb2ee056"
20+
}
21+
}
22+
]

thunder-tests/thunderEnvironment.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"_id": "0d8a7513-38dd-4e46-93b3-2c0ccb2ee056",
4+
"name": "golang-backend",
5+
"default": true,
6+
"sortNum": 10000,
7+
"created": "2022-09-23T13:47:57.807Z",
8+
"modified": "2022-09-23T13:48:16.638Z",
9+
"data": [],
10+
"envFile": "../.env"
11+
}
12+
]

thunder-tests/thunderclient.json

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
[
2+
{
3+
"_id": "5f88a11f-dc74-4074-8ad4-d82893376a09",
4+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
5+
"containerId": "",
6+
"name": "/api/config",
7+
"url": "/api/config",
8+
"method": "GET",
9+
"sortNum": 10000,
10+
"created": "2022-09-23T13:47:44.950Z",
11+
"modified": "2022-09-23T13:47:44.950Z",
12+
"headers": [],
13+
"params": [],
14+
"tests": []
15+
},
16+
{
17+
"_id": "9f5dd3ac-6dfa-4463-aac3-b641d7eb583d",
18+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
19+
"containerId": "",
20+
"name": "/api/gpus",
21+
"url": "/api/gpus",
22+
"method": "GET",
23+
"sortNum": 15000,
24+
"created": "2022-09-23T13:47:44.951Z",
25+
"modified": "2022-09-23T13:47:44.951Z",
26+
"headers": [],
27+
"params": [],
28+
"tests": []
29+
},
30+
{
31+
"_id": "2b047a64-db79-4a13-afb6-4c6e82453c98",
32+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
33+
"containerId": "",
34+
"name": "/api/storageclasses/default",
35+
"url": "http://localhost:5000/api/storageclasses/default",
36+
"method": "GET",
37+
"sortNum": 16250,
38+
"created": "2022-09-23T13:47:44.952Z",
39+
"modified": "2022-09-23T13:47:44.952Z",
40+
"headers": [],
41+
"params": [],
42+
"tests": []
43+
},
44+
{
45+
"_id": "74116746-f35f-4308-8f2a-e588b21d0c0e",
46+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
47+
"containerId": "",
48+
"name": "/api/namespaces/{namespace}/cost/aggregated",
49+
"url": "http://localhost:5000/api/namespaces/{namespace}/cost/aggregated",
50+
"method": "GET",
51+
"sortNum": 17500,
52+
"created": "2022-09-23T13:47:44.953Z",
53+
"modified": "2022-09-23T13:47:44.953Z",
54+
"headers": [
55+
{
56+
"name": "KF_USER_ID",
57+
"value": "[email protected]"
58+
}
59+
],
60+
"params": [
61+
{
62+
"name": "namespace",
63+
"value": "{{KF_NAMESPACE}}",
64+
"isPath": true
65+
}
66+
],
67+
"tests": []
68+
},
69+
{
70+
"_id": "b330877f-f4e1-4ebe-8e18-ff1e63c0bd90",
71+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
72+
"containerId": "",
73+
"name": "/api/namespaces",
74+
"url": "/api/namespaces",
75+
"method": "GET",
76+
"sortNum": 18750,
77+
"created": "2022-09-23T13:47:44.954Z",
78+
"modified": "2022-09-23T13:47:44.954Z",
79+
"headers": [],
80+
"params": [],
81+
"tests": []
82+
},
83+
{
84+
"_id": "82282dcc-de4e-41ce-aeb6-9e293478a60c",
85+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
86+
"containerId": "",
87+
"name": "/api/namespaces/{namespace}",
88+
"url": "/api/namespaces/{namespace}",
89+
"method": "GET",
90+
"sortNum": 60000,
91+
"created": "2022-09-23T13:47:44.955Z",
92+
"modified": "2022-09-23T13:47:44.955Z",
93+
"headers": [],
94+
"params": [
95+
{
96+
"name": "namespace",
97+
"value": "{{KF_NAMESPACE}}",
98+
"isPath": true
99+
}
100+
],
101+
"tests": []
102+
},
103+
{
104+
"_id": "237a4715-fe2f-4092-a206-fad69c9c6d23",
105+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
106+
"containerId": "",
107+
"name": "/api/namespaces/{namespace}/notebooks",
108+
"url": "/api/namespaces/{namespace}/notebooks",
109+
"method": "GET",
110+
"sortNum": 65000,
111+
"created": "2022-09-23T13:47:44.956Z",
112+
"modified": "2022-09-23T13:47:44.956Z",
113+
"headers": [],
114+
"params": [
115+
{
116+
"name": "namespace",
117+
"value": "{{KF_NAMESPACE}}",
118+
"isPath": true
119+
}
120+
],
121+
"tests": []
122+
},
123+
{
124+
"_id": "a3f525e5-fb55-4543-a038-ea845d980a2a",
125+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
126+
"containerId": "",
127+
"name": "/api/namespaces/{namespace}/notebooks",
128+
"url": "http://localhost:5000/api/namespaces/{namespace}/notebooks",
129+
"method": "POST",
130+
"sortNum": 70000,
131+
"created": "2022-09-23T13:47:44.957Z",
132+
"modified": "2022-09-23T13:47:44.957Z",
133+
"headers": [],
134+
"params": [
135+
{
136+
"name": "namespace",
137+
"value": "{{KF_NAMESPACE}}",
138+
"isPath": true
139+
}
140+
],
141+
"tests": []
142+
},
143+
{
144+
"_id": "712b4552-8b7c-482b-8c93-58975015eced",
145+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
146+
"containerId": "",
147+
"name": "/api/namespaces/{namespace}/notebooks/{notebook}",
148+
"url": "http://localhost:5000/api/namespaces/{namespace}/notebooks/{notebook}",
149+
"method": "DELETE",
150+
"sortNum": 80000,
151+
"created": "2022-09-23T13:47:44.958Z",
152+
"modified": "2022-09-23T13:50:19.620Z",
153+
"headers": [],
154+
"params": [
155+
{
156+
"name": "namespace",
157+
"value": "{{KF_NAMESPACE}}",
158+
"isPath": true
159+
},
160+
{
161+
"name": "notebook",
162+
"value": "{{KF_NOTEBOOK_NAME}}",
163+
"isPath": true
164+
}
165+
],
166+
"tests": []
167+
},
168+
{
169+
"_id": "c99b0b2b-a7c7-432e-b111-1d6c94b4db0c",
170+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
171+
"containerId": "",
172+
"name": "/api/namespaces/{namespace}/notebooks/{notebook}",
173+
"url": "http://localhost:5000/api/namespaces/{namespace}/notebooks/{notebook}",
174+
"method": "PATCH",
175+
"sortNum": 120000,
176+
"created": "2022-09-23T13:47:44.959Z",
177+
"modified": "2022-09-23T13:50:14.465Z",
178+
"headers": [],
179+
"params": [
180+
{
181+
"name": "namespace",
182+
"value": "{{KF_NAMESPACE}}",
183+
"isPath": true
184+
},
185+
{
186+
"name": "notebook",
187+
"value": "{{KF_NOTEBOOK_NAME}}",
188+
"isPath": true
189+
}
190+
],
191+
"tests": []
192+
},
193+
{
194+
"_id": "cfa60ce5-8b79-4e60-80ce-dc47bdc629e1",
195+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
196+
"containerId": "",
197+
"name": "/api/namespaces/{namespace}/pvcs",
198+
"url": "http://localhost:5000/api/namespaces/{namespace}/pvcs",
199+
"method": "GET",
200+
"sortNum": 130000,
201+
"created": "2022-09-23T13:47:44.960Z",
202+
"modified": "2022-09-23T13:47:44.960Z",
203+
"headers": [],
204+
"params": [
205+
{
206+
"name": "namespace",
207+
"value": "{{KF_NAMESPACE}}",
208+
"isPath": true
209+
}
210+
],
211+
"tests": []
212+
},
213+
{
214+
"_id": "9afbb86c-68a3-488d-bd6d-d84d79ac7dbf",
215+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
216+
"containerId": "",
217+
"name": "/api/namespaces/{namespace}/pvcs/{pvc}",
218+
"url": "http://localhost:5000/api/namespaces/{namespace}/pvcs/{pvc}",
219+
"method": "DELETE",
220+
"sortNum": 140000,
221+
"created": "2022-09-23T13:47:44.961Z",
222+
"modified": "2022-09-23T13:49:54.989Z",
223+
"headers": [],
224+
"params": [
225+
{
226+
"name": "namespace",
227+
"value": "{{KF_NAMESPACE}}",
228+
"isPath": true
229+
},
230+
{
231+
"name": "pvc",
232+
"value": "{{KF_PVC_NAME}}",
233+
"isPath": true
234+
}
235+
],
236+
"tests": []
237+
},
238+
{
239+
"_id": "1147c8d9-3ae9-4865-b1c9-509d617bbd58",
240+
"colId": "bf518063-1214-41a0-a602-702e12d98039",
241+
"containerId": "",
242+
"name": "/api/namespaces/{namespace}/poddefaults",
243+
"url": "http://localhost:5000/api/namespaces/{namespace}/poddefaults",
244+
"method": "GET",
245+
"sortNum": 150000,
246+
"created": "2022-09-23T13:47:44.962Z",
247+
"modified": "2022-09-23T13:47:44.962Z",
248+
"headers": [],
249+
"params": [
250+
{
251+
"name": "namespace",
252+
"value": "{{KF_NAMESPACE}}",
253+
"isPath": true
254+
}
255+
],
256+
"tests": []
257+
}
258+
]

0 commit comments

Comments
 (0)