Revised Search-Test-Phase-1
authorGregg Lind <glind@mozilla.com>
Mon, 02 Dec 2013 03:13:48 -0600
changeset 1024 13d309ec5dd1
parent 1023 61962dd78abc
child 1025 0ead16c22fc4
push id855
push userglind@mozilla.com
push dateMon, 02 Dec 2013 09:13:51 +0000
Revised Search-Test-Phase-1
testcases/index.json
testcases/search-test-phase-1b/search-test-phase-1b.jar
testcases/search-test-phase-1b/search-test-phase-1b.js
--- a/testcases/index.json
+++ b/testcases/index.json
@@ -85,16 +85,24 @@
         "studyfile": "search-test-phase-1.js",
         "hash": "b1557c012758002f84b0b2cad75953816a014736b3431bf38f16c77a283c0349",
         "name": "search-test-phase-1",
         "jarfile": "search-test-phase-1/search-test-phase-1.jar"
       }
     },
     {
       "default": {
+        "studyfile": "search-test-phase-1b.js",
+        "hash": "b899df3dd0baa3a2d51cd6bbc0b00a8e171528f25cf8c500cbf8ccb31da94116",
+        "name": "search-test-phase-1b",
+        "jarfile": "search-test-phase-1b/search-test-phase-1b.jar"
+      }
+    },
+    {
+      "default": {
         "studyfile": "research_installer.js",
         "hash": "7bd8e381e08afc18e2d7b0bd28be97b341699e9dc9f8689009bce1adb719f7c4",
         "name": "Firefox Personalization Study",
         "jarfile": "up-research/research_installer-1.jar"
       }
     }
   ],
   "results": [
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3f6fb410a539db7c1719a92e2598556152c2c960
GIT binary patch
literal 2458
zc${^Xc{CJk8^(tjODR&!WJ`vjFqW}28A5}MvG1f($vO<izNU<n8D*E4^3v*M>?vE>
zcZ12A$P&re*KA+j^L^jRdrtR#?sNa~+}CwIfBuZIKoAdr{Z~Kth(H5=t3v<~z(Ctv
z6OJ*|k=<<p0Du5vEF1g&6Z3yhjQ=R+`8EF+8)zD0bhORPWejwd4cc1uv2dBLqgc3P
zM_Xr+sT^HlbkbW!&p;Yu(B=CEbSU*ZU)__(lFmpl&qTIlz&F?rmnH8-Z>E3J!!IEl
zReyP_9!O9BS32a^5N=)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C;pwh{zrAGt&fc_&Ix^Oni1_^$4rSN0P0Q|I~*Bfv5&#g;)8a
z1Ji9S6KISD2}>}rVF_NdQ}$yO@wD_xWlkc`{H<!8=^m%>itan>`Y~lGc9_TB3tU-W
zJx_6}mJW6^PQg!0b*JQRISi0bi}S19!(1Pe2sD0e*hC{+k)rOFl`**FOI01tJBQWX
zz+cQu!8Q-7s!uaX&t`nB9J7~Tp{*y>RU&e)9NSK|Q&N0;*#@}8%N$$-h?YMN_?!`m
z_gX2ewX>G5eN&H0qUQ9!pU1{IpQZJdti)3y)M5p_`@SOOBC69`Fs15HxA=^izPV&f
zeTqUApY3WN+KCF%JB#8o|IXR6muq@<9HJz@Q=nGHTd)=Kpp)Imoct~&>g|$6)-Bi|
zZh|?KVw1-i>3}DC^@EU#ZY2Z0pDX#t)CSwtw=JlZWHjFIDP+y@#|{(%#0#gNNt*lV
za^Yb*`ds%7Xxmh-_!G5b0||2N9UohIadWGT7s<AM9+Qy2=+4_*`xsEikxs2)0{|Gu
z_A!8onFnwXL;eRS`wVli4iL@1rN7e!&jFd*A9&_>hkXk9{bP^=4&{Gl5@Re2>;4Jw
NSJ(X7HUB`?e*ldsL7M;o
new file mode 100644
--- /dev/null
+++ b/testcases/search-test-phase-1b/search-test-phase-1b.js
@@ -0,0 +1,129 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*jshint forin:true, noarg:false, noempty:true, eqeqeq:true, bitwise:true,
+  strict:true, undef:true, curly:false, browser:true,
+  unused:true,
+  indent:2, maxerr:50, devel:true, node:true, boss:true, white:true,
+  globalstrict:true, nomen:false, newcap:true, moz: true */
+
+/*global */
+
+BaseClasses = require("study_base_classes.js");
+
+// Configure throttling
+const LOCALE_REGEX = "(en-us|de)";
+
+const RANDOM_DEPLOY_PREFIX = "extensions.testpilot.deploymentRandomizer";
+const RANDOM = "up-research";
+// Configure the Installer
+const ADDON_ID = "search-test-phase-1@mozilla.com";
+const ADDON_URL = "https://testpilot.mozillalabs.com/addons/search-test-phase-1.xpi"; //CHANGE TO PROPER HOST
+
+let modules = {};
+Cu.import("resource://gre/modules/AddonManager.jsm", modules);
+Cu.import("resource://gre/modules/Services.jsm", modules);
+let {AddonManager, Services} = modules;
+
+exports.experimentInfo = {
+  testId: "search-test-phase-1b@mozilla.com",
+  testName: "Firefox Search UI Study",
+  testInfoUrl: "https://testpilot.mozillalabs.com/testcases/search-test-phase-1/README.html", //CHANGE TO INFO PAGE
+  summary: "An experiment to understand Firefox UI search element usage.",
+  versionNumber: 1,
+  duration: 1, //CHANGE TO NUMBER OF DESIRED DAYS
+  minTPVersion: "1.2.3",
+  minFXVersion: "23.0", //must have fhr!!!
+  optInRequired: false,
+
+  /* we need lots and lots of germans!  only have 93k in TP. */
+  randomDeployment: {
+    minRoll: 0,
+    maxRoll: 100,
+    rolloutCode: RANDOM, //don't overlap with their rollouts, which were 90-91. extra safeguard against mutex
+  },
+
+  runOrNotFunc: function () {
+    // Only run if there's no other study running
+    if (studyMutex.checkConflicted(ADDON_ID)) {
+      return false;
+    }
+
+    // Target appropriate locale
+    let locale = Services.prefs.getCharPref("general.useragent.locale");
+    if (!new RegExp("^" + LOCALE_REGEX, "i").test(locale)) {
+      return false;
+    }
+
+    let rd = Services.prefs.getCharPref(RANDOM_DEPLOY_PREFIX + '.' + RANDOM);
+    dump("random deploy is: " + 1 * rd + "\n");
+    dump("locale is: " + locale + '\n' );
+
+    let good = false;
+    if (locale.toLowerCase().search('de') === 0) {
+      good = (0 <= rd && rd <= 20);  // 30%, smaller sample in DE
+    } else {
+      good = (5 <= rd && rd <= 10); // random deploy, 5 additional! %
+    }
+
+    dump(rd + " is good? " + good + " locale: " + locale + "\n");
+
+    // Must be good to run
+    return good;
+  },
+
+  // Wrap runOrNotFunc for newer versions of Test Pilot
+  filter: function (cb) {
+    cb(exports.experimentInfo.runOrNotFunc());
+  },
+};
+
+// Prepare to check and claim the study mutex
+let studyMutex = new BaseClasses.CurrentStudyMutex(ADDON_ID);
+
+// Define a data store as empty as possible
+exports.dataStoreInfo = {
+  fileName: "testpilot_" + exports.experimentInfo.testId + "_empty.sqlite",
+  tableName: "empty",
+  columns: [{
+    property: "empty",
+    type: BaseClasses.TYPE_STRING,
+    displayName: "empty"
+  }]
+};
+
+// Define a handler that just installs an add-on
+function Installer() Installer.baseConstructor.call(this, null)
+BaseClasses.extend(Installer, BaseClasses.GenericGlobalObserver);
+exports.handlers = new Installer();
+Installer.prototype.onExperimentStartup = function (store) {
+  Installer.superClass.onExperimentStartup.call(this, store);
+
+  // Claim the current study
+  studyMutex.claimExclusive(ADDON_ID);
+
+  // Don't use BaseClasses.AddonController, which has different
+  // assumptions!
+  AddonManager.getAllAddons(function (addons) {
+    let installed = false;
+    addons.forEach(function ({id}) {
+      // Remember that it was already installed
+      if (id === ADDON_ID) installed = true;
+    });
+    if (!installed) {
+      AddonManager.getInstallForURL(ADDON_URL, function (install) {
+        install.install();
+      }, "application/x-xpinstall");
+    }
+  });
+};
+
+// Define an empty web content as there's no data to show
+function NoData() NoData.baseConstructor.call(this, exports.experimentInfo)
+BaseClasses.extend(NoData, BaseClasses.GenericWebContent);
+NoData.prototype.__defineGetter__("dataCanvas", function () "");
+exports.webContent = new NoData();
+
+
+