elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.82k stars 8.2k forks source link

Create a deployment-agnostic test for GET /internal/dataset_quality/data_streams/{dataStream}/settings #193542

Open gbamparop opened 1 month ago

gbamparop commented 1 month ago

Create a deployment-agnostic test for GET /internal/dataset_quality/data_streams/{dataStream}/settings

achyutjhunjhunwala commented 1 week ago

I tried working on this migration but found that admin user we have for serverless is having not the same rights as the admin user in stateful. Due to this our tests are failing.

For example - In one of the tests, the API is called with admin user from serverless and then in the same test, ES API is called with the es user from getServices('es'). You can see the difference in response

Image

gbamparop commented 1 week ago

@achyutjhunjhunwala do we handle serverless differently in the UI or use other APIs instead?

achyutjhunjhunwala commented 1 week ago

@gbamparop Well after further digging, i have found that our Serverless API tests are also using Operator user because the client configured for the test is not correctly configured and hence these tests were passing for both Stateful and Serverless. Though in reality our API would have been returning undefined data in Serverless production for certain fields.

While writing Deployment Agnostic test, where the API client is well constructed by Appex Team, this issue became more evident.

At the moment the only field which impacts us is creation_date. Elasticsearch serverless is not exposing this information on the Settings API for regular or admin user.

Hence i have successfully migrated these tests adding an exception to not check for creation_date when the test runs on Serverless

achyutjhunjhunwala commented 1 week ago

Should be closed once this is merged - https://github.com/elastic/kibana/pull/195561