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

[Logs Explorer] Add test suite for Dataset Selector #163079

Merged
merged 30 commits into from
Aug 11, 2023

Conversation

tonyghiani
Copy link
Contributor

@tonyghiani tonyghiani commented Aug 3, 2023

📓 Summary

Closes #160627

This implementation adds the majority of the tests listed down here for the Log Explorer current implementation.

Flaky Test Runner - x50 executions

↳ Discover Log-Explorer profile
   ↳ Columns selection initialization and update
     ↳ when the log explorer profile loads
       ↳ should initialize the table columns to logs' default selection
       ↳ should restore the table columns from the URL state if exists
   ↳ Customizations
     ↳ when Discover is loaded with the log-explorer profile
       ↳ DatasetSelector should replace the DataViewPicker
       ↳ the TopNav bar should hide the New, Open and Save options
       ↳ should add a searchable deep link to the profile page
       ↳ should render a filter controls section as part of the unified search bar
   ↳ DatasetSelection initialization and update
     ↳ when the "index" query param does not exist
       ↳ should initialize the "All log datasets" selection
     ↳ when the "index" query param exists
       ↳ should decode and restore the selection from a valid encoded index
       ↳ should fallback to the "All log datasets" selection and notify the user of an invalid encoded index
     ↳ when navigating back and forth on the page history
       ↳ should decode and restore the selection for the current index
   ↳ Dataset Selector
     ↳ without installed integrations or uncategorized data streams
       ↳ when open on the first navigation level
         ↳ should always display the "All log datasets" entry as the first item
         ↳ should always display the unmanaged datasets entry as the second item
         ↳ should display an error prompt if could not retrieve the integrations
         ↳ should display an empty prompt for no integrations
       ↳ when navigating into Uncategorized data streams
         ↳ should display a loading skeleton while loading
         ↳ should display an error prompt if could not retrieve the data streams
         ↳ should display an empty prompt for no data streams
     ↳ with installed integrations and uncategorized data streams
       ↳ when open on the first navigation level
         ↳ should always display the "All log datasets" entry as the first item
         ↳ should always display the unmanaged datasets entry as the second item
         ↳ should display a list of installed integrations
         ↳ should sort the integrations list by the clicked sorting option
         ↳ should filter the integrations list by the typed integration name
         ↳ should display an empty prompt when the search does not match any result
         ↳ should load more integrations by scrolling to the end of the list
       ↳ when clicking on integration and moving into the second navigation level
         ↳ should display a list of available datasets
         ↳ should sort the datasets list by the clicked sorting option
         ↳ should filter the datasets list by the typed dataset name
         ↳ should update the current selection with the clicked dataset
       ↳ when navigating into Uncategorized data streams
         ↳ should display a list of available datasets
         ↳ should sort the datasets list by the clicked sorting option
         ↳ should filter the datasets list by the typed dataset name
         ↳ should update the current selection with the clicked dataset
       ↳ when open/close the selector
         ↳ should restore the latest navigation panel
         ↳ should restore the latest search results
       ↳ when switching between integration panels
         ↳ should remember the latest search and restore its results for each integration

Note on serverless tests suite

For testing the feature in a serverless environment, we are copying all the tests into the x-pack/test_serverless folder until #161574 is merged, which will provide a new space to write tests independently from the deployment type, avoiding then tests duplication.

New browser service utils for Network conditions simulation

To properly test that this feature works correctly under poor network conditions or offline scenarios, the browser service now exposes some new methods for altering network conditions on demand.

Also, network profiles to match the network profiles provided by Chrome debugger have been created.

In case the browser is not of chromium type and the driver does not support the network simulation, these methods throw an error that can be caught for skipping the affected test.

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

kibanamachine and others added 27 commits August 3, 2023 15:12
@tonyghiani tonyghiani marked this pull request as ready for review August 10, 2023 14:58
@tonyghiani tonyghiani requested review from a team as code owners August 10, 2023 14:58
@Kerry350 Kerry350 self-requested a review August 10, 2023 15:01
@tonyghiani tonyghiani added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes labels Aug 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@tonyghiani
Copy link
Contributor Author

The part regarding the FTR changes have been splitted into #163633 for an easier review, it will be merged into this PR when merged into main.

Copy link
Contributor

@Kerry350 Kerry350 left a comment

Choose a reason for hiding this comment

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

Great work! 👏 Thanks for the very thorough test suite, and for expanding the Browser utils.

@tonyghiani tonyghiani removed request for a team August 11, 2023 12:25
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
discoverLogExplorer 222.7KB 223.2KB +551.0B

History

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

@tonyghiani tonyghiani merged commit f09a5c9 into elastic:main Aug 11, 2023
@tonyghiani tonyghiani deleted the 160627-log-explorer-testing branch August 11, 2023 13:32
@kibanamachine kibanamachine added v8.10.0 backport:skip This commit does not require backporting labels Aug 11, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 11, 2023
* main: (64 commits)
  [ML] Transforms: Fix privileges check. (elastic#163687)
  [Log Explorer] Add test suite for Dataset Selector (elastic#163079)
  [Security Solution][Endpoint] Add API checks to Endpoint Policy create/update for checking `endpointPolicyProtections` is enabled (elastic#163429)
  [Security Solution] Fix flaky test: x-pack/test/detection_engine_api_integration/security_and_spaces/update_prebuilt_rules_package/update_prebuilt_rules_package·ts - update_prebuilt_rules_package should allow user to install prebuilt rules from scratch, then install new rules and upgrade existing rules from the new package (elastic#163241)
  [Security Solution] expandable flyout - replace feature flag with advanced settings toggle (elastic#161614)
  [DOCS] Adds the release notes for the 8.9.1 release. (elastic#163578)
  [FTR] Implement browser network condition utils (elastic#163633)
  [Security Solution] Unskip rules table auto-refresh Cypress tests (elastic#163451)
  [Security Solution] Re-enable fixed rule snoozing Cypress test (elastic#160037)
  [Flaky Test elastic#111821] Mock `moment` to avoid midnight TZ issues (elastic#163157)
  Document interactive setup (elastic#163619)
  [Lens] Align decoration color with text color for layer actions (elastic#163630)
  [Lens] Relax counter field checks for saved visualizations with unsupported operations (elastic#163515)
  [Security Solution][Endpoint] Removes pMap and uses a for loop instead (elastic#163509)
  [Enterprise Search] Update Workplace Search connectors doclink (elastic#163676)
  Update APM (main) (elastic#163623)
  [Serverless] Partially fix lens/maps/visualize breadcrumbs missing title  (elastic#163476)
  [Flaky elastic#118272] Unskip tests (elastic#163319)
  [APM] Make service group saved objects exportable (elastic#163569)
  [Observability AI Assistant] Action menu item (elastic#163463)
  ...
@achyutjhunjhunwala achyutjhunjhunwala changed the title [Log Explorer] Add test suite for Dataset Selector [Logs Explorer] Add test suite for Dataset Selector Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Log Explorer] Missing test suite for DatasetSelector in log-explorer profile
6 participants