-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add OCIO configuration to Job Environments
Signed-off-by: Haejung Choi <chaejung@amazon.com>
- Loading branch information
Haejung Choi
committed
Sep 17, 2024
1 parent
82b7eb2
commit c3fd74d
Showing
10 changed files
with
321 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
|
||
from deadline.nuke_submitter.deadline_submitter_for_nuke import ( | ||
_add_ocio_path_to_job_template, | ||
_remove_ocio_path_from_job_template, | ||
) | ||
|
||
|
||
def test_add__dir_to_job_template(): | ||
job_template = { | ||
"parameterDefinitions": [], | ||
"steps": [ | ||
{ | ||
"name": "Render", | ||
"stepEnvironments": [ | ||
{ | ||
"name": "OtherEnv", | ||
}, | ||
], | ||
} | ||
], | ||
} | ||
|
||
_add_ocio_path_to_job_template(job_template) | ||
|
||
expected_environment = { | ||
"name": "Add OCIO Path to Environment Variable", | ||
"script": { | ||
"actions": {"onEnter": {"command": "{{Env.File.Enter}}"}}, | ||
"embeddedFiles": [ | ||
{ | ||
"name": "Enter", | ||
"type": "TEXT", | ||
"runnable": True, | ||
"data": """#!/bin/bash | ||
echo 'openjd_env: OCIO={{Param.OCIOConfigPath}}' | ||
""", | ||
} | ||
], | ||
}, | ||
} | ||
|
||
assert len(job_template["jobEnvironments"]) == 1 | ||
assert job_template["jobEnvironments"][0] == expected_environment | ||
|
||
|
||
def test_remove_ocio_path_from_job_template(): | ||
job_template = {"parameterDefinitions": [{"name": "OCIOConfigPath", "type": "PATH"}]} | ||
|
||
_remove_ocio_path_from_job_template(job_template) | ||
expected_job_template: dict = {"parameterDefinitions": []} | ||
|
||
assert len(job_template["parameterDefinitions"]) == 0 | ||
assert job_template == expected_job_template |
Oops, something went wrong.