Bug 1332760 - Run mozscreenshots on non-Nightly mozilla-central builds. r=bgrins
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 20 Jan 2017 15:45:34 -0800
changeset 330443 4ab72b5b2cbddb06685410b23e4397bd407d3669
parent 330442 6c6ecff45a92f07925d9fae12681f2a143efd392
child 330444 43f6ae2d0847b15fd9e37752926c5663119c293b
push id85974
push usermozilla@noorenberghe.ca
push dateSat, 21 Jan 2017 00:20:01 +0000
treeherdermozilla-inbound@43f6ae2d0847 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1332760
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1332760 - Run mozscreenshots on non-Nightly mozilla-central builds. r=bgrins MozReview-Commit-ID: LYTRFgYD4Bm
browser/tools/mozscreenshots/head.js
--- a/browser/tools/mozscreenshots/head.js
+++ b/browser/tools/mozscreenshots/head.js
@@ -29,27 +29,36 @@ function* setup() {
       isnot(aAddon, null, "The mozscreenshots extension should be installed");
       AddonWatcher.ignoreAddonPermanently(aAddon.id);
       TestRunner = Cu.import("chrome://mozscreenshots/content/TestRunner.jsm", {}).TestRunner;
       resolve();
     });
   });
 }
 
+/**
+ * Used by pre-defined sets of configurations to decide whether to run for a build.
+ * @note This is not used by browser_screenshots.js which handles when MOZSCREENSHOTS_SETS is set.
+ * @return {bool} whether to capture screenshots.
+ */
 function shouldCapture() {
-  // Try pushes only capture in browser_screenshots.js with MOZSCREENSHOTS_SETS.
   if (env.get("MOZSCREENSHOTS_SETS")) {
     ok(true, "MOZSCREENSHOTS_SETS was specified so only capture what was " +
        "requested (in browser_screenshots.js)");
     return false;
   }
 
-  // Automation isn't able to schedule test jobs to only run on nightlies so we handle it here
-  // (see also: bug 1116275).
-  let capture = AppConstants.MOZ_UPDATE_CHANNEL == "nightly" ||
-                AppConstants.SOURCE_REVISION_URL == "";
+  if (AppConstants.MOZ_UPDATE_CHANNEL == "nightly") {
+    ok(true, "Screenshots aren't captured on Nightlies");
+    return false;
+  }
+
+  // Don't run pre-defined sets (e.g. primaryUI) on try, require MOZSCREENSHOTS_SETS.
+  // The job is only scheduled on specific repos:
+  // https://dxr.mozilla.org/build-central/search?q=MOCHITEST_BC_SCREENSHOTS
+  let capture = !AppConstants.SOURCE_REVISION_URL.includes("/try/rev/");
   if (!capture) {
-    ok(true, "Capturing is disabled for this MOZ_UPDATE_CHANNEL or REPO");
+    ok(true, "Capturing is disabled for this REPO. You may need to use MOZSCREENSHOTS_SETS");
   }
   return capture;
 }
 
 add_task(setup);