forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.14] [CI] Display command on failure page (elastic#186999) (elastic…
…#187351) # Backport This will backport the following commits from `main` to `8.14`: - [[CI] Display command on failure page (elastic#186999)](elastic#186999) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Alex Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-02T09:45:46Z","message":"[CI] Display command on failure page (elastic#186999)\n\n## Summary\r\nThis PR adds the executed command line to the failures page.\r\nWe tweak the reporters to export the executed command to the junit xmls,\r\nthen we read those attributes after parsing the results.\r\n\r\nThe tests needed some adjustment, because they're very brittle, and\r\ndon't seem to be very accurate anymore.\r\n\r\n\r\nCloses: https://github.com/elastic/kibana-operations/issues/127\r\n\r\nCheck out the `[logs]` for the failed tests here\r\n(ftr/jest/jest_integration):\r\nhttps://buildkite.com/elastic/kibana-pull-request/builds/218457","sha":"afec9eb0e2699ce24a3fa4d341433cda18372466","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:prev-minor","v8.15.0"],"number":186999,"url":"https://github.com/elastic/kibana/pull/186999","mergeCommit":{"message":"[CI] Display command on failure page (elastic#186999)\n\n## Summary\r\nThis PR adds the executed command line to the failures page.\r\nWe tweak the reporters to export the executed command to the junit xmls,\r\nthen we read those attributes after parsing the results.\r\n\r\nThe tests needed some adjustment, because they're very brittle, and\r\ndon't seem to be very accurate anymore.\r\n\r\n\r\nCloses: https://github.com/elastic/kibana-operations/issues/127\r\n\r\nCheck out the `[logs]` for the failed tests here\r\n(ftr/jest/jest_integration):\r\nhttps://buildkite.com/elastic/kibana-pull-request/builds/218457","sha":"afec9eb0e2699ce24a3fa4d341433cda18372466"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186999","number":186999,"mergeCommit":{"message":"[CI] Display command on failure page (elastic#186999)\n\n## Summary\r\nThis PR adds the executed command line to the failures page.\r\nWe tweak the reporters to export the executed command to the junit xmls,\r\nthen we read those attributes after parsing the results.\r\n\r\nThe tests needed some adjustment, because they're very brittle, and\r\ndon't seem to be very accurate anymore.\r\n\r\n\r\nCloses: https://github.com/elastic/kibana-operations/issues/127\r\n\r\nCheck out the `[logs]` for the failed tests here\r\n(ftr/jest/jest_integration):\r\nhttps://buildkite.com/elastic/kibana-pull-request/builds/218457","sha":"afec9eb0e2699ce24a3fa4d341433cda18372466"}}]}] BACKPORT-->
- Loading branch information
Showing
12 changed files
with
108 additions
and
35 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/ftr_report.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/jest_report.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/mocha_report.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { execSync } from 'child_process'; | ||
import * as path from 'path'; | ||
|
||
const kibanaRoot = execSync('git rev-parse --show-toplevel').toString().trim() || process.cwd(); | ||
|
||
export function prettifyCommandLine(args: string[]) { | ||
let [executable, ...rest] = args; | ||
if (executable.endsWith('node')) { | ||
executable = 'node'; | ||
} | ||
rest = rest.map((arg) => path.relative(kibanaRoot, arg)); | ||
|
||
return [executable, ...rest].join(' '); | ||
} |