Quarantine a flaky test of a repository
import requests
url = "https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine"
payload = {
"test_key": "<string>",
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({test_key: '<string>', reason: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"test_key": "<string>",
"reason": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"test_key": "<string>",
"suite": "<string>",
"name": "<string>",
"file": "<string>",
"reason": "<string>",
"source": "manual",
"flaky_rate": 0.5,
"samples": 1,
"created_by_email": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"consecutive_passes": 1,
"released_at": "2023-11-07T05:31:56Z",
"released_by_email": "<string>",
"release_reason": "manual",
"release_note": "<string>"
}Pipelines
Quarantine a flaky test of a repository
Quarantines one test of the repository. The quarantine must be on, and the test’s default-branch record over the last 30 days must reach the repository’s thresholds (min_flaky_rate over at least min_samples observed runs); its suite, name and file are copied from its newest recorded run. The decision is audited. Requires pipelines.manage.
POST
/
api
/
v1
/
org
/
pipeline-repositories
/
{repository_id}
/
pipeline-tests
/
quarantine
Quarantine a flaky test of a repository
import requests
url = "https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine"
payload = {
"test_key": "<string>",
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({test_key: '<string>', reason: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/pipeline-repositories/{repository_id}/pipeline-tests/quarantine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"test_key": "<string>",
"reason": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"test_key": "<string>",
"suite": "<string>",
"name": "<string>",
"file": "<string>",
"reason": "<string>",
"source": "manual",
"flaky_rate": 0.5,
"samples": 1,
"created_by_email": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"consecutive_passes": 1,
"released_at": "2023-11-07T05:31:56Z",
"released_by_email": "<string>",
"release_reason": "manual",
"release_note": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
The test was quarantined.
Pattern:
^[0-9a-f]{64}$Available options:
manual The default-branch flaky rate the decision rested on.
Required range:
0 <= x <= 1The observed default-branch runs that rate rested on.
Required range:
x >= 0The test's default-branch passes in a row while the quarantine is live; a failed or flaky run resets it.
Required range:
x >= 0Null while the quarantine is live.
"system" for a release after enough passes.
Available options:
manual, passes, null