コード例 #1
0
def setup_logging(log_f):
    global logger
    logger = structuredlog.StructuredLogger("firefox-os-cert-suite")
    logger.add_handler(stdio_handler)
    logger.add_handler(
        handlers.StreamHandler(log_f, formatters.JSONFormatter()))
    set_default_logger(logger)
コード例 #2
0
ファイル: harness.py プロジェクト: JJTC-PX/fxos-certsuite
def setup_logging(log_f):
    global logger
    logger = structuredlog.StructuredLogger("firefox-os-cert-suite")
    logger.add_handler(stdio_handler)
    logger.add_handler(handlers.StreamHandler(log_f,
                                              formatters.JSONFormatter()))
    set_default_logger(logger)
コード例 #3
0
ファイル: main.py プロジェクト: joridos/mozregression
def main():
    set_default_logger(StructuredLogger('mozregression-gui'))
    # Create a Qt application

    argv = [sys.argv[0].replace("main.py", "mozregression")] + sys.argv[1:]
    app = QApplication(argv)
    app.setOrganizationName('mozilla')
    app.setOrganizationDomain('mozilla.org')
    app.setApplicationName('mozregression-gui')
    # Create the main window and show it
    win = MainWindow()
    app.aboutToQuit.connect(win.bisect_runner.stop)
    app.aboutToQuit.connect(win.clear)
    win.show()
    win.start_bisection_wizard()
    # Enter Qt application main loop
    sys.exit(app.exec_())
コード例 #4
0
ファイル: test_testloader.py プロジェクト: jeffcarp/wptrunner
# 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/.

from __future__ import unicode_literals

import os
import sys
import tempfile

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

from mozlog import structured
from wptrunner.testloader import TestFilter as Filter
from .test_chunker import make_mock_manifest

structured.set_default_logger(
    structured.structuredlog.StructuredLogger("TestLoader"))

include_ini = """\
skip: true
[test_\u53F0]
  skip: false
"""


def test_filter_unicode():
    tests = make_mock_manifest(("a", 10), ("a/b", 10), ("c", 10))

    with tempfile.NamedTemporaryFile("wb", suffix=".ini") as f:
        f.write(include_ini.encode('utf-8'))
        f.flush()
コード例 #5
0
ファイル: __init__.py プロジェクト: KwanEsq/mozregression
from __future__ import absolute_import

from mozlog.structured import set_default_logger
from mozlog.structured.structuredlog import StructuredLogger

set_default_logger(StructuredLogger("mozregression.tests.unit"))
コード例 #6
0
# 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/.

import unittest
import sys
from os.path import join, dirname
from mozlog import structured

import pytest

sys.path.insert(0, join(dirname(__file__), "..", ".."))

from wptrunner.testloader import EqualTimeChunker

structured.set_default_logger(
    structured.structuredlog.StructuredLogger("TestChunker"))


class MockTest(object):
    def __init__(self, id, timeout=10):
        self.id = id
        self.item_type = "testharness"
        self.timeout = timeout


def make_mock_manifest(*items):
    rv = []
    for test_type, dir_path, num_tests in items:
        for i in range(num_tests):
            rv.append(
                (test_type, dir_path + "/%i.test" % i, set([MockTest(i)])))
コード例 #7
0
# 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/.

from __future__ import unicode_literals

import os
import sys
import tempfile

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

from mozlog import structured
from wptrunner.testloader import TestFilter as Filter
from .test_chunker import make_mock_manifest

structured.set_default_logger(structured.structuredlog.StructuredLogger("TestLoader"))

include_ini = """\
skip: true
[test_\u53F0]
  skip: false
"""

def test_filter_unicode():
    tests = make_mock_manifest(("a", 10), ("a/b", 10), ("c", 10))

    with tempfile.NamedTemporaryFile("wb", suffix=".ini") as f:
        f.write(include_ini.encode('utf-8'))
        f.flush()

        Filter(manifest_path=f.name, test_manifests=tests)
コード例 #8
0
ファイル: test_chunker.py プロジェクト: EdgarChen/servo
import unittest
import sys
from os.path import join, dirname
from mozlog import structured

import pytest

sys.path.insert(0, join(dirname(__file__), "..", ".."))

from wptrunner.testloader import EqualTimeChunker

structured.set_default_logger(structured.structuredlog.StructuredLogger("TestChunker"))

class MockTest(object):
    default_timeout = 10

    def __init__(self, id, timeout=10):
        self.id = id
        self.item_type = "testharness"
        self.timeout = timeout


def make_mock_manifest(*items):
    rv = []
    for test_type, dir_path, num_tests in items:
        for i in range(num_tests):
            rv.append((test_type,
                       dir_path + "/%i.test" % i,
                       set([MockTest(i)])))
    return rv
コード例 #9
0
ファイル: main.py プロジェクト: dangerouspython/mozregression
        # clear the report model
        model = self.ui.report_view.model()
        model.attach_bisector(None)
        model.clear()
        # clear the build info main panel
        self.ui.build_info_browser.clear()

    @Slot()
    def show_about(self):
        QMessageBox.about(self, "About", ABOUT_TEXT)

    @Slot()
    def edit_global_prefs(self):
        change_prefs_dialog(self)


if __name__ == '__main__':
    set_default_logger(StructuredLogger('mozregression-gui'))
    # Create a Qt application
    app = QApplication(sys.argv)
    app.setOrganizationName('mozilla')
    app.setOrganizationDomain('mozilla.org')
    app.setApplicationName('mozregression-gui')
    # Create the main window and show it
    win = MainWindow()
    app.aboutToQuit.connect(win.bisect_runner.stop)
    win.show()
    win.start_bisection_wizard()
    # Enter Qt application main loop
    sys.exit(app.exec_())
コード例 #10
0
ファイル: __init__.py プロジェクト: EricRahm/mozregression
from mozlog.structured import set_default_logger
from mozlog.structured.structuredlog import StructuredLogger

set_default_logger(StructuredLogger('mozregression.tests.unit'))