mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
OP-3426 - added filtering of published folders from comparing
Some files or folders are dynamically created and cannot be part of comparing of published and expected folder structure. (Example is Logs in AE from DL)
This commit is contained in:
parent
f703e53651
commit
d35ea96bd0
5 changed files with 35 additions and 4 deletions
|
|
@ -37,6 +37,11 @@ class AEHostFixtures(HostFixtures):
|
|||
"""Points Maya to userSetup file from input data"""
|
||||
pass
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
# skip folder that contain "Logs", these come only from Deadline
|
||||
return ["Logs"]
|
||||
|
||||
|
||||
class AELocalPublishTestClass(AEHostFixtures, PublishTest):
|
||||
"""Testing class for local publishes."""
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ class MayaHostFixtures(HostFixtures):
|
|||
os.pathsep,
|
||||
original_pythonpath))
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
yield []
|
||||
|
||||
|
||||
class MayaLocalPublishTestClass(MayaHostFixtures, PublishTest):
|
||||
"""Testing class for local publishes."""
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ class NukeHostFixtures(HostFixtures):
|
|||
os.pathsep,
|
||||
original_nuke_path))
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
yield []
|
||||
|
||||
class NukeLocalPublishTestClass(NukeHostFixtures, PublishTest):
|
||||
"""Testing class for local publishes."""
|
||||
|
|
|
|||
|
|
@ -32,3 +32,7 @@ class PhotoshopTestClass(HostFixtures):
|
|||
def startup_scripts(self, monkeypatch_session, download_test_data):
|
||||
"""Points Maya to userSetup file from input data"""
|
||||
pass
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
yield []
|
||||
|
|
@ -9,6 +9,7 @@ import shutil
|
|||
import glob
|
||||
import platform
|
||||
import requests
|
||||
import re
|
||||
|
||||
from tests.lib.db_handler import DBHandler
|
||||
from common.openpype_common.distribution.file_handler import RemoteFileHandler
|
||||
|
|
@ -316,7 +317,8 @@ class PublishTest(ModuleUnitTest):
|
|||
yield True
|
||||
|
||||
def test_folder_structure_same(self, dbcon, publish_finished,
|
||||
download_test_data, output_folder_url):
|
||||
download_test_data, output_folder_url,
|
||||
skip_compare_folders):
|
||||
"""Check if expected and published subfolders contain same files.
|
||||
|
||||
Compares only presence, not size nor content!
|
||||
|
|
@ -334,9 +336,17 @@ class PublishTest(ModuleUnitTest):
|
|||
glob.glob(expected_dir_base + "\\**", recursive=True)
|
||||
if f != expected_dir_base and os.path.exists(f))
|
||||
|
||||
not_matched = expected.symmetric_difference(published)
|
||||
assert not not_matched, "Missing {} files".format(
|
||||
"\n".join(sorted(not_matched)))
|
||||
filtered_published = set()
|
||||
for pub_path in published:
|
||||
for val in skip_compare_folders:
|
||||
if not re.search(val, pub_path):
|
||||
filtered_published.add(pub_path)
|
||||
|
||||
not_matched = expected.symmetric_difference(filtered_published)
|
||||
if not_matched:
|
||||
self.failed = True
|
||||
raise AssertionError("Missing {} files".format(
|
||||
"\n".join(sorted(not_matched))))
|
||||
|
||||
|
||||
class DeadlinePublishTest(PublishTest):
|
||||
|
|
@ -419,3 +429,8 @@ class HostFixtures():
|
|||
def startup_scripts(self, monkeypatch_session, download_test_data):
|
||||
""""Adds init scripts (like userSetup) to expected location"""
|
||||
raise NotImplementedError
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def skip_compare_folders(self):
|
||||
"""Use list of regexs to filter out published folders from comparing"""
|
||||
raise NotImplementedError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue