mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
Bug 1553062 - Send events on Normandy recipe runner start/end r=mythmon
Differential Revision: https://phabricator.services.mozilla.com/D32006 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d3e6eadc70
commit
b02582a13a
@ -199,6 +199,7 @@ var RecipeRunner = {
|
||||
},
|
||||
|
||||
async run() {
|
||||
Services.obs.notifyObservers(null, "recipe-runner:start");
|
||||
this.clearCaches();
|
||||
// Unless lazy classification is enabled, prep the classify cache.
|
||||
if (!Services.prefs.getBoolPref(LAZY_CLASSIFY_PREF, false)) {
|
||||
@ -241,6 +242,7 @@ var RecipeRunner = {
|
||||
await actions.finalize();
|
||||
|
||||
await Uptake.reportRunner(Uptake.RUNNER_SUCCESS);
|
||||
Services.obs.notifyObservers(null, "recipe-runner:end");
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -127,6 +127,27 @@ decorate_task(
|
||||
}
|
||||
);
|
||||
|
||||
decorate_task(
|
||||
withStub(Uptake, "reportRunner"),
|
||||
withStub(RecipeRunner, "loadRecipes"),
|
||||
withStub(ActionsManager.prototype, "finalize"),
|
||||
async function testRunEvents(
|
||||
reportRunnerStub,
|
||||
loadRecipesStub,
|
||||
finalizeStub,
|
||||
) {
|
||||
loadRecipesStub.returns(Promise.resolve([]));
|
||||
const startPromise = TestUtils.topicObserved("recipe-runner:start");
|
||||
const endPromise = TestUtils.topicObserved("recipe-runner:end");
|
||||
|
||||
await RecipeRunner.run();
|
||||
|
||||
// Will timeout if notifications were not received.
|
||||
await startPromise;
|
||||
await endPromise;
|
||||
}
|
||||
);
|
||||
|
||||
decorate_task(
|
||||
withPrefEnv({
|
||||
set: [
|
||||
|
Loading…
Reference in New Issue
Block a user