[7.17] [ci] More info to test annotation failure logging (#215515) (#215780)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[ci] More info to test annotation failure logging
(#215515)](https://github.com/elastic/kibana/pull/215515)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2025-03-24T18:01:32Z","message":"[ci]
More info to test annotation failure logging (#215515)\n\n##
Summary\nWhile annotating test failures, we're seeing increased amount
of errors\nlike this:\n```\n2025-03-21 13:52:32 INFO Artifact uploads
completed successfully\n--\n  | Annotate test failures error Request
failed with status code 404\n  | HTTP Error Response Status 404\n  |
HTTP Error Response Body { message: 'Not Found' }\n  | user command
error: exit status 10\n```\n\nIt would be nicer to show a bit more from
the error to help
debugging.","sha":"7120074ec32dcf693580244a01475a2af065a33d","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","skip-ci","backport:all-open","v9.1.0"],"title":"[ci]
More info to test annotation failure
logging","number":215515,"url":"https://github.com/elastic/kibana/pull/215515","mergeCommit":{"message":"[ci]
More info to test annotation failure logging (#215515)\n\n##
Summary\nWhile annotating test failures, we're seeing increased amount
of errors\nlike this:\n```\n2025-03-21 13:52:32 INFO Artifact uploads
completed successfully\n--\n  | Annotate test failures error Request
failed with status code 404\n  | HTTP Error Response Status 404\n  |
HTTP Error Response Body { message: 'Not Found' }\n  | user command
error: exit status 10\n```\n\nIt would be nicer to show a bit more from
the error to help
debugging.","sha":"7120074ec32dcf693580244a01475a2af065a33d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215515","number":215515,"mergeCommit":{"message":"[ci]
More info to test annotation failure logging (#215515)\n\n##
Summary\nWhile annotating test failures, we're seeing increased amount
of errors\nlike this:\n```\n2025-03-21 13:52:32 INFO Artifact uploads
completed successfully\n--\n  | Annotate test failures error Request
failed with status code 404\n  | HTTP Error Response Status 404\n  |
HTTP Error Response Body { message: 'Not Found' }\n  | user command
error: exit status 10\n```\n\nIt would be nicer to show a bit more from
the error to help
debugging.","sha":"7120074ec32dcf693580244a01475a2af065a33d"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
Kibana Machine 2025-03-24 22:11:27 +01:00 committed by GitHub
parent 9cd0344663
commit 881f2d4a53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,10 +13,17 @@ const { TestFailures } = require('kibana-buildkite-library');
try {
await TestFailures.annotateTestFailures();
} catch (ex) {
console.error('Annotate test failures error', ex.message);
console.error(
'Annotate test failures error',
ex.message,
ex?.stack || 'no stacktrace information'
);
if (ex.response) {
console.error('HTTP Error Response Status', ex.response.status);
console.error('HTTP Error Response Body', ex.response.data);
const requestUrl = ex.response?.url || ex.response?.config?.url || '';
console.error(
`HTTP Error ${ex.response.status}/${ex.response.statusText} (${requestUrl})`,
ex.response.data
);
}
process.exit(1);
}