Commit 7f664cfd authored by Andrew Halberstadt's avatar Andrew Halberstadt
Browse files

Bug 1209463 - [test] Log suite names in test harnesses, r=gbrown

Suite names are currently only used by formatters to print out
an overall summary from |mach test| and |mach mochitest|. So
this doesn't need to be exact and can be tweaked further at a
later date.

If multiple test invocations have the same suite name, their
results will be merged in the overall summary. If a suite name
is missing, the summary will contain a placeholder name.

MozReview-Commit-ID: K1xpb9hUQRX

--HG--
extra : rebase_source : cc8cc8b36255d939dd5dffd3c5444c34951ac8e2
parent dbb9c29f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -451,7 +451,8 @@ function StartTests()
            var ids = g.urls.map(function(obj) {
                return obj.identifier;
            });
            logger.suiteStart(ids, {"skipped": g.urls.length - numActiveTests});
            var suite = prefs.getCharPref('reftest.suite', 'reftest');
            logger.suiteStart(ids, suite, {"skipped": g.urls.length - numActiveTests});
            g.suiteStarted = true
        }

+1 −0
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ class RefTest(object):
        prefs['reftest.focusFilterMode'] = options.focusFilterMode
        prefs['reftest.logLevel'] = options.log_tbpl_level or 'info'
        prefs['reftest.manifests'] = json.dumps(manifests)
        prefs['reftest.suite'] = options.suite

        if startAfter not in (None, self.TEST_SEEN_INITIAL, self.TEST_SEEN_FINAL):
            self.log.info("Setting reftest.startAfter to %s" % startAfter)
+1 −0
Original line number Diff line number Diff line
@@ -884,6 +884,7 @@ class BaseMarionetteTestRunner(object):
            tests_by_group[test['group']].append(test['filepath'])

        self.logger.suite_start(tests_by_group,
                                name='marionette-test',
                                version_info=self.version_info,
                                device_info=device_info)

+1 −1
Original line number Diff line number Diff line
@@ -1338,7 +1338,7 @@ toolbar#nav-bar {
    def logPreamble(self, tests):
        """Logs a suite_start message and test_start/test_end at the beginning of a run.
        """
        self.log.suite_start(self.tests_by_manifest)
        self.log.suite_start(self.tests_by_manifest, name='mochitest-{}'.format(self.flavor))
        for test in tests:
            if 'disabled' in test:
                self.log.test_start(test['path'])
+5 −1
Original line number Diff line number Diff line
@@ -96,8 +96,12 @@ StructuredLogger.prototype = {
    this._logData("assertion_count", data);
  },

  suiteStart(tests, runinfo = null, versioninfo = null, deviceinfo = null, extra = null) {
  suiteStart(tests, name = null, runinfo = null, versioninfo = null, deviceinfo = null, extra = null) {
    var data = {tests: tests.map(x => this._testId(x))};
    if (name !== null) {
      data.name = name;
    }

    if (runinfo !== null) {
      data.runinfo = runinfo;
    }
Loading