Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.9] [APM] Prevent console.error causing unit tests to fail locally (e…
…lastic#161959) (elastic#162100) # Backport This will backport the following commits from `main` to `8.9`: - [[APM] Prevent console.error causing unit tests to fail locally (elastic#161959)](elastic#161959) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Søren Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-18T00:45:58Z","message":"[APM] Prevent console.error causing unit tests to fail locally (elastic#161959)\n\nhttps://github.com/elastic/pull/161636 fixed a couple of unit\r\ntests that were failing locally but passing on CI. This PR should\r\nprevent this from happening again.\r\n\r\n**Why they failed locally and not on CI??**\r\nLocally `console.error` is treated as a test failure:\r\n\r\nhttps://github.com/elastic/kibana/blob/7ea0dd6b116a93024d68ea2d93fa4ce90e9bf189/x-pack/plugins/apm/jest_setup.js#L12-L15\r\n\r\nWhereas on CI `console.*` is disabled:\r\n\r\nhttps://github.com/elastic/kibana/blob/a78c7b02b3b825826f39289e91e545ee6f4a67d9/packages/kbn-test/src/jest/setup/disable_console_logs.js#L9-L12\r\n\r\nThis means that if a test logs `console.error` it would fail locally but\r\nnot on CI. This PR changes that so console.error will not cause unit\r\ntests to fail anywhere.","sha":"c842479d633ee28ddda3ce960e1341f20d5801e3","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:APM","release_note:skip","v8.9.0","v8.10.0"],"number":161959,"url":"https://github.com/elastic/kibana/pull/161959","mergeCommit":{"message":"[APM] Prevent console.error causing unit tests to fail locally (elastic#161959)\n\nhttps://github.com/elastic/pull/161636 fixed a couple of unit\r\ntests that were failing locally but passing on CI. This PR should\r\nprevent this from happening again.\r\n\r\n**Why they failed locally and not on CI??**\r\nLocally `console.error` is treated as a test failure:\r\n\r\nhttps://github.com/elastic/kibana/blob/7ea0dd6b116a93024d68ea2d93fa4ce90e9bf189/x-pack/plugins/apm/jest_setup.js#L12-L15\r\n\r\nWhereas on CI `console.*` is disabled:\r\n\r\nhttps://github.com/elastic/kibana/blob/a78c7b02b3b825826f39289e91e545ee6f4a67d9/packages/kbn-test/src/jest/setup/disable_console_logs.js#L9-L12\r\n\r\nThis means that if a test logs `console.error` it would fail locally but\r\nnot on CI. This PR changes that so console.error will not cause unit\r\ntests to fail anywhere.","sha":"c842479d633ee28ddda3ce960e1341f20d5801e3"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161959","number":161959,"mergeCommit":{"message":"[APM] Prevent console.error causing unit tests to fail locally (elastic#161959)\n\nhttps://github.com/elastic/pull/161636 fixed a couple of unit\r\ntests that were failing locally but passing on CI. This PR should\r\nprevent this from happening again.\r\n\r\n**Why they failed locally and not on CI??**\r\nLocally `console.error` is treated as a test failure:\r\n\r\nhttps://github.com/elastic/kibana/blob/7ea0dd6b116a93024d68ea2d93fa4ce90e9bf189/x-pack/plugins/apm/jest_setup.js#L12-L15\r\n\r\nWhereas on CI `console.*` is disabled:\r\n\r\nhttps://github.com/elastic/kibana/blob/a78c7b02b3b825826f39289e91e545ee6f4a67d9/packages/kbn-test/src/jest/setup/disable_console_logs.js#L9-L12\r\n\r\nThis means that if a test logs `console.error` it would fail locally but\r\nnot on CI. This PR changes that so console.error will not cause unit\r\ntests to fail anywhere.","sha":"c842479d633ee28ddda3ce960e1341f20d5801e3"}}]}] BACKPORT--> Co-authored-by: Søren Louv-Jansen <[email protected]>
- Loading branch information