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

[Data Discovery] Add Serverless functional test coverage #162347

Closed
3 tasks done
Tracked by #162350
drewdaemon opened this issue Jul 20, 2023 · 2 comments
Closed
3 tasks done
Tracked by #162350

[Data Discovery] Add Serverless functional test coverage #162347

drewdaemon opened this issue Jul 20, 2023 · 2 comments
Assignees
Labels
impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@drewdaemon
Copy link
Contributor

drewdaemon commented Jul 20, 2023

Describe the feature:
Identify key user flows and create a fundamental suite of functional tests following instructions in the Kibana Serverless e2e Test Guide (Google docs).

Plan

Progress

Followup work to deduplicate tests: #164911.

Functional tests

We have a couple of options depending on if we want to have broader test coverage in Serverless by duplicating existing tests or just stick to basic smoke test coverage of shared functionality in Serverless and focus more on testing differences between stateful and Serverless.

Note

We decided on the "Duplicating existing tests" approach below in order to provide more thorough coverage in Serverless initially, and since deployment agnostic tests will eventually be supported by ​​#161574, which will allow us to share these tests.

Duplicating existing tests

This approach would involve copying a number of existing functional tests that cover major functionality in our applications to test_serverless and modifying them in place to run in Serverless. This would likely give us the best test coverage overall, but comes with the drawback of having to maintain two copies of the duplicated test files independently until support for sharing tests between stateful and Serverless is supported (see ​​#161574).

Recommended tests (in rough order of importance – we may not get to all of them)

  • Discover
    • test/functional/apps/discover/
      • group1/_discover.ts
      • group1/_discover_histogram.ts
      • embeddable/_saved_search_embeddable.ts
      • group2/_adhoc_data_views.ts
      • group2/_data_grid_doc_navigation.ts
      • group2/_data_grid_doc_table.ts
      • group3/_request_counts.ts
      • group3/_sidebar.ts
    • test/functional/apps/context/
      • _context_navigation.ts
      • _discover_navigation.ts
      • _filters.ts
      • _size.ts
    • test/functional/apps/management/data_views/
      • _data_view_create_delete.ts
      • _exclude_index_pattern.ts
      • _runtime_fields.ts
      • _runtime_fields_composite.ts
      • _edit_field.ts
    • x-pack/test/functional/apps/discover/
      • reporting.ts
      • Visualize_field.ts
    • x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/search_source_alert.ts
    • CCS:
      • x-pack/test/stack_functional_integration/apps/ccs/ccs_discover.js
      • test/functional/apps/management/ccs_compatibility/_data_views_ccs.ts

Basic smoke testing

With this approach we would write a few high level smoke tests to cover the main functionality of our applications and focus additional efforts on testing differences between stateful and Serverless. The smoke tests we write should focus on functionality that interacts with ES (as opposed to just UI tests) since the differences between stateful and stateless ES are where we’re most likely to encounter issues (otherwise our applications should currently run identically between stateful and Serverless).

Smoke tests

  • Discover:
    • Navigate to Discover.
    • Switch to a non-default data view.
    • Create and execute a search including query, filters, and time range.
    • Add some columns to the table.
    • Change the sort column and direction.
    • Set a histogram breakdown field and change the histogram time interval.
    • Save the current search as a new saved search
    • Click the “New” button to clear the current saved search.
    • Open the previously created saved search.
    • Verify the search results in grid, total hits, and histogram.
    • Open the field list popover for a field that supports field statistics and verify it works as expected.
    • Open the expanded document flyout and verify the table looks as expected.
    • Navigate to Single document and Surrounding documents views and verify they display as expected.
  • Data View Management:
    • Navigate to Data View Management.
    • Create a new data view that includes and excludes indices in its index pattern (e.g. kib*,-kibana_sample_data_e*).
    • Add two runtime fields to the data view and verify in the preview panel that they output as expected:
      • One which outputs a calculated value and uses a field formatter.
      • Another which is a composite runtime field.
    • Edit an existing field with a change such as a custom label.
    • Verify that the runtime fields exist, and the edited field changes are reflected in the fields table.
    • Switch to the field filters tab and add a new field filter.
    • Verify that the added field filter matches the expected fields.
    • Navigate to the Data View Management listing page and verify the created data view appears in the list.
    • Delete the created data view and verify that it’s removed from the list.

API integration tests

Our API integration tests should run the same in stateful and Serverless, and for the most part we should be able to copy and run them with few modifications:

  • test/api_integration/apis/data_views
  • test/api_integration/apis/data_view_field_editor
  • test/api_integration/apis/kql_telemetry
  • test/api_integration/apis/scripts
  • test/api_integration/apis/search
  • x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js
  • x-pack/test/api_integration/apis/search

Example plugin tests

We have a number of example plugins that we use to run functional tests against various components and services, which we should copy and run in Serverless:

  • test/examples/data_view_field_editor_example
  • test/examples/discover_customization_examples
  • test/examples/field_formats
  • test/examples/partial_results
  • test/examples/search
  • test/examples/unified_field_list_examples
  • x-pack/test/examples/search_examples
@drewdaemon drewdaemon added Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Jul 20, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@davismcphee davismcphee added loe:needs-research This issue requires some research before it can be worked on or estimated impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Jul 27, 2023
@davismcphee davismcphee self-assigned this Jul 27, 2023
@davismcphee davismcphee added loe:large Large Level of Effort and removed loe:needs-research This issue requires some research before it can be worked on or estimated labels Aug 26, 2023
@davismcphee davismcphee changed the title [Discover] add Serverless functional tests [Data Discovery] Add Serverless functional test coverage Aug 26, 2023
@davismcphee davismcphee removed the Feature:Discover Discover Application label Aug 26, 2023
davismcphee added a commit that referenced this issue Aug 29, 2023
## Summary

This PR copies the Data Discovery API integration tests to
`test_serverless`. They are currently in the common folder and will run
once for each project type in CI, but we could instead move them to a
specific project if we don't want to run them three times each.

In the future these should run as deployment-agnostic tests, but support
does not yet exist (see #161574), so in the meantime they've been
duplicated and modified in place. I've left `TODO` comments where test
files have been modified so we know what needs to be addressed once they
are converted to deployment-agnostic tests.

Part of #162347.

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [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
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] 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: kibanamachine <[email protected]>
davismcphee added a commit that referenced this issue Aug 31, 2023
…163411)

## Summary

> [!IMPORTANT]  
> These tests currently do not run in "real" Serverless and only run in
"local" Serverless (what we use in CI). Additional work will need to be
done to allow these tests to be run in an actual Serverless environment,
since they required `config.ts` changes which are only loaded when
running locally.

This PR copies the Data Discovery example plugin functional tests to
`test_serverless` and adds support for running them against the Search
project.

It also adds support for running functional tests against example
plugins in general in Serverless ("local" Serverless only currently).

In the future these should run as deployment-agnostic tests, but support
does not yet exist (see #161574), so in the meantime they've been
duplicated and modified in place. I've left `TODO` comments where test
files have been modified so we know what needs to be addressed once they
are converted to deployment-agnostic tests.

Part of #162347.

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [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
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] 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: kibanamachine <[email protected]>
Co-authored-by: Dzmitry Lemechko <[email protected]>
davismcphee added a commit that referenced this issue Nov 17, 2023
…164656)

## Summary

This PR copies the Data Discovery functional tests to `test_serverless`
and adds support for running them against each of the project types.

Part of #162347.

Flaky test runs:
- x300:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3977

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [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
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] 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: kibanamachine <[email protected]>
@davismcphee
Copy link
Contributor

Closing this since all planned initial serverless test migrations are now complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

No branches or pull requests

3 participants