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] Run example plugin functional tests in Serverless #163411

Merged
merged 18 commits into from
Aug 31, 2023

Conversation

davismcphee
Copy link
Contributor

@davismcphee davismcphee commented Aug 8, 2023

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

For maintainers

@davismcphee davismcphee added release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Aug 8, 2023
@davismcphee davismcphee self-assigned this Aug 8, 2023
@davismcphee davismcphee force-pushed the serverless-examples-tests branch 2 times, most recently from 26184a2 to 0ffdb5e Compare August 9, 2023 18:12
x-pack/test_serverless/functional/config.base.ts Outdated Show resolved Hide resolved
"type": "doc",
"value": {
"id": "index-pattern:histogram-test",
"index": ".kibana_analytics_1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running Serverless functional tests, the index used for data view SOs is .kibana_analytics_1 instead of .kibana_analytics as in stateful, so I copied and modified this file to reflect that.

Copy link
Member

Choose a reason for hiding this comment

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

We try to avoid the usage of system indices in esArchives where possible (outside of specific SO migration tests, this often brings a lot of trouble and has been root cause of race conditions in the past). Have you considered using the kbnArchiver to save and restore this data view? Example usage here: https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/canvas/custom_elements.ts#L28

Copy link
Member

Choose a reason for hiding this comment

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

so it seems this test should be rewritten, but this could als be a follow up PR IMO

Copy link
Member

Choose a reason for hiding this comment

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

I agree, this can be done as a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the info! I agree, let's do this work as a followup and fix it in both stateful and serverless.

x-pack/test_serverless/functional/page_objects/index.ts Outdated Show resolved Hide resolved
@davismcphee davismcphee changed the title [Data Discovery] Run tests against example plugins in Serverless [Data Discovery] Run example plugin functional tests in Serverless Aug 9, 2023
@davismcphee davismcphee marked this pull request as ready for review August 9, 2023 20:16
@elasticmachine
Copy link
Contributor

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

@davismcphee davismcphee requested review from a team August 9, 2023 20:24
Copy link
Member

@dmlemeshko dmlemeshko 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. The only problem I see is that we won't be able to run these tests against projects created on MKI, meaning we won't verify functionality in the real customer environment.

@davismcphee davismcphee force-pushed the serverless-examples-tests branch from 0ffdb5e to 5849d44 Compare August 21, 2023 23:07
@davismcphee davismcphee requested a review from a team as a code owner August 21, 2023 23:42
@jbudz
Copy link
Member

jbudz commented Aug 23, 2023

Can we make sure there's a followup issue or note in #162347 for de-duplicating these tests when #161574 is available?

Copy link
Contributor Author

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Can we make sure there's a followup issue or note in #162347 for de-duplicating these tests when #161574 is available?

Definitely, added a separate issue for it here: #164911.

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

CI changes lgtm

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

DataDiscovery.lgtm Code review, in buildkites testing abilities we trust 👍

@davismcphee davismcphee force-pushed the serverless-examples-tests branch from a03cf41 to ddb9057 Compare August 29, 2023 20:17
@dmlemeshko
Copy link
Member

I believe we should hold on with this PR until #162673 is merged. Then pull the latest main with actual serverless ES and make sure these tests are still passing.

@davismcphee davismcphee force-pushed the serverless-examples-tests branch from 8d653f5 to 88679b4 Compare August 30, 2023 22:09
Copy link
Member

@dmlemeshko dmlemeshko 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
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

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @davismcphee

@davismcphee davismcphee merged commit b4bfb2a into elastic:main Aug 31, 2023
@davismcphee davismcphee deleted the serverless-examples-tests branch August 31, 2023 13:23
@kibanamachine kibanamachine added v8.11.0 backport:skip This commit does not require backporting labels Aug 31, 2023
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:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants