Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke testing class #2364

Merged
merged 52 commits into from Dec 13, 2021
Merged

Nuke testing class #2364

merged 52 commits into from Dec 13, 2021

Conversation

kalisp
Copy link
Member

@kalisp kalisp commented Dec 2, 2021

Implemented pytest testing class for Nuke.

Pulls prepared testing zip file from GDrive, prepares temporal DBs(avalon, openpype), opens Nuke, publishes basic workfile, compares result.

(in activated {OPENPYPE_ROOT}/.venv)
{OPENPYPE_ROOT}/.venv/Scripts/python.exe {OPENPYPE_ROOT}/start.py runtests {OPENPYPE_ROOT}/tests/integration/hosts/nuke

(Contains merged PR for OP-2019- ynput/avalon-core#391)
(Contains commit with current avalon-core)

Used to differentiate between regular REMOTE_PUBLISH and automatic tests
Necessary env vars should be configured in testing zip file
It was overwriting existing value of NUKE_PATH before
Zip files now stored on OP shared GDrive

PS implementation is not working, fixed in OP-2019
Belongs to merged PR for AE testing
@kalisp kalisp self-assigned this Dec 2, 2021
@mkolar
Copy link
Member

mkolar commented Dec 2, 2021

Task linked: OP-2019 Create test publish class for AE

@mkolar
Copy link
Member

mkolar commented Dec 2, 2021

Task linked: OP-2042 nuke testing class

@kalisp kalisp requested a review from 64qam December 2, 2021 18:40
@kalisp
Copy link
Member Author

kalisp commented Dec 3, 2021

All issues after review implemented.

Mentioned -x command line flag seems not to trigger init.py, still needs some testing.

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works

@@ -100,6 +108,14 @@ def env_var(self, monkeypatch_session, download_test_data):
import openpype

openpype_root = os.path.dirname(os.path.dirname(openpype.__file__))

#reset connection to openpype DB with new env var
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block comment should start with '# '

monkeypatch_session.setenv("NUKE_PATH",
"{}{}{}".format(startup_path,
os.pathsep,
original_nuke_path))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

@@ -0,0 +1,45 @@
"""Classed and methods for comparing expected and published items in DBs"""

class DBAssert:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

@pytest.fixture(scope="module")
def startup_scripts(self, monkeypatch_session, download_test_data):
""""Adds init scripts (like userSetup) to expected location"""
raise NotImplementedError
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

@kalisp
Copy link
Member Author

kalisp commented Dec 10, 2021

Added bunch of updates:

  • new wrapper class for testing in a host - each test case in a host should extend this one
  • reworked db_asserts to run all asserts, created easier method to query
  • output folder is set in a better way
  • added test_data_folder, app_variant, persist to cli
  • fixed test db cleanup
  • fixed published folder cleanup
  • test case in Nuke finally works

@kalisp kalisp merged commit 4a32cf9 into develop Dec 13, 2021
@kalisp
Copy link
Member Author

kalisp commented Dec 13, 2021

All other features will be implemented in next PRs.

@kalisp kalisp deleted the feature/OP-2042_nuke-testing-class branch December 13, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants