Skip to content

Commit 284443c

Browse files
committed
IMP: add test-deployment command
1 parent 6fb6bc4 commit 284443c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

q2cli/builtin/dev.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,33 @@ def refresh_cache():
3434
q2cli.core.cache.CACHE.refresh()
3535

3636

37+
@dev.command(name='test-deployment',
38+
short_help='Test deployed QIIME 2 packages and plugins.',
39+
help="Run the discoverable unit tests for all currently "
40+
"deployed QIIME 2 packages and plugins.",
41+
cls=ToolCommand)
42+
def test_deployment():
43+
# TODO: Allow user to pass specific targets on the cli (this would
44+
# override internal determination of targets).
45+
# TODO: Allow user to specify targets to skip on the cli (this would
46+
# subtract from internally determined targets).
47+
# TODO: Allow user to list the targets but not run the tests.
48+
import pytest
49+
import q2cli.util
50+
51+
targets = {'qiime2', 'q2cli', 'q2templates'}
52+
pm = q2cli.util.get_plugin_manager()
53+
for plugin in pm.plugins.values():
54+
targets.add(plugin.project_name)
55+
# for target in targets:
56+
# click.echo(target)
57+
58+
for target in targets:
59+
click.echo(f"Testing target: {target}")
60+
pytest.main(['--pyargs', target])
61+
62+
63+
3764
import_theme_help = \
3865
("Allows for customization of q2cli's command line styling based on an "
3966
"imported .theme (INI formatted) file. If you are unfamiliar with .ini "

0 commit comments

Comments
 (0)