diff --git a/shepherd/agent/core.py b/shepherd/agent/core.py index f03bb1f..1ab2b1b 100644 --- a/shepherd/agent/core.py +++ b/shepherd/agent/core.py @@ -21,7 +21,7 @@ from . import control chromalog.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) -log = logging.getLogger("shepherd-agent") +log = logging.getLogger("shepherd.agent") @click.group(invoke_without_command=True) @@ -41,7 +41,7 @@ def cli(ctx, default_config_path, local_operation, only_default_layer): ending with ".toml" will be used. """ version_text = pkg_resources.get_distribution("shepherd") - log.info(F"Shepherd Agent {version_text}") + log.info(F"Shepherd Agent [{version_text}]") if ctx.invoked_subcommand == "template": return diff --git a/tests/simpletestplugin.py b/tests/simpletestplugin.py new file mode 100644 index 0000000..ae4c9cf --- /dev/null +++ b/tests/simpletestplugin.py @@ -0,0 +1,12 @@ +from configspec import * +from shepherd import PluginInterface + +interface = PluginInterface() + +confspec = ConfigSpecification() +confspec.add_spec("spec1", StringSpec()) + +confspec2 = ConfigSpecification() +confspec2.add_spec("spec2", StringSpec()) + +interface.register_confspec(confspec2) diff --git a/tests/test_plugins.py b/tests/test_plugins.py new file mode 100644 index 0000000..998e0e8 --- /dev/null +++ b/tests/test_plugins.py @@ -0,0 +1,11 @@ +import pytest +from shepherd.agent import plugin + + +def test_simple_plugin_load(request): + # If successful, will load as if it's a custom plugin + interface = plugin.load_plugin("simpletestplugin", request.fspath.dirname) + + # Should prefer the confspec actually registered + assert "spec2" in interface.confspec.spec_dict + print(interface)