type Bitbucket = {
username: string;
password: string;
};
/**
* Get test case reasons (output) for a given test case in a step of a pipeline.
*
*/
export async function main(
auth: Bitbucket,
workspace: string,
repo_slug: string,
pipeline_uuid: string,
step_uuid: string,
test_case_uuid: string
) {
const url = new URL(
`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/pipelines/${pipeline_uuid}/steps/${step_uuid}/test_reports/test_cases/${test_case_uuid}/test_case_reasons`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 375 days ago
type Bitbucket = {
username: string;
password: string;
};
/**
* Get test case reasons (output) for a given test case in a step of a pipeline.
*
*/
export async function main(
auth: Bitbucket,
workspace: string,
repo_slug: string,
pipeline_uuid: string,
step_uuid: string,
test_case_uuid: string
) {
const url = new URL(
`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/pipelines/${pipeline_uuid}/steps/${step_uuid}/test_reports/test_cases/${test_case_uuid}/test_case_reasons`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 935 days ago