Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com>
  • Loading branch information
agerveshi committed Sep 19, 2023
1 parent e898769 commit ce6d393
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ assetReferences:
- /normalized/job/bundle/dir/ocio.nk
outputs:
directories:
- output
- /normalized/cwd/output
referencedPaths: []
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
parameterValues:
- name: deadline:priority
value: 50
- name: deadline:targetTaskRunStatus
value: READY
- name: deadline:maxFailedTasksCount
value: 100
- name: deadline:maxRetriesPerTask
value: 5
- name: Frames
value: 1-100
- name: NukeScriptFile
value: /normalized/job/bundle/dir/ocio.nk
- name: ProxyMode
value: 'false'
- name: NukeVersion
value: 14.0v5
- name: RezPackages
value: nuke-13 deadline_cloud_for_nuke
- name: deadline:targetTaskRunStatus
value: READY
- name: deadline:maxFailedTasksCount
value: 20
- name: deadline:maxRetriesPerTask
value: 5
- name: deadline:priority
value: 50
14 changes: 0 additions & 14 deletions job_bundle_output_tests/ocio/expected_job_bundle/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,6 @@ parameterDefinitions:
allowedValues:
- 'true'
- 'false'
- name: NukeVersion
type: STRING
userInterface:
control: LINE_EDIT
label: Nuke Version
description: The version of Nuke.
- name: RezPackages
type: STRING
userInterface:
control: LINE_EDIT
label: Rez Packages
description: A space-separated list of Rez packages to install
default: nuke-13 deadline_cloud_for_nuke
jobEnvironments:
- name: Rez
description: Initializes and destroys the Rez environment for the job.
Expand Down Expand Up @@ -179,7 +166,6 @@ steps:
continue_on_error: {{Param.ContinueOnError}}
proxy: {{Param.ProxyMode}}
script_file: '{{Param.NukeScriptFile}}'
version: '{{Param.NukeVersion}}'
write_nodes:
- '{{Param.WriteNode}}'
views:
Expand Down
3 changes: 1 addition & 2 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pytest-xdist ~= 3.3
twine ~= 4.0
mypy ~= 1.5
black ~= 23.7
ruff ~= 0.0.287
types-PyYAML ~= 6.0.12
ruff ~= 0.0.287
27 changes: 2 additions & 25 deletions src/deadline/nuke_submitter/job_bundle_output_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import shutil
import filecmp
import difflib
import yaml
from typing import Any
from pathlib import Path
from datetime import datetime, timezone
Expand All @@ -40,7 +39,7 @@
from deadline.client.ui import gui_error_handler
from deadline.client.ui.dialogs import submit_job_to_deadline_dialog
from deadline.client.exceptions import DeadlineOperationError
from .deadline_submitter_for_nuke import show_nuke_render_submitter_noargs, get_nuke_version
from .deadline_submitter_for_nuke import show_nuke_render_submitter_noargs


# The following functions expose a DCC interface to the job bundle output test logic.
Expand Down Expand Up @@ -112,22 +111,6 @@ def _show_deadline_cloud_submitter(mainwin: Any):
return show_nuke_render_submitter_noargs()


def _get_expected_nuke_version(expected_job_bundle_dir: str) -> str:
"""Returns the nuke version specified in provided job bundle"""
if os.path.exists(expected_job_bundle_dir):
expected_parameter_values_file = os.path.join(
expected_job_bundle_dir, "parameter_values.yaml"
)
if os.path.isfile(expected_parameter_values_file):
with open(expected_parameter_values_file, encoding="utf8") as f:
expected_parameter_values = yaml.safe_load(f)["parameterValues"]
for parameter_value in expected_parameter_values:
if parameter_value["name"] == "NukeVersion":
return parameter_value["value"]

return ""


# The following functions implement the test logic.


Expand Down Expand Up @@ -234,11 +217,6 @@ def _run_job_bundle_output_test(test_dir: str, dcc_scene_file: str, report_fh, m
# Close the DCC scene file
_close_dcc_scene_file()

expected_job_bundle_dir = os.path.join(test_dir, "expected_job_bundle")

test_nuke_version = get_nuke_version()
expected_nuke_version = _get_expected_nuke_version(expected_job_bundle_dir)

# Process every file in the job bundle to replace the temp dir with a standardized path.
# Also replace the nuke version in the test job bundle with the nuke version in the
# expected job bundle (if there is one). This allows job bundle tests to be run from
Expand All @@ -254,13 +232,12 @@ def _run_job_bundle_output_test(test_dir: str, dcc_scene_file: str, report_fh, m
contents = contents.replace(tempdir, "/normalized/job/bundle/dir")
contents = contents.replace(tempdir.replace("\\", "/"), "/normalized/job/bundle/dir")
contents = contents.replace(os.getcwd(), "/normalized/cwd")
if expected_nuke_version and expected_nuke_version != test_nuke_version:
contents = contents.replace(test_nuke_version, expected_nuke_version)
with open(full_filename, "w", encoding="utf8") as f:
f.write(contents)

# If there's an expected job bundle to compare with, do the comparison,
# otherwise copy the one we created to be that expected job bundle.
expected_job_bundle_dir = os.path.join(test_dir, "expected_job_bundle")
if os.path.exists(expected_job_bundle_dir):
test_job_bundle_dir = os.path.join(test_dir, "test_job_bundle")
if os.path.exists(test_job_bundle_dir):
Expand Down

0 comments on commit ce6d393

Please sign in to comment.