kibana/test/analytics
Spencer 1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
..
plugins [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
services [EBT] Better FTR helper APIs (#135298) 2022-06-29 14:11:13 +02:00
tests Removes deprecated <IHttpFetchError.res>, <IHttpFetchError.req> (#147727) 2022-12-27 10:55:21 -07:00
config.ts Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
README.md Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00

FTR tests for the core.analytics service

This suite allows us to test the event-based telemetry client provided by the core.analytics service.

How to add my own tests

Implement your own tests in the tests/instrumented_events/(from_the_browser|from_the_server)/ directory and list it in the tests/instrumented_events/(from_the_browser|from_the_server)/index.ts file.

There are 2 FTR helpers to allow you to retrieve the generated events:

  1. For events generated in the UI, you can use kibana_ebt_ui to retrieve the events.
  2. For events generated in the server, you can use the kibana_ebt_server helper.

The API is the same for both of them:

// To retrieve 2 events of type "my-event-type"
const events = await getService('kibana_ebt_ui').getEvents(2, { eventTypes: ['my-event-type'] });
expect(events).to...

If you are reusing these helpers in another suite, please remember to make sure to optIn via await getService('kibana_ebt_ui').setOptIn(true);

Refer to EBTHelpersContract for more details about the existing APIs and all the options they accept.