We now copy all existing enrollments to the NimbusEnrollments table during a migration after the ExperimentStore is initialized but before we initialize the `ExperimentManager` (i.e., call `onStartup()`). This migration has to happen at this very specific point because calling `ExperimentManager.onStartup()` will process any existing enrollments and may cause unenrollments. This patch does not add support for updating enrollments in the database (see the next patch in this series), but for that to happen, the enrollments must already exist in the database. `NimbusTestUtils.factories.recipe()` now returns more realistic recipes (with properties being `null` instead of missing). This surfaced a minor bug in the `EnrollmentsContext` validation flow when validation was disabled and the recipe had localizations, but this should never have been a problem in reality because validation is always enabled in practice. Because Nimbus is used in so many xpcshell tests and it is currently cumbersome to enable the ProfileDatastoreService in every one of those tests, writing to the new database is controlled by the `nimbus.profiledatastoreservice.enabled` pref, which is true by default but false in xpcshell tests. Original Revision: https://phabricator.services.mozilla.com/D249467 Differential Revision: https://phabricator.services.mozilla.com/D251910
Common testing tools for mozilla codebase projects, test suite definitions for automated test runs, tests that don't fit anywhere else, and other fun stuff