Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React@18] Improve console.error suppression in react-testing-library setup (#201142) #202600

Merged

Conversation

kapral18
Copy link
Contributor

@kapral18 kapral18 commented Dec 2, 2024

In addition to changes introduced by #201142

Reasoning:

This pull request includes changes to the packages/kbn-test/src/jest/setup/react_testing_library.js file to
improve internal error logging suppression from react-testing-library. In particular, this suppression logic has been migrated to avoid breaking devUX expectations.

Tested against #201142 code changes

@kapral18 kapral18 self-assigned this Dec 2, 2024
@kapral18 kapral18 requested review from a team as code owners December 2, 2024 22:30
@kapral18 kapral18 requested a review from eokoneyo December 2, 2024 22:30
@kapral18 kapral18 added backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) React@18 release_note:skip Skip the PR/issue when compiling release notes labels Dec 2, 2024
Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #4 / Entity Manager _count API is resilient to no valid sources

Metrics [docs]

✅ unchanged

History

cc @kapral18

@kapral18 kapral18 merged commit 3a6d27a into elastic:main Dec 16, 2024
8 checks passed
@kapral18 kapral18 deleted the chore/test/restore-rhtl-error-suppression branch December 16, 2024 13:41
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12353890329

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 16, 2024
… setup (elastic#201142) (elastic#202600)

In addition to changes introduced by elastic#201142

Reasoning:

This pull request includes changes to the
`packages/kbn-test/src/jest/setup/react_testing_library.js` file to
improve internal error logging suppression from react-testing-library.
In particular,
[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)
suppression logic has been migrated to avoid breaking devUX
expectations.

Tested against elastic#201142 code
changes

(cherry picked from commit 3a6d27a)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 16, 2024
…ibrary setup (#201142) (#202600) (#204398)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[React@18] Improve console.error suppression in react-testing-library
setup (#201142)
(#202600)](#202600)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Karen
Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2024-12-16T13:41:10Z","message":"[React@18]
Improve console.error suppression in react-testing-library setup
(#201142) (#202600)\n\nIn addition to changes introduced by
#201142\r\n\r\nReasoning:\r\n\r\nThis pull request includes changes to
the\r\n`packages/kbn-test/src/jest/setup/react_testing_library.js` file
to\r\nimprove internal error logging suppression from
react-testing-library.\r\nIn
particular,\r\n[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)\r\nsuppression
logic has been migrated to avoid breaking
devUX\r\nexpectations.\r\n\r\nTested against
#201142
code\r\nchanges","sha":"3a6d27af37c8ac2cdf730d206bd941554e729b9b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","React@18"],"title":"[React@18]
Improve console.error suppression in react-testing-library setup
(#201142)","number":202600,"url":"https://github.com/elastic/kibana/pull/202600","mergeCommit":{"message":"[React@18]
Improve console.error suppression in react-testing-library setup
(#201142) (#202600)\n\nIn addition to changes introduced by
#201142\r\n\r\nReasoning:\r\n\r\nThis pull request includes changes to
the\r\n`packages/kbn-test/src/jest/setup/react_testing_library.js` file
to\r\nimprove internal error logging suppression from
react-testing-library.\r\nIn
particular,\r\n[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)\r\nsuppression
logic has been migrated to avoid breaking
devUX\r\nexpectations.\r\n\r\nTested against
#201142
code\r\nchanges","sha":"3a6d27af37c8ac2cdf730d206bd941554e729b9b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202600","number":202600,"mergeCommit":{"message":"[React@18]
Improve console.error suppression in react-testing-library setup
(#201142) (#202600)\n\nIn addition to changes introduced by
#201142\r\n\r\nReasoning:\r\n\r\nThis pull request includes changes to
the\r\n`packages/kbn-test/src/jest/setup/react_testing_library.js` file
to\r\nimprove internal error logging suppression from
react-testing-library.\r\nIn
particular,\r\n[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)\r\nsuppression
logic has been migrated to avoid breaking
devUX\r\nexpectations.\r\n\r\nTested against
#201142
code\r\nchanges","sha":"3a6d27af37c8ac2cdf730d206bd941554e729b9b"}}]}]
BACKPORT-->

Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
… setup (elastic#201142) (elastic#202600)

In addition to changes introduced by elastic#201142

Reasoning:

This pull request includes changes to the
`packages/kbn-test/src/jest/setup/react_testing_library.js` file to
improve internal error logging suppression from react-testing-library.
In particular,
[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)
suppression logic has been migrated to avoid breaking devUX
expectations.

Tested against elastic#201142 code
changes
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 13, 2025
… setup (elastic#201142) (elastic#202600)

In addition to changes introduced by elastic#201142

Reasoning:

This pull request includes changes to the
`packages/kbn-test/src/jest/setup/react_testing_library.js` file to
improve internal error logging suppression from react-testing-library.
In particular,
[this](https://github.com/testing-library/react-hooks-testing-library/blob/1e01273374af4e48a0feb1f2233bf6c76d742167/src/core/console.ts#L1-L4)
suppression logic has been migrated to avoid breaking devUX
expectations.

Tested against elastic#201142 code
changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) React@18 release_note:skip Skip the PR/issue when compiling release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants