User:Etonkovidova (WMF)/Testing Instrumentation

From mediawiki.org

This page is a summary of QA practices to test instrumentation.

Instrumentation testing[edit]

Before testing[edit]

- read documentation on event logging (there could be updates/changed access info etc) - Analytics/Systems/EventLogging/TestingOnBetaCluster and EventPlatform/Instrumentation

- read a schema description (e.g. Schema:HomepageModule or find a schema on shema.wikimedia.org) to understand what actions to perform to trigger eventlogging events

- create a testing outline based on a phab task (e.g. task T325117) or on a schema description to make sure that all events from a schema would be triggered

Monitoring[edit]

- in beta cluster: stream-beta.wmflabs.org

- on production, e.g. for GrowthExperiments schemas - Growth event validation

In a browser (client side testing)[edit]

The testing with the console snippets can be done in beta cluster and in production.

- enable your browser's devtools and enable "persistent log" in the Console

- use the following snippet (credit to User:KHarlan (WMF)

mw.trackSubscribe('event.HomepageModule', console.log);

- perform the actions that trigger eventlogging and compare with the info documented in the relevant schema description

Server side testing[edit]

The instructions are for beta cluster.

- log in and go to the directory with logs:

ssh deployment-eventlog08.deployment-prep.eqiad1.wikimedia.cloud

srv/log/eventlogging/systemd

- to verify that events have been properly logged you may use grep or any other means of your choice. For example, to see which editor_interface were recorded, you may use:

grep  '"schema": "HelpPanel"' all-events.log |grep -oE  ".editor_interface.{0,17}"