elastic / kibana

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

Migrate ES Query tests to deployment agnostic solution #183395

Open mgiota opened 1 month ago

mgiota commented 1 month ago

Part of https://github.com/elastic/kibana/issues/183263

πŸ’ Summary

As part of this PR we introduce a way to write deployment agnostic tests using Mocha tagging. Tests should be written in the new observability_solution_api_integration folder and should be tagged with the @ess and @serverless tags.

describe('@ess @serverless ES query rule, () => {
  describe('Create rule', () => { 
  });
}

Existing tests

Test Type ESS Serverless Notes
ES query rule type Alerting ❌ βœ… ESS: x-pack/test_serverless/api_integration/test_suites/observability/es_query_rule

New folder structure

Screenshot 2024-05-14 at 13 57 49

How to migrate

  1. create a new es_query folder within alerting folder
  2. move es_query rule tests there
  3. Create serverless.config.ts and ess.config.ts files similar to the burn_rate rule in this PR
  4. Add the new config files in .buildkite/ftr_configs.yml
  5. Tag the tests with @ess @serverless tags
  6. create 2 script commands in the package.json of the observability_solution_api_integration folder similar to the burn_rate commands.
  7. For ESS
    • start the server using your new alias alerting_es_query:server:ess
    • start the test runner using the new alias alerting_es_query:runner:ess
  8. For Serverless
    • start the server using your new alias alerting_es_query:server:serverless
    • start the test runner using the new alias alerting_es_query:runner:serverless
maryam-saeidi commented 4 weeks ago

Moved to backlog until the related Meta ticket is prioritized.