Skip to content

Commit 5dc52d8

Browse files
gewenyu99gitbook-bot
authored andcommitted
GITBOOK-733: flaky tests api
1 parent 89b0dde commit 5dc52d8

23 files changed

+561
-196
lines changed

.gitbook/assets/openapi.json

+367
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,367 @@
1+
{
2+
"openapi": "3.1.0",
3+
"servers": [
4+
{
5+
"url": "https://api.trunk.io/v1"
6+
}
7+
],
8+
"info": {
9+
"title": "Trunk APIs",
10+
"version": "1.0.0",
11+
"license": {
12+
"name": "UNLICENSED"
13+
}
14+
},
15+
"paths": {
16+
"/flaky-tests/list-quarantined-tests": {
17+
"post": {
18+
"security": [
19+
{
20+
"ApiKeyAuth": []
21+
}
22+
],
23+
"summary": "Get a list of quarantined tests",
24+
"requestBody": {
25+
"content": {
26+
"application/json": {
27+
"schema": {
28+
"type": "object",
29+
"properties": {
30+
"repo": {
31+
"type": "object",
32+
"properties": {
33+
"host": {
34+
"type": "string"
35+
},
36+
"owner": {
37+
"type": "string"
38+
},
39+
"name": {
40+
"type": "string"
41+
}
42+
},
43+
"required": [
44+
"host",
45+
"owner",
46+
"name"
47+
]
48+
},
49+
"orgUrlSlug": {
50+
"type": "string"
51+
},
52+
"pageQuery": {
53+
"type": "object",
54+
"properties": {
55+
"pageSize": {
56+
"type": "integer",
57+
"minimum": 1,
58+
"maximum": 100
59+
},
60+
"pageToken": {
61+
"type": "string"
62+
}
63+
},
64+
"required": [
65+
"pageSize"
66+
]
67+
}
68+
},
69+
"required": [
70+
"repo",
71+
"orgUrlSlug",
72+
"pageQuery"
73+
]
74+
}
75+
}
76+
}
77+
},
78+
"responses": {
79+
"200": {
80+
"description": "OK",
81+
"content": {
82+
"application/json": {
83+
"schema": {
84+
"type": "object",
85+
"properties": {
86+
"quarantined_tests": {
87+
"type": "array",
88+
"items": {
89+
"type": "object",
90+
"properties": {
91+
"name": {
92+
"type": "string"
93+
},
94+
"parent": {
95+
"type": [
96+
"string",
97+
"null"
98+
]
99+
},
100+
"file": {
101+
"type": [
102+
"string",
103+
"null"
104+
]
105+
},
106+
"class_name": {
107+
"type": [
108+
"string",
109+
"null"
110+
]
111+
},
112+
"status": {
113+
"type": "string",
114+
"enum": [
115+
"HEALTHY",
116+
"FLAKY",
117+
"BROKEN"
118+
]
119+
},
120+
"code_owners": {
121+
"type": "array",
122+
"items": {
123+
"type": "string"
124+
}
125+
},
126+
"quarantine_setting": {
127+
"type": "string",
128+
"enum": [
129+
"ALWAYS_QUARANTINE",
130+
"AUTO_QUARANTINE"
131+
]
132+
},
133+
"last_updated_at": {
134+
"type": "string",
135+
"format": "date-time"
136+
}
137+
},
138+
"required": [
139+
"name",
140+
"parent",
141+
"file",
142+
"class_name",
143+
"status",
144+
"code_owners",
145+
"quarantine_setting",
146+
"last_updated_at"
147+
]
148+
}
149+
},
150+
"page": {
151+
"type": "object",
152+
"properties": {
153+
"total_rows": {
154+
"type": "integer",
155+
"exclusiveMinimum": 0
156+
},
157+
"total_pages": {
158+
"type": "integer",
159+
"exclusiveMinimum": 0
160+
},
161+
"next_page_token": {
162+
"type": "string"
163+
},
164+
"prev_page_token": {
165+
"type": "string"
166+
},
167+
"last_page_token": {
168+
"type": "string"
169+
},
170+
"page_index": {
171+
"type": "integer",
172+
"exclusiveMinimum": 0
173+
}
174+
},
175+
"required": [
176+
"total_rows",
177+
"total_pages",
178+
"next_page_token",
179+
"prev_page_token",
180+
"last_page_token",
181+
"page_index"
182+
]
183+
}
184+
},
185+
"required": [
186+
"quarantined_tests",
187+
"page"
188+
]
189+
}
190+
}
191+
}
192+
},
193+
"401": {
194+
"description": "Unauthorized",
195+
"content": {
196+
"application/plain-text": {
197+
"schema": {
198+
"type": "string"
199+
}
200+
}
201+
}
202+
},
203+
"500": {
204+
"description": "Internal server error",
205+
"content": {
206+
"application/plain-text": {
207+
"schema": {
208+
"type": "string"
209+
}
210+
}
211+
}
212+
}
213+
}
214+
}
215+
},
216+
"/status": {
217+
"get": {
218+
"security": [],
219+
"summary": "Get the status of Trunk services",
220+
"responses": {
221+
"200": {
222+
"description": "OK",
223+
"content": {
224+
"application/json": {
225+
"schema": {
226+
"type": "object",
227+
"properties": {
228+
"overallStatus": {
229+
"oneOf": [
230+
{
231+
"type": "object",
232+
"properties": {
233+
"type": {
234+
"type": "string",
235+
"const": "up"
236+
},
237+
"color": {
238+
"type": "string",
239+
"enum": [
240+
"green"
241+
]
242+
},
243+
"overallStatusDescription": {
244+
"type": "string",
245+
"const": "All systems operational"
246+
}
247+
},
248+
"required": [
249+
"type",
250+
"color",
251+
"overallStatusDescription"
252+
]
253+
},
254+
{
255+
"type": "object",
256+
"properties": {
257+
"type": {
258+
"type": "string",
259+
"const": "impacted"
260+
},
261+
"color": {
262+
"type": "string",
263+
"enum": [
264+
"yellow",
265+
"red"
266+
]
267+
},
268+
"overallStatusDescription": {
269+
"type": "string",
270+
"const": "Impacted"
271+
},
272+
"impactedStatuses": {
273+
"type": "array",
274+
"items": {
275+
"type": "object",
276+
"properties": {
277+
"name": {
278+
"type": "string"
279+
},
280+
"color": {
281+
"type": "string",
282+
"enum": [
283+
"yellow",
284+
"red"
285+
]
286+
},
287+
"statusDescription": {
288+
"type": "string"
289+
}
290+
},
291+
"required": [
292+
"name",
293+
"color",
294+
"statusDescription"
295+
]
296+
}
297+
}
298+
},
299+
"required": [
300+
"type",
301+
"color",
302+
"overallStatusDescription",
303+
"impactedStatuses"
304+
]
305+
}
306+
]
307+
},
308+
"statuses": {
309+
"type": "array",
310+
"items": {
311+
"type": "object",
312+
"properties": {
313+
"name": {
314+
"type": "string"
315+
},
316+
"color": {
317+
"type": "string",
318+
"enum": [
319+
"green",
320+
"yellow",
321+
"red"
322+
]
323+
},
324+
"statusDescription": {
325+
"type": "string"
326+
}
327+
},
328+
"required": [
329+
"name",
330+
"color",
331+
"statusDescription"
332+
]
333+
}
334+
}
335+
},
336+
"required": [
337+
"overallStatus",
338+
"statuses"
339+
]
340+
}
341+
}
342+
}
343+
},
344+
"500": {
345+
"description": "Internal server error",
346+
"content": {
347+
"application/plain-text": {
348+
"schema": {
349+
"type": "string"
350+
}
351+
}
352+
}
353+
}
354+
}
355+
}
356+
}
357+
},
358+
"components": {
359+
"securitySchemes": {
360+
"ApiKeyAuth": {
361+
"type": "apiKey",
362+
"in": "header",
363+
"name": "x-api-token"
364+
}
365+
}
366+
}
367+
}

