提交 88cd8261 编写于 作者: C Cleber Rosa

Plugin interfaces: proposal for a better module name and location

Avocado currently does not define a set of APIs for plugin writers.
It's well understood that anyone writing plugins is really playing
under the hoods of core Avocado.

Because there's no such module namespace allocated for that purpose
alone (say, `avocado.plugin`) it was decided to put plugin interfaces
together with the "core plugin repository", that is the
"avocado/plugins" directory.  By no means the contents of
"avocado/plugins/", that is, the plugin implementations themselves,
need be the "avocado.plugins" module, it could just as well live in
"avocado-core-plugins" directory or repository.  This is also well
exemplified by the avocado-vt and avocado-virt plugins, which live in
completely separate repositories.

So, the first goal of these changes are, effectively, to make all
plugin implementations equal, always referring to
`avocado.core.plugins_interface`.  Then, the secondary goal is to pave
the way for a specific namespace to contain only the interfaces (which
should be non-core) which plugin writers should rely on.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 eb89520e
......@@ -15,10 +15,9 @@
import logging
from avocado.core import data_dir
from avocado.core.plugin_interfaces import CLICmd
from avocado.core.settings import settings
from .base import CLICmd
class Config(CLICmd):
......
......@@ -19,12 +19,11 @@ import os
import sys
from avocado.core import exit_codes
from avocado.core.plugin_interfaces import CLICmd
from avocado.utils import distro as utils_distro
from avocado.utils import path as utils_path
from avocado.utils import process
from .base import CLICmd
class SoftwarePackage(object):
......
......@@ -19,8 +19,7 @@ import os
import sys
from avocado.core import exit_codes
from .base import CLICmd
from avocado.core.plugin_interfaces import CLICmd
class ExecPath(CLICmd):
......
......@@ -14,8 +14,8 @@
"""Run tests with GDB goodies enabled."""
from .base import CLI
from avocado.core import exceptions
from avocado.core.plugin_interfaces import CLI
from avocado.core.settings import settings
from avocado.utils import gdb
from avocado.utils import process
......
......@@ -21,8 +21,7 @@ import sys
from avocado.core import exit_codes
from avocado.core.html import HTMLTestResult
from avocado.core.result import register_test_result_class
from .base import CLI
from avocado.core.plugin_interfaces import CLI
class HTML(CLI):
......
import os
import logging
from avocado.utils import process
from avocado.core.plugin_interfaces import JobPre, JobPost
from avocado.core.settings import settings
from avocado.plugins.base import JobPre, JobPost
from avocado.utils import process
CONFIG_SECTION = 'plugins.jobscripts'
......
......@@ -18,7 +18,7 @@ import os
import sqlite3
import datetime
from .base import CLI
from avocado.core.plugin_interfaces import CLI
from avocado.core.result import TestResult
from avocado.core.result import register_test_result_class
......
......@@ -17,10 +17,9 @@ JSON output module.
"""
from avocado.core.jsonresult import JSONTestResult
from avocado.core.plugin_interfaces import CLI
from avocado.core.result import register_test_result_class
from .base import CLI
class JSON(CLI):
......
......@@ -15,13 +15,13 @@
import logging
import sys
from avocado.core import exit_codes, output
from avocado.core import loader
from avocado.core import test
from avocado.core.plugin_interfaces import CLICmd
from avocado.utils import astring
from .base import CLICmd
class TestLister(object):
......
......@@ -18,10 +18,9 @@ import sys
from avocado.core import exit_codes, output
from avocado.core import multiplexer
from avocado.core import tree
from avocado.core.plugin_interfaces import CLICmd
from avocado.core.settings import settings
from .base import CLICmd
class Multiplex(CLICmd):
......
......@@ -18,10 +18,9 @@ Plugins information plugin
import logging
from avocado.core import dispatcher
from avocado.core.plugin_interfaces import CLICmd
from avocado.utils import astring
from .base import CLICmd
class Plugins(CLICmd):
......
......@@ -20,12 +20,11 @@ import sys
from avocado.core import exit_codes
from avocado.core import remoter
from avocado.core.plugin_interfaces import CLI
from avocado.core.remote import RemoteTestResult
from avocado.core.remote import RemoteTestRunner
from avocado.core.result import register_test_result_class
from .base import CLI
class Remote(CLI):
......
......@@ -17,10 +17,10 @@ import logging
import os
import sys
from .base import CLI
from avocado.core import exit_codes
from avocado.core import replay
from avocado.core import status
from avocado.core import exit_codes
from avocado.core.plugin_interfaces import CLI
from avocado.core.settings import settings
......
......@@ -24,10 +24,9 @@ from avocado.core import exit_codes
from avocado.core import job
from avocado.core import loader
from avocado.core import multiplexer
from avocado.core.plugin_interfaces import CLICmd
from avocado.core.settings import settings
from .base import CLICmd
class Run(CLICmd):
......
......@@ -15,7 +15,7 @@
System information plugin
"""
from .base import CLICmd
from avocado.core.plugin_interfaces import CLICmd
from avocado.core import sysinfo
......
......@@ -20,12 +20,11 @@ import sys
from avocado.core import exit_codes
from avocado.core import virt
from avocado.core.plugin_interfaces import CLI
from avocado.core.remote import VMTestResult
from avocado.core.remote import VMTestRunner
from avocado.core.result import register_test_result_class
from .base import CLI
class VM(CLI):
......
......@@ -17,10 +17,9 @@ import os
import sys
from avocado.core import exit_codes
from avocado.core.plugin_interfaces import CLI
from avocado.utils import process
from .base import CLI
class Wrapper(CLI):
......
......@@ -14,9 +14,9 @@
"""xUnit module."""
from avocado.core.plugin_interfaces import CLI
from avocado.core.result import register_test_result_class
from avocado.core.xunit import xUnitTestResult
from .base import CLI
class XUnit(CLI):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册