Open justinkambic opened 7 months ago
Pinging @elastic/unified-observability (Team:Observability)
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)
Removing from the Synthetics on serverless project board, as being tracked as part of Infra&Services work
Note that the Management UX team have been trying out having a unified set of API tests that are suitable for both stateful and serverless - see https://github.com/elastic/kibana/pull/183113.
This would be a more efficient implementation, rather than having duplicated API tests for each.
We should be hearing by the end of next week, the mechanism to allow stateful API tests to be run in a serverless configuration
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)
@justinkambic @dominiqueclarke Will this ticket be covered in https://github.com/elastic/kibana/issues/196229?
Some additional work that came out of https://github.com/elastic/kibana/pull/178897, we need to have some assurance that Synthetics will not catastrophically fail on Serverless when dependencies change. This is a visible risk that is illustrated in the linked issue for that PR.
As such, we should port at least a subset of the Synthetics API tests to the Serverless section of x-pack testing. This will give us at least assurance that our Kibana server is functioning nominally as more changes go in.
I've converted this task to a meta ticket with sub-issues stubbed out. ~I'll update each issue with links to the code in question, and add a guide to the meta for adapting tests that rely on features like roles and the ES security API that aren't available in Serverless. I'll also include links to the testing docs for Kibana's Serverless test suite.~
Prior art
You can see the initial implementation as part of https://github.com/elastic/kibana/pull/179861.
Key differences
When interacting via API endpoints, many of the Stateful tests utilize
supertestWithAuth
and make requests via users/roles they create using the security service:In Serverless, there's a SAML simulator you can use to provide the necessary auth via
supertestWithoutAuth
:note: at this time it's recommended to avoid using
system_indices_superuser
because this does not exist in MKI and will cause the test to fail and be skipped.Smells to look for are declarations like:
The Serverless alternative is to choose the appropriate SAML role to utilize to replicate the spirit of the original test you're porting.
Guidance
You can learn more about writing and manipulating serverless tests in general and API tests specifically by reviewing the README for the
test_serverless
section of the Kibana repo.