Skip to content

[Lens] Restore embeddable test coverage#204986

Merged
dej611 merged 24 commits intoelastic:mainfrom
dej611:fix/198754
Jan 10, 2025
Merged

[Lens] Restore embeddable test coverage#204986
dej611 merged 24 commits intoelastic:mainfrom
dej611:fix/198754

Conversation

@dej611
Copy link
Copy Markdown
Contributor

@dej611 dej611 commented Dec 19, 2024

Summary

Fixes #198754

Restore previous removed tests when performing the refactor.
The new tests take advantage of the new architecture to be more modular and close to the logic modules.

The data_loader tests are not just covering the re-render logic but also some expression_params logic, who in the past have proven to be the source of some bugs: specifically the tests will check that the params are correctly passed to the params logic and then stored correctly in the observable.

New mocks take advantage of the plain initializers to build some of the API, that will make it in sync with the actual implementation for future maintenance.

Checklist

Check the PR satisfies following conditions.

@dej611 dej611 added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:prev-minor labels Dec 19, 2024
@dej611 dej611 marked this pull request as ready for review December 19, 2024 17:29
@dej611 dej611 requested review from a team as code owners December 19, 2024 17:29
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@davismcphee davismcphee removed the request for review from a team January 3, 2025 19:30
@davismcphee
Copy link
Copy Markdown
Contributor

Dismissed the Data Discovery review because it looks like there are no longer changes in our area.

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.5MB 1.5MB +79.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
lens 21 22 +1

Total ESLint disabled count

id before after diff
lens 21 22 +1

History

@dej611 dej611 merged commit 41950c2 into elastic:main Jan 10, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-visualizations (#202754)

Manual backport

To create the backport manually run:

node scripts/backport --pr 204986

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 13, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 204986 locally

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 204986 locally

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Jan 14, 2025

💚 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

dej611 added a commit to dej611/kibana that referenced this pull request Jan 14, 2025
## Summary

Fixes elastic#198754

Restore previous removed tests when performing the refactor.
The new tests take advantage of the new architecture to be more modular
and close to the logic modules.

The `data_loader` tests are not just covering the re-render logic but
also some `expression_params` logic, who in the past have proven to be
the source of some bugs: specifically the tests will check that the
params are correctly passed to the params logic and then stored
correctly in the observable.

New mocks take advantage of the plain initializers to build some of the
API, that will make it in sync with the actual implementation for future
maintenance.

### Checklist

Check the PR satisfies following conditions.

- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
(cherry picked from commit 41950c2)

# Conflicts:
#	x-pack/platform/plugins/shared/lens/public/react_embeddable/mocks/index.tsx
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

dej611 added a commit that referenced this pull request Jan 16, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Lens] Restore embeddable test coverage
(#204986)](#204986)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-10T09:29:38Z","message":"[Lens]
Restore embeddable test coverage (#204986)\n\n## Summary\r\n\r\nFixes
#198754\r\n\r\nRestore previous removed tests when performing the
refactor.\r\nThe new tests take advantage of the new architecture to be
more modular\r\nand close to the logic modules.\r\n\r\nThe `data_loader`
tests are not just covering the re-render logic but\r\nalso some
`expression_params` logic, who in the past have proven to be\r\nthe
source of some bugs: specifically the tests will check that
the\r\nparams are correctly passed to the params logic and then
stored\r\ncorrectly in the observable.\r\n\r\nNew mocks take advantage
of the plain initializers to build some of the\r\nAPI, that will make it
in sync with the actual implementation for
future\r\nmaintenance.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR
satisfies following conditions. \r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Marta Bondyra
<4283304+mbondyra@users.noreply.github.com>","sha":"41950c22df7ae25dc8c342b50b29a7f79b956a53","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","backport
missing","v9.0.0","backport:prev-minor"],"number":204986,"url":"https://github.com/elastic/kibana/pull/204986","mergeCommit":{"message":"[Lens]
Restore embeddable test coverage (#204986)\n\n## Summary\r\n\r\nFixes
#198754\r\n\r\nRestore previous removed tests when performing the
refactor.\r\nThe new tests take advantage of the new architecture to be
more modular\r\nand close to the logic modules.\r\n\r\nThe `data_loader`
tests are not just covering the re-render logic but\r\nalso some
`expression_params` logic, who in the past have proven to be\r\nthe
source of some bugs: specifically the tests will check that
the\r\nparams are correctly passed to the params logic and then
stored\r\ncorrectly in the observable.\r\n\r\nNew mocks take advantage
of the plain initializers to build some of the\r\nAPI, that will make it
in sync with the actual implementation for
future\r\nmaintenance.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR
satisfies following conditions. \r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Marta Bondyra
<4283304+mbondyra@users.noreply.github.com>","sha":"41950c22df7ae25dc8c342b50b29a7f79b956a53"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204986","number":204986,"mergeCommit":{"message":"[Lens]
Restore embeddable test coverage (#204986)\n\n## Summary\r\n\r\nFixes
#198754\r\n\r\nRestore previous removed tests when performing the
refactor.\r\nThe new tests take advantage of the new architecture to be
more modular\r\nand close to the logic modules.\r\n\r\nThe `data_loader`
tests are not just covering the re-render logic but\r\nalso some
`expression_params` logic, who in the past have proven to be\r\nthe
source of some bugs: specifically the tests will check that
the\r\nparams are correctly passed to the params logic and then
stored\r\ncorrectly in the observable.\r\n\r\nNew mocks take advantage
of the plain initializers to build some of the\r\nAPI, that will make it
in sync with the actual implementation for
future\r\nmaintenance.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR
satisfies following conditions. \r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Marta Bondyra
<4283304+mbondyra@users.noreply.github.com>","sha":"41950c22df7ae25dc8c342b50b29a7f79b956a53"}}]}]
BACKPORT-->
@kibanamachine kibanamachine added v8.18.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Jan 16, 2025
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
## Summary

Fixes elastic#198754

Restore previous removed tests when performing the refactor.
The new tests take advantage of the new architecture to be more modular
and close to the logic modules.

The `data_loader` tests are not just covering the re-render logic but
also some `expression_params` logic, who in the past have proven to be
the source of some bugs: specifically the tests will check that the
params are correctly passed to the params logic and then stored
correctly in the observable.

New mocks take advantage of the plain initializers to build some of the
API, that will make it in sync with the actual implementation for future
maintenance.


### Checklist

Check the PR satisfies following conditions. 

- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
dej611 added a commit to dej611/kibana that referenced this pull request Feb 21, 2025
Fixes elastic#198754

Restore previous removed tests when performing the refactor.
The new tests take advantage of the new architecture to be more modular
and close to the logic modules.

The `data_loader` tests are not just covering the re-render logic but
also some `expression_params` logic, who in the past have proven to be
the source of some bugs: specifically the tests will check that the
params are correctly passed to the params logic and then stored
correctly in the observable.

New mocks take advantage of the plain initializers to build some of the
API, that will make it in sync with the actual implementation for future
maintenance.

Check the PR satisfies following conditions.

- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
(cherry picked from commit 41950c2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens][Embeddable refactor] Write more tests for the new embeddable

7 participants