Skip to content

Upgrade to Jest 29#143319

Merged
jbudz merged 9 commits intoelastic:mainfrom
jbudz:bump-jest-29
Nov 18, 2022
Merged

Upgrade to Jest 29#143319
jbudz merged 9 commits intoelastic:mainfrom
jbudz:bump-jest-29

Conversation

@jbudz
Copy link
Copy Markdown
Contributor

@jbudz jbudz commented Oct 13, 2022

https://jestjs.io/blog/2022/04/25/jest-28
https://jestjs.io/blog/2022/08/25/jest-29

  • jest.useFakeTimers('legacy') -> jest.useFakeTimers({ legacyFakeTimers: true });
  • jest.useFakeTimers('modern'); -> jest.useFakeTimers();
  • tests can either use promises or callbacks, but not both
  • test runner jasmine is no longer included, switch all suites to jest-circus

@jbudz jbudz mentioned this pull request Oct 14, 2022
@jbudz jbudz force-pushed the bump-jest-29 branch 4 times, most recently from db060d8 to 02ae1f3 Compare October 31, 2022 15:34
@jbudz jbudz force-pushed the bump-jest-29 branch 6 times, most recently from c6ef046 to 705c51e Compare November 16, 2022 13:16
@jbudz jbudz marked this pull request as ready for review November 16, 2022 15:43
@jbudz jbudz requested review from a team as code owners November 16, 2022 15:43
@jbudz jbudz requested a review from a team November 16, 2022 15:43
@jbudz jbudz requested review from a team as code owners November 16, 2022 15:43
@jbudz jbudz requested a review from a team November 16, 2022 15:43
Copy link
Copy Markdown
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

Security Solution LGTM

Copy link
Copy Markdown
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

Thanks for this update. security_solution/management changes LGTM.

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #1 / Alerts timeline Privileges: read only "before each" hook for "should not allow user with read only privileges to attach alerts to existing cases"
  • [job] [logs] Security Solution Tests #1 / Cases Creates a new case with timeline and opens the timeline

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 108 113 +5
securitySolution 442 448 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 67 73 +6
osquery 109 115 +6
securitySolution 519 525 +6
total +20

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Nov 18, 2022

Hey all, we're merging this early with a few pending reviews. With the breaking changes involved, it's difficult to keep up to date. We'll use the weekend to monitor for stability and give open PRs a chance to merge latest in.

There's three skipped tests, I'll follow up with issues for their respective teams.

Thanks for all the feedback!

@jbudz jbudz merged commit 2ac7ebe into elastic:main Nov 18, 2022
@kibanamachine kibanamachine added v8.7.0 backport:skip This PR does not require backporting labels Nov 18, 2022
cnasikas added a commit that referenced this pull request Dec 13, 2022
## Summary

This PR unskips a test that was skipped during the [Jest
upgrade](#143319) to version 29.

Fixes #145751

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese pushed a commit to nreese/kibana that referenced this pull request Dec 16, 2022
## Summary

This PR unskips a test that was skipped during the [Jest
upgrade](elastic#143319) to version 29.

Fixes elastic#145751

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@Ikuni17
Copy link
Copy Markdown
Contributor

Ikuni17 commented May 26, 2023

💚 All backports created successfully

Status Branch Result
7.17

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

Questions ?

Please refer to the Backport tool documentation

Ikuni17 added a commit that referenced this pull request Jun 9, 2023
Closes #157436

Unblocks: #157111

# Backport

This will backport the following commits from `main` to `7.17`:
- [Upgrade to Jest 29
(#143319)](#143319)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Jonathan
Budzenski","email":"jon@elastic.co"},"sourceCommit":{"committedDate":"2022-11-18T15:40:16Z","message":"Upgrade
to Jest 29
(#143319)\n\nhttps://jestjs.io/blog/2022/04/25/jest-28\r\nhttps://jestjs.io/blog/2022/08/25/jest-29\r\n\r\n-
jest.useFakeTimers('legacy') -> jest.useFakeTimers({
legacyFakeTimers:\r\ntrue });\r\n- jest.useFakeTimers('modern'); ->
jest.useFakeTimers();\r\n- tests can either use promises or callbacks,
but not both\r\n- test runner jasmine is no longer included, switch all
suites to\r\njest-circus\r\n\r\nCo-authored-by: Andrew Tate
<andrew.tate@elastic.co>","sha":"2ac7ebe3bf9bd3a8e18c71df5f7c51541ecec339","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","Feature:Embedding","Team:APM","Feature:ExpressionLanguage","Team:uptime","release_note:skip","backport:skip","Team:Fleet","v8.7.0"],"number":143319,"url":"https://github.com/elastic/kibana/pull/143319","mergeCommit":{"message":"Upgrade
to Jest 29
(#143319)\n\nhttps://jestjs.io/blog/2022/04/25/jest-28\r\nhttps://jestjs.io/blog/2022/08/25/jest-29\r\n\r\n-
jest.useFakeTimers('legacy') -> jest.useFakeTimers({
legacyFakeTimers:\r\ntrue });\r\n- jest.useFakeTimers('modern'); ->
jest.useFakeTimers();\r\n- tests can either use promises or callbacks,
but not both\r\n- test runner jasmine is no longer included, switch all
suites to\r\njest-circus\r\n\r\nCo-authored-by: Andrew Tate
<andrew.tate@elastic.co>","sha":"2ac7ebe3bf9bd3a8e18c71df5f7c51541ecec339"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/143319","number":143319,"mergeCommit":{"message":"Upgrade
to Jest 29
(#143319)\n\nhttps://jestjs.io/blog/2022/04/25/jest-28\r\nhttps://jestjs.io/blog/2022/08/25/jest-29\r\n\r\n-
jest.useFakeTimers('legacy') -> jest.useFakeTimers({
legacyFakeTimers:\r\ntrue });\r\n- jest.useFakeTimers('modern'); ->
jest.useFakeTimers();\r\n- tests can either use promises or callbacks,
but not both\r\n- test runner jasmine is no longer included, switch all
suites to\r\njest-circus\r\n\r\nCo-authored-by: Andrew Tate
<andrew.tate@elastic.co>","sha":"2ac7ebe3bf9bd3a8e18c71df5f7c51541ecec339"}}]}]
BACKPORT-->

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
e40pud added a commit that referenced this pull request Aug 8, 2023
…est.tsx" tests (#163169)

## Summary

Original ticket: #145749

This PR un-skips tests which were disabled due to [upgrade to Jest 29
here](#143319).

Fixes:
1. Restructured test which checks the `isLoading` state returned by the
`useFetchOrCreateRuleExceptionList` hook
2. Make sure we call `await waitForNextUpdate();` right amount of times

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
bryce-b pushed a commit to bryce-b/kibana that referenced this pull request Aug 9, 2023
…est.tsx" tests (elastic#163169)

## Summary

Original ticket: elastic#145749

This PR un-skips tests which were disabled due to [upgrade to Jest 29
here](elastic#143319).

Fixes:
1. Restructured test which checks the `isLoading` state returned by the
`useFetchOrCreateRuleExceptionList` hook
2. Make sure we call `await waitForNextUpdate();` right amount of times

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Embedding Embedding content via iFrame Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Fleet Team label for Observability Data Collection Fleet team Team:Operations Kibana-Operations Team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.17.11 v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.