提交 88e617d0 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #429 from ruda/drop_features_gracefully

Drop features HTML Report and Multiplexer gracefully.
......@@ -37,12 +37,17 @@ import collections
import os
import re
import yaml
try:
from yaml import CLoader as Loader
import yaml
except ImportError:
MULTIPLEX_CAPABLE = False
else:
MULTIPLEX_CAPABLE = True
if MULTIPLEX_CAPABLE:
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
......
......@@ -40,14 +40,9 @@ from avocado.plugins import jsonresult
from avocado.plugins import xunit
from avocado.utils import archive
from avocado.utils import path
from avocado.plugins import htmlresult
try:
from avocado.plugins import htmlresult
HTML_REPORT_SUPPORT = True
except ImportError:
HTML_REPORT_SUPPORT = False
HTML_REPORT_SUPPORT = htmlresult.HTML_REPORT_CAPABLE
_NEW_ISSUE_LINK = 'https://github.com/avocado-framework/avocado/issues/new'
......@@ -87,6 +82,7 @@ class Job(object):
self.loglevel = mapping[raw_log_level]
else:
self.loglevel = logging.DEBUG
if multiplexer.MULTIPLEX_CAPABLE:
self.multiplex_files = args.multiplex_files
self.show_job_log = args.show_job_log
self.silent = args.silent
......@@ -273,6 +269,7 @@ class Job(object):
params_list = self.test_loader.discover_urls(urls)
if multiplexer.MULTIPLEX_CAPABLE:
if multiplex_files is None:
if self.args and self.args.multiplex_files is not None:
multiplex_files = self.args.multiplex_files
......
......@@ -23,6 +23,8 @@ import itertools
from avocado.core import tree
MULTIPLEX_CAPABLE = tree.MULTIPLEX_CAPABLE
def tree2pools(node, mux=True):
"""
......
......@@ -21,7 +21,12 @@ import sys
import time
import webbrowser
import pystache
try:
import pystache
except ImportError:
HTML_REPORT_CAPABLE = False
else:
HTML_REPORT_CAPABLE = True
from avocado import runtime
from avocado.core import exit_codes
......@@ -248,6 +253,9 @@ class HTML(plugin.Plugin):
enabled = True
def configure(self, parser):
if HTML_REPORT_CAPABLE is False:
self.enabled = False
return
self.parser = parser
self.parser.runner.add_argument(
'--html', type=str,
......
......@@ -32,6 +32,9 @@ class Multiplexer(plugin.Plugin):
enabled = True
def configure(self, parser):
if multiplexer.MULTIPLEX_CAPABLE is False:
self.enabled = False
return
self.parser = parser.subcommands.add_parser(
'multiplex',
help='Generate a list of dictionaries with params from a multiplex file')
......
......@@ -23,6 +23,7 @@ from avocado.core import exit_codes
from avocado.plugins import plugin
from avocado.core import output
from avocado import job
from avocado import multiplexer
class TestRunner(plugin.Plugin):
......@@ -107,6 +108,7 @@ class TestRunner(plugin.Plugin):
'present for the test. '
'Current: False (output check enabled)'))
if multiplexer.MULTIPLEX_CAPABLE:
mux = self.parser.add_argument_group('multiplex arguments')
mux.add_argument('-m', '--multiplex-files', nargs='*', default=None,
help='Path(s) to a avocado multiplex (.yaml) file(s)')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册