mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
removed 'run_tests' command
This commit is contained in:
parent
4de0828bfa
commit
a92b77cf6b
2 changed files with 0 additions and 122 deletions
|
|
@ -183,53 +183,6 @@ def run(script):
|
|||
runpy.run_path(script, run_name="__main__", )
|
||||
|
||||
|
||||
@main_cli.command()
|
||||
@click.argument("folder", nargs=-1)
|
||||
@click.option("-m",
|
||||
"--mark",
|
||||
help="Run tests marked by",
|
||||
default=None)
|
||||
@click.option("-p",
|
||||
"--pyargs",
|
||||
help="Run tests from package",
|
||||
default=None)
|
||||
@click.option("-t",
|
||||
"--test_data_folder",
|
||||
help="Unzipped directory path of test file",
|
||||
default=None)
|
||||
@click.option("-s",
|
||||
"--persist",
|
||||
help="Persist test DB and published files after test end",
|
||||
default=None)
|
||||
@click.option("-a",
|
||||
"--app_variant",
|
||||
help="Provide specific app variant for test, empty for latest",
|
||||
default=None)
|
||||
@click.option("--app_group",
|
||||
help="Provide specific app group for test, empty for default",
|
||||
default=None)
|
||||
@click.option("-t",
|
||||
"--timeout",
|
||||
help="Provide specific timeout value for test case",
|
||||
default=None)
|
||||
@click.option("-so",
|
||||
"--setup_only",
|
||||
help="Only create dbs, do not run tests",
|
||||
default=None)
|
||||
@click.option("--mongo_url",
|
||||
help="MongoDB for testing.",
|
||||
default=None)
|
||||
@click.option("--dump_databases",
|
||||
help="Dump all databases to data folder.",
|
||||
default=None)
|
||||
def runtests(folder, mark, pyargs, test_data_folder, persist, app_variant,
|
||||
timeout, setup_only, mongo_url, app_group, dump_databases):
|
||||
"""Run all automatic tests after proper initialization via start.py"""
|
||||
Commands.run_tests(folder, mark, pyargs, test_data_folder,
|
||||
persist, app_variant, timeout, setup_only,
|
||||
mongo_url, app_group, dump_databases)
|
||||
|
||||
|
||||
@main_cli.command()
|
||||
def interactive():
|
||||
"""Interactive (Python like) console.
|
||||
|
|
|
|||
|
|
@ -171,78 +171,3 @@ class Commands:
|
|||
from ayon_core.tools.context_dialog import main
|
||||
|
||||
main(output_path, project_name, asset_name, strict)
|
||||
|
||||
@staticmethod
|
||||
def run_tests(folder, mark, pyargs,
|
||||
test_data_folder, persist, app_variant, timeout, setup_only,
|
||||
mongo_url, app_group, dump_databases):
|
||||
"""
|
||||
Runs tests from 'folder'
|
||||
|
||||
Args:
|
||||
folder (str): relative path to folder with tests
|
||||
mark (str): label to run tests marked by it (slow etc)
|
||||
pyargs (str): package path to test
|
||||
test_data_folder (str): url to unzipped folder of test data
|
||||
persist (bool): True if keep test db and published after test
|
||||
end
|
||||
app_variant (str): variant (eg 2020 for AE), empty if use
|
||||
latest installed version
|
||||
timeout (int): explicit timeout for single test
|
||||
setup_only (bool): if only preparation steps should be
|
||||
triggered, no tests (useful for debugging/development)
|
||||
mongo_url (str): url to Openpype Mongo database
|
||||
"""
|
||||
print("run_tests")
|
||||
if folder:
|
||||
folder = " ".join(list(folder))
|
||||
else:
|
||||
folder = "../tests"
|
||||
|
||||
# disable warnings and show captured stdout even if success
|
||||
args = [
|
||||
"--disable-pytest-warnings",
|
||||
"--capture=sys",
|
||||
"--print",
|
||||
"-W ignore::DeprecationWarning",
|
||||
"-rP",
|
||||
folder
|
||||
]
|
||||
|
||||
if mark:
|
||||
args.extend(["-m", mark])
|
||||
|
||||
if pyargs:
|
||||
args.extend(["--pyargs", pyargs])
|
||||
|
||||
if test_data_folder:
|
||||
args.extend(["--test_data_folder", test_data_folder])
|
||||
|
||||
if persist:
|
||||
args.extend(["--persist", persist])
|
||||
|
||||
if app_group:
|
||||
args.extend(["--app_group", app_group])
|
||||
|
||||
if app_variant:
|
||||
args.extend(["--app_variant", app_variant])
|
||||
|
||||
if timeout:
|
||||
args.extend(["--timeout", timeout])
|
||||
|
||||
if setup_only:
|
||||
args.extend(["--setup_only", setup_only])
|
||||
|
||||
if mongo_url:
|
||||
args.extend(["--mongo_url", mongo_url])
|
||||
|
||||
if dump_databases:
|
||||
msg = "dump_databases format is not recognized: {}".format(
|
||||
dump_databases
|
||||
)
|
||||
assert dump_databases in ["bson", "json"], msg
|
||||
args.extend(["--dump_databases", dump_databases])
|
||||
|
||||
print("run_tests args: {}".format(args))
|
||||
import pytest
|
||||
pytest.main(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue