Page MenuHomePhabricator

Create a stub experiment manager for JS tests
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

In T404058: Add MetricsPlatform to gated extensions, I decided not to make MetricsPlatform a gated extension but instead to provide a stub experiment manager for JS tests, to help other teams to test their implementations (GrowthExperiments Extension <> Experiment Manager). This task covers doing that.

AC

  • Calling mw.xLab.mockExperimentEnrollment( name, group ) defines a mock experiment for the duration of the test and returns a mocked Experiment instance
  • Calling mw.xLab.getExperiment( name ) returns the same mocked Experiment instance
  • Calling mw.xLab.restoreMockExperiments() removes all mock experiments
  • Documentation
  • QA?

Details

Event Timeline

phuedx triaged this task as High priority.Sep 26 2025, 10:39 AM
phuedx added a project: OKR-Work.
JVanderhoop-WMF set the point value for this task to 5.
phuedx lowered the priority of this task from High to Medium.Feb 3 2026, 4:32 PM

Change #1251287 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/TestKitchen@master] ext.testKitchen: Add test helpers

https://gerrit.wikimedia.org/r/1251287

Change #1251287 merged by jenkins-bot:

[mediawiki/extensions/TestKitchen@master] ext.testKitchen: Add test helpers

https://gerrit.wikimedia.org/r/1251287