diff --git a/tests/integration/hosts/maya/test_publish_in_maya.py b/tests/integration/hosts/maya/test_publish_in_maya.py index b53b26f66d..687e6fbc6e 100644 --- a/tests/integration/hosts/maya/test_publish_in_maya.py +++ b/tests/integration/hosts/maya/test_publish_in_maya.py @@ -26,16 +26,15 @@ class TestPublishInMaya(PublishTest): {OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/maya # noqa: E501 """ - PERSIST = True + PERSIST = False TEST_FILES = [ ("1BTSIIULJTuDc8VvXseuiJV_fL6-Bu7FP", "test_maya_publish.zip", "") ] APP = "maya" - APP_VARIANT = "2019" - - APP_NAME = "{}/{}".format(APP, APP_VARIANT) + # keep empty to locate latest installed variant or explicit + APP_VARIANT = "" TIMEOUT = 120 # publish timeout diff --git a/tests/integration/hosts/nuke/test_publish_in_nuke.py b/tests/integration/hosts/nuke/test_publish_in_nuke.py index 483e9fef98..14a79fdf3d 100644 --- a/tests/integration/hosts/nuke/test_publish_in_nuke.py +++ b/tests/integration/hosts/nuke/test_publish_in_nuke.py @@ -32,9 +32,8 @@ class TestPublishInNuke(PublishTest): ] APP = "nuke" - APP_VARIANT = "12-2" - - APP_NAME = "{}/{}".format(APP, APP_VARIANT) + # keep empty to locate latest installed variant or explicit + APP_VARIANT = "" TIMEOUT = 120 # publish timeout diff --git a/tests/integration/hosts/photoshop/test_publish_in_photoshop.py b/tests/integration/hosts/photoshop/test_publish_in_photoshop.py index 43e03b2cc3..c7f2399494 100644 --- a/tests/integration/hosts/photoshop/test_publish_in_photoshop.py +++ b/tests/integration/hosts/photoshop/test_publish_in_photoshop.py @@ -24,16 +24,15 @@ class TestPublishInPhotoshop(PublishTest): {OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests ../tests/integration/hosts/photoshop # noqa: E501 """ - PERSIST = True + PERSIST = False TEST_FILES = [ ("1zD2v5cBgkyOm_xIgKz3WKn8aFB_j8qC-", "test_photoshop_publish.zip", "") ] APP = "photoshop" - APP_VARIANT = "2021" - - APP_NAME = "{}/{}".format(APP, APP_VARIANT) + # keep empty to locate latest installed variant or explicit + APP_VARIANT = "" TIMEOUT = 120 # publish timeout diff --git a/tests/lib/testing_classes.py b/tests/lib/testing_classes.py index aa8ef3caab..bf1c490ecd 100644 --- a/tests/lib/testing_classes.py +++ b/tests/lib/testing_classes.py @@ -11,6 +11,8 @@ import glob from tests.lib.db_handler import DBHandler from tests.lib.file_handler import RemoteFileHandler +from openpype.lib.remote_publish import find_variant_key + class BaseTest: """Empty base test class""" @@ -173,12 +175,15 @@ class PublishTest(ModuleUnitTest): """ APP = "" - APP_VARIANT = "" - - APP_NAME = "{}/{}".format(APP, APP_VARIANT) + APP_VARIANT = "" # keep empty to locate latest installed variant TIMEOUT = 120 # publish timeout + @property + def app_name(self): + if self.APP_VARIANT: + return "{}/{}".format(self.APP, self.APP_VARIANT) + @pytest.fixture(scope="module") def last_workfile_path(self, download_test_data): raise NotImplementedError @@ -224,7 +229,13 @@ class PublishTest(ModuleUnitTest): "task_name": self.TASK } - yield application_manager.launch(self.APP_NAME, **data) + variant = self.APP_VARIANT + if not variant: + variant = find_variant_key(application_manager, self.APP) + + app_name = "{}/{}".format(self.APP, variant) + + yield application_manager.launch(app_name, **data) @pytest.fixture(scope="module") def publish_finished(self, dbcon, launched_app, download_test_data):