.gitbook/includes/monitoring-webhooks (1).md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Monitoring Webhooks
33
---
44

5-
You can monitor the events and the webhook's delivery logs in the **Overview** tab of an endpoint configuration view. 
5+
You can monitor the events and the webhook's delivery logs in the **Overview** tab of an endpoint configuration view.
66

7-
You can see an overview of how many webhook deliveries have been attempted, how many are successful, how many are in-flight, and how many fail in the **Attempt Delivery Status** modal.
7+
You can see an overview of how many webhook deliveries have been attempted, how many are successful, how many are in flight, and how many fail in the **Attempt Delivery Status** modal.
88

99
<figure><img src="../assets/example-webhook-delivery-status.png" alt=""><figcaption></figcaption></figure>
1010

apis/flaky-tests.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Flaky Tests
2+
3+
The Trunk Flaky Tests API provides access to check the status of Trunk services and fetch [quarantined](../flaky-tests/quarantining.md) tests in your project. The API is an HTTP REST API, returns JSON from all requests, and uses standard HTTP response codes.
4+
5+
All requests must be [authenticated](./#authentication) by providing the `x-api-token` header.
6+
7+
{% openapi src="../.gitbook/assets/openapi.json" path="/status" method="get" %}
8+
[openapi.json](../.gitbook/assets/openapi.json)
9+
{% endopenapi %}
10+
11+
{% openapi src="../.gitbook/assets/openapi.json" path="/flaky-tests/list-quarantined-tests" method="post" %}
12+
[openapi.json](../.gitbook/assets/openapi.json)
13+
{% endopenapi %}
14+

0 commit comments

Comments
 (0)