Commit 51c3d84a authored by Dave Hunt's avatar Dave Hunt
Browse files

Bug 919923 - Create a section in the HTML report with build details. r=jgriffin

parent 431c6c3d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -471,6 +471,10 @@ class BaseMarionetteOptions(OptionParser):
                        dest='this_chunk',
                        type=int,
                        help='which chunk to run')
        self.add_option('--sources',
                        dest='sources',
                        action='store',
                        help='path to sources.xml (Firefox OS only)')

    def parse_args(self, args=None, values=None):
        options, tests = OptionParser.parse_args(self, args, values)
@@ -541,7 +545,7 @@ class BaseMarionetteTestRunner(object):
                 logcat_dir=None, xml_output=None, repeat=0, gecko_path=None,
                 testvars=None, tree=None, type=None, device_serial=None,
                 symbols_path=None, timeout=None, es_servers=None, shuffle=False,
                 sdcard=None, this_chunk=1, total_chunks=1, **kwargs):
                 sdcard=None, this_chunk=1, total_chunks=1, sources=None, **kwargs):
        self.address = address
        self.emulator = emulator
        self.emulatorBinary = emulatorBinary
@@ -576,6 +580,7 @@ class BaseMarionetteTestRunner(object):
        self.es_servers = es_servers
        self.shuffle = shuffle
        self.sdcard = sdcard
        self.sources = sources
        self.this_chunk = this_chunk
        self.total_chunks = total_chunks
        self.mixin_run_tests = []
+39 −0
Original line number Diff line number Diff line
@@ -9,7 +9,9 @@ import json
import os
import pkg_resources
import sys
import time

import mozversion
from xmlgen import html
from xmlgen import raw

@@ -131,6 +133,39 @@ class HTMLReportingTestRunnerMixin(object):
            _extract_html_from_skipped_manifest_test(test)

        generated = datetime.datetime.now()
        version = mozversion.get_version(
            binary=self.bin, sources=self.sources,
            dm_type=os.environ.get('DM_TRANS', 'adb'))
        date_format = '%d %b %Y %H:%M:%S'

        configuration = {
            'Gecko version': version.get('application_version'),
            'Gecko build': version.get('application_buildid'),
            'Gecko revision': version.get('application_revision'),
            'Gaia date': version.get('gaia_date') and
            time.strftime(date_format, time.localtime(
                int(version.get('gaia_date')))),
            'Device identifier': version.get('device_id'),
            'Device firmware (date)': version.get('device_firmware_date') and
            time.strftime(date_format, time.localtime(
                int(version.get('device_firmware_date')))),
            'Device firmware (incremental)': version.get('device_firmware_version_incremental'),
            'Device firmware (release)': version.get('device_firmware_version_release'),
        }

        if version.get('application_changeset') and version.get('application_repository'):
            configuration['Gecko revision'] = html.a(
                version.get('application_changeset'),
                href='/'.join([version.get('application_repository'),
                               version.get('application_changeset')]),
                target='_blank')

        if version.get('gaia_changeset'):
            configuration['Gaia revision'] = html.a(
                version.get('gaia_changeset')[:12],
                href='https://github.com/mozilla-b2g/gaia/commit/%s' % version.get('gaia_changeset'),
                target='_blank')

        doc = html.html(
            html.head(
                html.meta(charset='utf-8'),
@@ -150,6 +185,10 @@ class HTMLReportingTestRunnerMixin(object):
                    generated.strftime('%d-%b-%Y'),
                    generated.strftime('%H:%M:%S'),
                    self.html_name, self.html_version)),
                html.h2('Configuration'),
                html.table(
                    [html.tr(html.td(k), html.td(v)) for k, v in sorted(configuration.items()) if v],
                    id='configuration'),
                html.h2('Summary'),
                html.p('%i tests ran in %i seconds.' % (tests, test_time),
                       html.br(),
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ table {
 * SUMMARY INFORMATION
 ******************************/

#configuration {
	font-size: 12px;
}

#configuration td {
	padding: 5px;
	border: 1px solid #E6E6E6;
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ moznetwork >= 0.21
mozcrash >= 0.5
mozprofile >= 0.7
moztest >= 0.1
mozversion >= 0.2