Commit 82ed8f6e authored by Charlie Humphreys's avatar Charlie Humphreys Committed by chumphreys@mozilla.com
Browse files

Bug 1965312: enable nimbus enrollment_status telemetry. r=nimbus-reviewers,beth

parent b3c536ac
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -998,7 +998,6 @@ nimbus_events:
      - chumphreys@mozilla.com
      - project-nimbus@mozilla.com
    expires: never
    disabled: true

  migration:
    type: event
+6 −16
Original line number Diff line number Diff line
@@ -316,14 +316,6 @@ add_task(async function test_failure_name_conflict() {

  sandbox.spy(NimbusTelemetry, "recordEnrollmentFailure");

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  // Check that there aren't any Glean enroll_failed events yet
  Assert.equal(
    Glean.nimbusEvents.enrollFailed.testGetValue("events"),
@@ -694,14 +686,6 @@ add_task(async function test_forceEnroll_cleanup() {

  await manager.enroll(existingRecipe, "test_forceEnroll_cleanup");

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  sandbox.spy(NimbusTelemetry, "setExperimentActive");
  manager.forceEnroll(forcedRecipe, forcedRecipe.branches[0]);

@@ -710,6 +694,12 @@ add_task(async function test_forceEnroll_cleanup() {
      .testGetValue("events")
      ?.map(ev => ev.extra),
    [
      {
        slug: "foo",
        branch: "treatment",
        reason: "Qualified",
        status: "Enrolled",
      },
      {
        slug: "foo",
        branch: "treatment",
+0 −7
Original line number Diff line number Diff line
@@ -1702,13 +1702,6 @@ add_task(async function test_prefChange() {
    expectedUser = null,
  }) {
    Services.fog.testResetFOG();
    Services.fog.applyServerKnobsConfig(
      JSON.stringify({
        metrics_enabled: {
          "nimbus_events.enrollment_status": true,
        },
      })
    );
    Services.telemetry.snapshotEvents(
      Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
      /* clear = */ true
+14 −18
Original line number Diff line number Diff line
@@ -339,14 +339,6 @@ add_task(async function test_unenroll_individualOptOut_statusTelemetry() {
    })
  );

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  manager.unenroll("foo", { reason: "individual-opt-out" });

  Assert.deepEqual(
@@ -355,10 +347,16 @@ add_task(async function test_unenroll_individualOptOut_statusTelemetry() {
      ?.map(ev => ev.extra),
    [
      {
        status: "Enrolled",
        reason: "Qualified",
        slug: "foo",
        branch: "control",
        status: "Disqualified",
      },
      {
        branch: "control",
        reason: "OptOut",
        status: "Disqualified",
        slug: "foo",
      },
    ]
  );
@@ -377,14 +375,6 @@ add_task(async function testUnenrollBogusReason() {

  Assert.ok(manager.store.get("bogus").active, "Enrollment active");

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  manager.unenroll("bogus", "bogus");

  Assert.deepEqual(
@@ -393,11 +383,17 @@ add_task(async function testUnenrollBogusReason() {
      ?.map(ev => ev.extra),
    [
      {
        slug: "bogus",
        branch: "control",
        status: "Enrolled",
        reason: "Qualified",
        slug: "bogus",
      },
      {
        status: "Disqualified",
        slug: "bogus",
        reason: "Error",
        error_string: "unknown",
        branch: "control",
      },
    ]
  );
+13 −17
Original line number Diff line number Diff line
@@ -111,14 +111,6 @@ add_task(async function test_enroll() {

  const labs = await FirefoxLabs.create();

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  await Assert.rejects(
    labs.enroll(),
    /enroll: slug and branchSlug are required/,
@@ -254,14 +246,6 @@ add_task(async function test_unenroll() {
  await labs.enroll("opt-in", "control");
  Assert.ok(manager.store.get("opt-in")?.active, "Enrolled in opt-in");

  Services.fog.applyServerKnobsConfig(
    JSON.stringify({
      metrics_enabled: {
        "nimbus_events.enrollment_status": true,
      },
    })
  );

  // Should not throw.
  labs.unenroll("bogus");

@@ -284,10 +268,22 @@ add_task(async function test_unenroll() {
      ?.map(ev => ev.extra),
    [
      {
        branch: "control",
        status: "Enrolled",
        slug: "rollout",
        reason: "Qualified",
      },
      {
        status: "Enrolled",
        slug: "opt-in",
        reason: "OptIn",
        branch: "control",
      },
      {
        branch: "control",
        status: "Disqualified",
        reason: "OptOut",
        slug: "opt-in",
        status: "Disqualified",
      },
    ]
  );
Loading